/* */
/* */
/* */
-/* (C) 1999-2010, Ullrich von Bassewitz */
+/* (C) 1999-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
{
unsigned I;
- /* If we have a linker config file given, add it to the command line.
- * Otherwise pass the target to the linker if we have one.
- */
- if (LinkerConfig) {
- if (Module) {
- Error ("Cannot use -C and --module together");
- }
- CmdAddArg2 (&LD65, "-C", LinkerConfig);
- } else if (Module) {
- CmdSetTarget (&LD65, TGT_MODULE);
- } else {
- CmdSetTarget (&LD65, Target);
- }
-
- /* Determine which target libraries are needed */
- SetTargetFiles ();
-
/* Since linking is always the final step, if we have an output file name
* given, set it here. If we don't have an explicit output name given,
* try to build one from the name of the first input file.
}
+ /* If we have a linker config file given, add it to the command line.
+ * Otherwise pass the target to the linker if we have one.
+ */
+ if (LinkerConfig) {
+ if (Module) {
+ Error ("Cannot use -C and --module together");
+ }
+ CmdAddArg2 (&LD65, "-C", LinkerConfig);
+ } else if (Module) {
+ CmdSetTarget (&LD65, TGT_MODULE);
+ } else {
+ CmdSetTarget (&LD65, Target);
+ }
+
+ /* Determine which target libraries are needed */
+ SetTargetFiles ();
+
/* Add all object files as parameters */
for (I = 0; I < LD65.FileCount; ++I) {
CmdAddArg (&LD65, LD65.Files [I]);
" -d\t\t\t\tDebug mode\n"
" -g\t\t\t\tAdd debug info\n"
" -h\t\t\t\tHelp (this text)\n"
- " -l\t\t\t\tCreate an assembler listing\n"
+ " -l name\t\t\tCreate an assembler listing file\n"
" -m name\t\t\tCreate a map file\n"
" -mm model\t\t\tSet the memory model\n"
" -o name\t\t\tName the output file\n"
" --lib file\t\t\tLink this library\n"
" --lib-path path\t\tSpecify a library search path\n"
" --list-targets\t\tList all available targets\n"
- " --listing\t\t\tCreate an assembler listing\n"
+ " --listing name\t\tCreate an assembler listing file\n"
" --list-bytes n\t\tNumber of bytes per assembler listing line\n"
" --mapfile name\t\tCreate a map file\n"
" --memory-model model\t\tSet the memory model\n"
}
-
+
static void OptAsmDefine (const char* Opt attribute ((unused)), const char* Arg)
/* Define an assembler symbol (assembler) */
{
-static void OptListing (const char* Opt attribute ((unused)),
- const char* Arg attribute ((unused)))
+static void OptListing (const char* Opt attribute ((unused)), const char* Arg)
/* Create an assembler listing */
{
- CmdAddArg (&CA65, "-l");
+ CmdAddArg2 (&CA65, "-l", Arg);
}
static void OptListTargets (const char* Opt attribute ((unused)),
- const char* Arg attribute ((unused)))
+ const char* Arg attribute ((unused)))
/* List all targets */
{
unsigned I;
/* Print version number */
{
fprintf (stderr,
- "cl65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
+ "cl65 V%s - (C) Copyright 1998-2011 Ullrich von Bassewitz\n",
GetVersionAsString ());
}
{ "--lib", 1, OptLib },
{ "--lib-path", 1, OptLibPath },
{ "--list-targets", 0, OptListTargets },
- { "--listing", 0, OptListing },
+ { "--listing", 1, OptListing },
{ "--list-bytes", 1, OptListBytes },
{ "--mapfile", 1, OptMapFile },
{ "--memory-model", 1, OptMemoryModel },
case 'l':
/* Create an assembler listing */
- OptListing (Arg, 0);
+ OptListing (Arg, GetArg (&I, 2));
break;
case 'm':