From: cuz Date: Tue, 11 Feb 2003 22:40:56 +0000 (+0000) Subject: Working X-Git-Tag: V2.12.0~1716 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=686f26732438a8c32d7176d8de0aeefc912ccd92;p=cc65 Working git-svn-id: svn://svn.cc65.org/cc65/trunk@1972 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/co65/convert.c b/src/co65/convert.c index ed9ff15a1..1edd23190 100644 --- a/src/co65/convert.c +++ b/src/co65/convert.c @@ -396,7 +396,7 @@ void Convert (const O65Data* D, const char* OutputFile) case O65_OS_CC65_MODULE: if (Model != O65_MODEL_NONE && Model != O65_MODEL_CC65_MODULE) { - Warning ("Wrong o65 model"); + Warning ("Wrong o65 model for input file specified"); } else { Model = O65_MODEL_CC65_MODULE; } @@ -430,7 +430,12 @@ void Convert (const O65Data* D, const char* OutputFile) } } - /* Open the output file */ + /* If we shouldn't generate output, we're done here */ + if (NoOutput) { + return; + } + + /* Open the output file */ F = fopen (OutputFile, "wb"); if (F == 0) { Error ("Cannot open `%s': %s", OutputFile, strerror (errno)); diff --git a/src/co65/global.c b/src/co65/global.c index 4d6219a22..8bce9aec3 100644 --- a/src/co65/global.c +++ b/src/co65/global.c @@ -68,6 +68,7 @@ const char* ZeropageLabel = 0; /* Label for the zeropage segmen /* Flags */ unsigned char DebugInfo = 0; /* Enable debug info */ +unsigned char NoOutput = 0; /* Suppress the actual conversion */ diff --git a/src/co65/global.h b/src/co65/global.h index 4359b4cda..8825b1072 100644 --- a/src/co65/global.h +++ b/src/co65/global.h @@ -65,6 +65,7 @@ extern const char* ZeropageLabel; /* Label for the zeropage segment */ /* Flags */ extern unsigned char DebugInfo; /* Enable debug info */ +extern unsigned char NoOutput; /* Suppress the actual conversion */ diff --git a/src/co65/main.c b/src/co65/main.c index db07b6a08..adb176637 100644 --- a/src/co65/main.c +++ b/src/co65/main.c @@ -75,6 +75,7 @@ static void Usage (void) " -g\t\t\tAdd debug info to object file\n" " -h\t\t\tHelp (this text)\n" " -m model\t\tOverride the o65 model\n" + " -n\t\t\tDon't generate an output file\n" " -o name\t\tName the output file\n" " -v\t\t\tIncrease verbosity\n" "\n" @@ -87,6 +88,7 @@ static void Usage (void) " --data-name seg\tSet the name of the DATA segment\n" " --debug-info\t\tAdd debug info to object file\n" " --help\t\tHelp (this text)\n" + " --no-output\t\tDon't generate an output file\n" " --o65-model model\tOverride the o65 model\n" " --verbose\t\tIncrease verbosity\n" " --version\t\tPrint the version number\n" @@ -228,6 +230,15 @@ static void OptHelp (const char* Opt attribute ((unused)), +static void OptNoOutput (const char* Opt attribute ((unused)), + const char* Arg attribute ((unused))) +/* Handle the --no-output option */ +{ + NoOutput = 1; +} + + + static void OptO65Model (const char* Opt attribute ((unused)), const char* Arg) /* Handle the --o65-model option */ { @@ -314,6 +325,7 @@ int main (int argc, char* argv []) { "--debug", 0, OptDebug }, { "--debug-info", 0, OptDebugInfo }, { "--help", 0, OptHelp }, + { "--no-output", 0, OptNoOutput }, { "--o65-model", 1, OptO65Model }, { "--verbose", 0, OptVerbose }, { "--version", 0, OptVersion }, @@ -353,6 +365,10 @@ int main (int argc, char* argv []) OptO65Model (Arg, GetArg (&I, 2)); break; + case 'n': + OptNoOutput (Arg, 0); + break; + case 'o': OutputName = GetArg (&I, 2); break; diff --git a/src/co65/model.c b/src/co65/model.c index db0232f63..f708876d5 100644 --- a/src/co65/model.c +++ b/src/co65/model.c @@ -53,7 +53,9 @@ O65Model Model = O65_MODEL_NONE; /* Name table */ static const char* NameTable[O65_MODEL_COUNT] = { - "none", + "none", + "os/a65", + "lunix", "cc65-module" }; diff --git a/src/co65/model.h b/src/co65/model.h index aa35a8f27..e9c3fc572 100644 --- a/src/co65/model.h +++ b/src/co65/model.h @@ -48,6 +48,8 @@ typedef enum { O65_MODEL_INVALID = -1, /* Invalid model */ O65_MODEL_NONE, /* No model given */ + O65_MODEL_OSA65, /* Not implemented */ + O65_MODEL_LUNIX, /* Not implemented */ O65_MODEL_CC65_MODULE, O65_MODEL_COUNT /* Number of available models */