X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fmain.c;h=b8aa72ed163fab98b8d53ba4fd6a4f2a8d252e18;hb=ead7de2b4299f8bb20264b03bbd70ca162d873bf;hp=d765e79b69a0c17344b1d2a950c62bb1f4fd5ee9;hpb=453a8b704fdcefb5ce88185d233281415a47a992;p=cc65 diff --git a/src/ld65/main.c b/src/ld65/main.c index d765e79b6..b8aa72ed1 100644 --- a/src/ld65/main.c +++ b/src/ld65/main.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2000 Ullrich von Bassewitz */ +/* (C) 1998-2002 Ullrich von Bassewitz */ /* Wacholderweg 14 */ /* D-70597 Stuttgart */ /* EMail: uz@musoftware.de */ @@ -89,21 +89,23 @@ static void Usage (void) fprintf (stderr, "Usage: %s [options] module ...\n" "Short options:\n" + " -C name\t\tUse linker config file\n" + " -Ln name\t\tCreate a VICE label file\n" + " -Lp\t\t\tMark write protected segments as such (VICE)\n" + " -S addr\t\tSet the default start address\n" + " -V\t\t\tPrint the linker version\n" " -h\t\t\tHelp (this text)\n" " -m name\t\tCreate a map file\n" " -o name\t\tName the default output file\n" " -t sys\t\tSet the target system\n" " -v\t\t\tVerbose mode\n" " -vm\t\t\tVerbose map file\n" - " -C name\t\tUse linker config file\n" - " -Ln name\t\tCreate a VICE label file\n" - " -Lp\t\t\tMark write protected segments as such (VICE)\n" - " -S addr\t\tSet the default start address\n" - " -V\t\t\tPrint the linker version\n" "\n" "Long options:\n" + " --config name\tUse linker config file\n" " --help\t\tHelp (this text)\n" " --mapfile name\tCreate a map file\n" + " --module-id id\tSpecify a module id\n" " --start-addr addr\tSet the default start address\n" " --target sys\t\tSet the target system\n" " --version\t\tPrint the linker version\n", @@ -234,7 +236,7 @@ static void OptDbgFile (const char* Opt attribute ((unused)), const char* Arg) -static void OptHelp (const char* Opt attribute ((unused)), +static void OptHelp (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print usage information and exit */ { @@ -252,6 +254,18 @@ static void OptMapFile (const char* Opt attribute ((unused)), const char* Arg) +static void OptModuleId (const char* Opt, const char* Arg) +/* Specify a module id */ +{ + unsigned long Id = CvtNumber (Opt, Arg); + if (Id > 0xFFFFUL) { + Error ("Range error in module id"); + } + ModuleId = (unsigned) Id; +} + + + static void OptStartAddr (const char* Opt, const char* Arg) /* Set the default start address */ { @@ -281,7 +295,7 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) -static void OptVersion (const char* Opt attribute ((unused)), +static void OptVersion (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print the assembler version */ { @@ -298,9 +312,10 @@ int main (int argc, char* argv []) /* Program long options */ static const LongOpt OptTab[] = { { "--config", 1, OptConfig }, - { "--dbgfile", 1, OptDbgFile }, - { "--help", 0, OptHelp }, - { "--mapfile", 1, OptMapFile }, + { "--dbgfile", 1, OptDbgFile }, + { "--help", 0, OptHelp }, + { "--mapfile", 1, OptMapFile }, + { "--module-id", 1, OptModuleId }, { "--start-addr", 1, OptStartAddr }, { "--target", 1, OptTarget }, { "--version", 0, OptVersion }, @@ -308,7 +323,7 @@ int main (int argc, char* argv []) unsigned I; - /* Initialize the cmdline module */ + /* Initialize the cmdline module */ InitCmdLine (&argc, &argv, "ld65"); /* Evaluate the CC65_LIB environment variable */