]> git.sur5r.net Git - cc65/commitdiff
Added preliminary support for -t option.
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 27 Dec 2011 16:53:11 +0000 (16:53 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 27 Dec 2011 16:53:11 +0000 (16:53 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5327 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/grc65/grc65.c

index e45e8bc224371df71c13470c5a01ce557a45c455..e685c59cf59b015d81b5cff4cd226e1b8197eb15 100644 (file)
@@ -25,6 +25,7 @@
 #include "fname.h"
 #include "abend.h"
 #include "chartype.h"
+#include "target.h"
 #include "xmalloc.h"
 
 /* I hope that no one will be able to create a .grc bigger than this... */
@@ -100,6 +101,7 @@ char *ProgName;     /* for AbEnd, later remove and use common/cmdline.h */
 char *outputCName = NULL, *outputSName = NULL;
 FILE *outputCFile, *outputSFile;
 int CFnum = 0, SFnum = 0;
+int apple = 0;
 char outputCMode[2] = "w";
 char outputSMode[2] = "w";
 
@@ -110,7 +112,8 @@ void printUsage(void) {
            "Options:\n"
            "\t-h, -?\t\tthis help\n"
            "\t-o name\t\tname C output file\n"
-           "\t-s name\t\tname asm output file\n",
+           "\t-s name\t\tname asm output file\n"
+           "\t-t sys\t\tset target system\n",
            ProgName);
 }
 
@@ -740,6 +743,18 @@ int main(int argc, char *argv[]) {
                 case 's':
                     outputSName = argv[++i];
                     break;
+                case 't':
+                    switch (FindTarget(argv[++i])) {
+                        case TGT_GEOS: // todo: TGT_GEOS-CBM
+                            apple = 0;
+                            break;
+                        case TGT_COUNT: //todo: TGT_GEOS-APPLE
+                            apple = 1;
+                            break;
+                        default:
+                            AbEnd("unknown target system type %s\n", argv[i]);
+                    }
+                    break;
                 case 'h':
                 case '?':
                     printUsage();