]> git.sur5r.net Git - cc65/blobdiff - src/cc65/main.c
Added the io module
[cc65] / src / cc65 / main.c
index 083e323b6a65df39b5dd99a51e96cbb000382eea..3072cdb5743255935463c221366484df60486a0a 100644 (file)
@@ -93,7 +93,7 @@ static void Usage (void)
             "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"
@@ -101,7 +101,7 @@ static void Usage (void)
                     "  -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"
@@ -113,10 +113,12 @@ static void Usage (void)
             "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",
@@ -294,6 +296,14 @@ static void OptCPU (const char* Opt, const char* Arg)
 
 
 
+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 */
 {
@@ -330,6 +340,14 @@ static void OptSignedChars (const char* Opt, const char* Arg)
 
 
 
+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 */
 {
@@ -363,13 +381,15 @@ int main (int argc, char* argv[])
 {
     /* 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              },
@@ -400,10 +420,10 @@ int main (int argc, char* argv[])
 
                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':
@@ -440,8 +460,11 @@ int main (int argc, char* argv[])
                    while (*P) {
                        switch (*P++) {
                            case 'l':
-                               LocalsAreStatic = 1;
+                               OptStaticLocals (Arg, 0);
                                break;
+                           default:
+                               UnknownOption (Arg);
+                               break;
                        }
                    }
                    break;