1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-10 13:29:50 +00:00
git-svn-id: svn://svn.cc65.org/cc65/trunk@1972 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-02-11 22:40:56 +00:00
parent 631aeb2a8d
commit 686f267324
6 changed files with 30 additions and 3 deletions

View File

@ -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));

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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"
};

View File

@ -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 */