generate progdefs.h only for v6only

generate files.dat only if -F or --files is given on the command line
This commit is contained in:
Bill Currie 2002-01-21 23:30:54 +00:00
parent b4bdda994f
commit f1f2dd713d
2 changed files with 11 additions and 3 deletions

View file

@ -594,6 +594,7 @@ typedef struct {
int verbosity; // 0=silent, goes up to 2 currently int verbosity; // 0=silent, goes up to 2 currently
qboolean save_temps; // save temporary files qboolean save_temps; // save temporary files
qboolean files_dat; // generate files.dat
} options_t; } options_t;
extern options_t options; extern options_t options;

View file

@ -79,6 +79,7 @@ static struct option const long_options[] = {
{"warn", required_argument, 0, 'W'}, {"warn", required_argument, 0, 'W'},
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'}, {"version", no_argument, 0, 'V'},
{"files", no_argument, 0, 'F'},
#ifdef USE_CPP #ifdef USE_CPP
{"define", required_argument, 0, 'D'}, {"define", required_argument, 0, 'D'},
{"include", required_argument, 0, 'I'}, {"include", required_argument, 0, 'I'},
@ -741,6 +742,7 @@ DecodeArgs (int argc, char **argv)
while ((c = getopt_long (argc, argv, "s:" // source dir while ((c = getopt_long (argc, argv, "s:" // source dir
"P:" // progs.src name "P:" // progs.src name
"F" // generate files.dat
"q" // quiet "q" // quiet
"v" // verbose "v" // verbose
"g" // debug "g" // debug
@ -769,6 +771,9 @@ DecodeArgs (int argc, char **argv)
case 'P': // progs-src case 'P': // progs-src
progs_src = strdup (optarg); progs_src = strdup (optarg);
break; break;
case 'F':
options.files_dat = true;
break;
case 'q': // quiet case 'q': // quiet
options.verbosity -= 1; options.verbosity -= 1;
break; break;
@ -921,7 +926,7 @@ main (int argc, char **argv)
{ {
char *src; char *src;
char filename[1024]; char filename[1024];
int crc; int crc = 0;
double start, stop; double start, stop;
start = Sys_DoubleTime (); start = Sys_DoubleTime ();
@ -1118,13 +1123,15 @@ main (int argc, char **argv)
Error ("compilation errors"); Error ("compilation errors");
// write progdefs.h // write progdefs.h
crc = PR_WriteProgdefs ("progdefs.h"); if (options.code.progsversion == PROG_ID_VERSION)
crc = PR_WriteProgdefs ("progdefs.h");
// write data file // write data file
WriteData (crc); WriteData (crc);
// write files.dat // write files.dat
WriteFiles (); if (options.files_dat)
WriteFiles ();
stop = Sys_DoubleTime (); stop = Sys_DoubleTime ();
if (options.verbosity >= 0) if (options.verbosity >= 0)