"Short options:\n"
" -d\t\t\tDebug mode\n"
" -g\t\t\tAdd debug info to object file\n"
- " -h\t\t\tPrint this help\n"
+ " -h\t\t\tHelp (this text)\n"
" -j\t\t\tDefault characters are signed\n"
" -o name\t\tName the output file\n"
" -t sys\t\tSet the target system\n"
" -A\t\t\tStrict ANSI mode\n"
" -Cl\t\t\tMake local variables static\n"
" -Dsym[=defn]\t\tDefine a symbol\n"
- " -I path\t\tSet an include directory search path\n"
+ " -I dir\t\tSet an include directory search path\n"
" -O\t\t\tOptimize code\n"
" -Oi\t\t\tOptimize code, inline more code\n"
" -Or\t\t\tEnable register variables\n"
"Long options:\n"
" --ansi\t\tStrict ANSI mode\n"
" --cpu type\t\tSet cpu type\n"
+ " --debug\t\tDebug mode\n"
" --debug-info\t\tAdd debug info to object file\n"
" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet an include directory search path\n"
" --signed-chars\tDefault characters are signed\n"
+ " --static-locals\tMake local variables static\n"
" --target sys\t\tSet the target system\n"
" --verbose\t\tIncrease verbosity\n"
" --version\t\tPrint the compiler version number\n",
+static void OptDebug (const char* Opt, const char* Arg)
+/* Compiler debug mode */
+{
+ Debug = 1;
+}
+
+
+
static void OptDebugInfo (const char* Opt, const char* Arg)
/* Add debug info to the object file */
{
+static void OptStaticLocals (const char* Opt, const char* Arg)
+/* Place local variables in static storage */
+{
+ StaticLocals = 1;
+}
+
+
+
static void OptTarget (const char* Opt, const char* Arg)
/* Set the target system */
{
{
/* Program long options */
static const LongOpt OptTab[] = {
- { "--add-source", 0, OptAddSource },
+ { "--add-source", 0, OptAddSource },
{ "--ansi", 0, OptAnsi },
{ "--cpu", 1, OptCPU },
+ { "--debug", 0, OptDebug },
{ "--debug-info", 0, OptDebugInfo },
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--signed-chars", 0, OptSignedChars },
+ { "--static-locals", 0, OptStaticLocals },
{ "--target", 1, OptTarget },
{ "--verbose", 0, OptVerbose },
{ "--version", 0, OptVersion },
case '-':
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
- break;
+ break;
- case 'd': /* debug mode */
- Debug = 1;
+ case 'd':
+ OptDebug (Arg, 0);
break;
case 'h':
while (*P) {
switch (*P++) {
case 'l':
- LocalsAreStatic = 1;
+ OptStaticLocals (Arg, 0);
break;
+ default:
+ UnknownOption (Arg);
+ break;
}
}
break;