Index: trunk/tools/finsig_vxworks.c
===================================================================
--- trunk/tools/finsig_vxworks.c	(revision 1291)
+++ trunk/tools/finsig_vxworks.c	(revision 1660)
@@ -89,7 +89,10 @@
 }
 
+FILE *out_fp;
+
 void usage()
 {
-    printf("finsig <primary> <base>\n");
+    if (out_fp) fprintf(out_fp,"finsig <primary> <base> <outputfilename>\n");
+    fprintf(stderr,"finsig <primary> <base> <outputfilename>\n");
     exit(1);
 }
@@ -112,6 +115,9 @@
     clock_t t1 = clock();
 
-    if (argc != 3)
+    if (argc != 4)
         usage();
+
+    out_fp = fopen(argv[3],"w");
+    if (out_fp == NULL) usage();
 
     f = fopen(argv[1], "r+b");
@@ -122,6 +128,6 @@
     base = strtoul(argv[2], NULL, 0);
 
-    printf("// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n");
-    printf("#include \"stubs_asm.h\"\n\n");
+    fprintf(out_fp,"// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n");
+    fprintf(out_fp,"#include \"stubs_asm.h\"\n\n");
 
     fseek(f,0,SEEK_END);
@@ -206,5 +212,5 @@
                         count ++;
                         if (count >= MAX_MATCHES){
-                            printf("// WARNING: too many matches for %s!\n", func_list[k].name);
+                            fprintf(out_fp,"// WARNING: too many matches for %s!\n", func_list[k].name);
                             break;
                         }
@@ -222,5 +228,5 @@
         // find best match and report results
         if (count == 0){
-            printf("// ERROR: %s is not found!\n", curr_name);
+            fprintf(out_fp,"// ERROR: %s is not found!\n", curr_name);
             ret = 1;
         } else {
@@ -230,10 +236,10 @@
 
             if (matches->fail > 0)
-                printf("// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail));
-
-            printf("NSTUB(%s, 0x%x)\n", curr_name, matches->ptr);
+                fprintf(out_fp,"// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail));
+
+            fprintf(out_fp,"NSTUB(%s, 0x%x)\n", curr_name, matches->ptr);
 
             for (i=1;i<count && matches[i].fail==matches[0].fail;i++){
-                printf("// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail);
+                fprintf(out_fp,"// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail);
             }
         }
@@ -242,5 +248,7 @@
     clock_t t2 = clock();
 
-    fprintf(stderr,"Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC);
+    printf("Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC);
+
+    fclose(out_fp);
 
     return ret;
