1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
void main(int argc, list argv, list envp)
{
echo(USE_ECHO);
setGcompiler();
getCommand(argv); // determine command and option
setClasses(); // assign g_classes and g_nClasses
// note: also used by clean()
#ifdef PARSER_DIR // (re)construct the parser/scanner files
if (PARSER_DIR != "") // if modified or not yet available
checkGrammar();
#endif
#ifdef SCANNER_DIR
if (SCANNER_DIR != "")
checkLexer();
#endif
#ifdef MAIN
g_mainBase = get_base(MAIN); // also used by clean()
#endif
#ifdef SPCH_FILE
printf("\nSPCH_FILE is deprecated. Use SPCH_ARGS instead\n\n");
#endif
// run the requested command:
if (g_command == _clean) // completely clean tmp and
clean(); // locally defined precompiled headers
if (g_command == _cleanTmp) // keep the .gch files if existing.
cleanTmp();
if (g_command == _cleanGch)
cleanPrecomp();
#ifdef SPCH
#ifdef PRECOMP
spchPrecomp();
#endif
#ifdef CLS
cls();
#endif
precompileSPCH();
#endif
#ifdef PRECOMP
#ifdef SPCH
spchPrecomp();
#endif
md(g_gchDir);
#endif
if (g_command == _install)
install(); // install a compiled product
#ifdef CLS
cls();
#endif
// compile all sources except MAIN
build_libraries(); // if PRECOMP then precompiles headers
if (g_command == _program)
program();
#ifdef USE_ALL
cleanUseAll();
#endif
#ifdef PRECOMP
storeGch();
#endif
}
|