* Added sfr space
[fw/sdcc] / src / SDCCmain.c
index c47d9109a0a6a5dac3b8b645bb4c552afe832b81..5438a081d151522294a52f0706a12ddb647c4059 100644 (file)
@@ -128,18 +128,34 @@ static const char *_preCmd[] = {
     "-I" SDCC_INCLUDE_DIR, "$l", "$1", "$2", NULL
 };
 
+#if !OPT_DISABLE_MCS51
 extern PORT mcs51_port;
-extern PORT z80_port;
+#endif
+#if !OPT_DISABLE_GBZ80
 extern PORT gbz80_port;
+#endif
+#if !OPT_DISABLE_Z80
+extern PORT z80_port;
+#endif
+#if !OPT_DISABLE_AVR
 extern PORT avr_port;
+#endif
 
 PORT *port;
 
 static PORT *_ports[] = {
-    &mcs51_port,
-    &z80_port,
+#if !OPT_DISABLE_MCS51
+   &mcs51_port,
+#endif
+#if !OPT_DISABLE_GBZ80
     &gbz80_port,
-    &avr_port
+#endif
+#if !OPT_DISABLE_Z80
+    &z80_port,
+#endif
+#if !OPT_DISABLE_AVR
+    &avr_port,
+#endif
 };
 
 #define NUM_PORTS (sizeof(_ports)/sizeof(_ports[0]))
@@ -1298,7 +1314,6 @@ int main ( int argc, char **argv , char **envp)
        printUsage();
        exit(0);
     }
-
        
     if (srcFileName)
        preProcess(envp) ;
@@ -1316,7 +1331,7 @@ int main ( int argc, char **argv , char **envp)
            if (!options.c1mode)
                assemble(envp);
        } else {
-           exit(-1);
+           return 1;
         }
        
     }
@@ -1338,6 +1353,7 @@ int main ( int argc, char **argv , char **envp)
         unlink(preOutName);
         free(preOutName);
     }
+
     return 0;
     
 }