using qfpreqcc is now vewy vewy qwiet ('e's 'unting wabbits)

This commit is contained in:
Bill Currie 2001-07-03 21:17:02 +00:00
parent 05db0ed9d0
commit b1f264b203
3 changed files with 49 additions and 23 deletions

View file

@ -542,6 +542,7 @@ typedef struct {
int cow; // copy on write for constants
int version; // maximum progs version to support (eg, 6 for id)
int warn_error; // treat warnings as errors
int quiet; // not so much chatter
} options_t;
extern options_t options;

View file

@ -267,13 +267,15 @@ WriteData (int crc)
// PrintGlobals ();
strofs = (strofs + 3) & ~3;
printf ("%6i strofs\n", strofs);
printf ("%6i statements\n", numstatements);
printf ("%6i functions\n", numfunctions);
printf ("%6i globaldefs\n", numglobaldefs);
printf ("%6i locals size\n", num_locals);
printf ("%6i fielddefs\n", numfielddefs);
printf ("%6i pr_globals\n", numpr_globals);
if (options.quiet < 2) {
printf ("%6i strofs\n", strofs);
printf ("%6i statements\n", numstatements);
printf ("%6i functions\n", numfunctions);
printf ("%6i globaldefs\n", numglobaldefs);
printf ("%6i locals size\n", num_locals);
printf ("%6i fielddefs\n", numfielddefs);
printf ("%6i pr_globals\n", numpr_globals);
}
h = SafeOpenWrite (destfile);
SafeWrite (h, &progs, sizeof (progs));
@ -330,7 +332,8 @@ WriteData (int crc)
SafeWrite (h, pr_globals, numpr_globals * 4);
printf ("%6i TOTAL SIZE\n", (int) ftell (h));
if (options.quiet < 2)
printf ("%6i TOTAL SIZE\n", (int) ftell (h));
progs.entityfields = pr.size_fields;
@ -694,7 +697,8 @@ PR_WriteProgdefs (char *filename)
unsigned short crc;
int c;
printf ("writing %s\n", filename);
if (!options.quiet)
printf ("writing %s\n", filename);
f = fopen (filename, "w");
// print global vars until the first field is defined
@ -873,6 +877,14 @@ Options: \n\
}
}
if (CheckParm ("--quiet=2")) { //FIXME: getopt, need getopt </#5>
options.quiet = 2;
}
if (CheckParm ("--quiet")) {
options.quiet = 1;
}
if (CheckParm ("--cow")) {
options.cow = 1;
}
@ -901,7 +913,8 @@ Options: \n\
Error ("No destination filename. qfcc --help for info.\n");
strcpy (destfile, com_token);
printf ("outputfile: %s\n", destfile);
if (!options.quiet)
printf ("outputfile: %s\n", destfile);
pr_dumpasm = false;
@ -917,7 +930,8 @@ Options: \n\
//yydebug = 1;
sprintf (filename, "%s/%s", sourcedir, com_token);
printf ("compiling %s\n", filename);
if (!options.quiet)
printf ("compiling %s\n", filename);
yyin = fopen (filename, "rt");
s_file = ReuseString (filename);
@ -929,7 +943,8 @@ Options: \n\
#else
char *src2;
sprintf (filename, "%s/%s", sourcedir, com_token);
printf ("compiling %s\n", filename);
if (!options.quiet)
printf ("compiling %s\n", filename);
LoadFile (filename, (void *) &src2);
if (!PR_CompileFile (src2, filename))
return 1;
@ -949,6 +964,7 @@ Options: \n\
WriteFiles ();
stop = Sys_DoubleTime ();
printf ("Compilation time: %.3f seconds.\n", (stop - start));
if (options.quiet < 2)
printf ("Compilation time: %.3f seconds.\n", (stop - start));
return 0;
}

View file

@ -26,6 +26,7 @@ progs_src = "progs.src"
compile_this_file = 1
keep_newlines = 1
check_redefines = 1
verbose = 0
def append_file (filename):
global current_file
@ -101,7 +102,8 @@ def include_file (fname):
def process_source (source_file):
global compile_this_file, current_file
print source_file
if verbose:
print source_file
compile_this_file = 1
includelist = 0
current_file = []
@ -185,6 +187,18 @@ def process_source (source_file):
f.write(l + '\n')
f.close ()
no_delete = 0
i = 0
while i < len (sys.argv):
if sys.argv[i] == '--keep':
no_delete = 1
del sys.argv[i]
continue
elif sys.argv[i] == '--verbose':
verbose = 1;
del sys.argv[i]
continue
i = i + 1
do_preprogs_src ()
for s in source_list:
if s[0]=='#':
@ -195,15 +209,10 @@ f.write (progs_dat + '\n\n')
for l in qcc_list:
f.write(l + '\n')
f.close ()
no_delete = 0
i = 0
while i < len (sys.argv):
if sys.argv[i] == '--keep':
no_delete = 1
del sys.argv[i]
continue
i = i + 1
args = ["qfcc"] + sys.argv[1:]
args = sys.argv[1:]
if not verbose:
args = ["--quiet=2"] + args
args = ["qfcc"] + args
if not os.fork():
os.execvp ("qfcc", args)
else: