From: cuz Date: Fri, 20 Oct 2000 14:37:24 +0000 (+0000) Subject: Add the default libraries if both, a target and a config file are given. X-Git-Tag: V2.12.0~3141 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71aba577c8dae6748bdd5e4d7d353f275d3b6a17;p=cc65 Add the default libraries if both, a target and a config file are given. Previously no startup file and system library were passed to the linker if a configuration file was specified on the command line. git-svn-id: svn://svn.cc65.org/cc65/trunk@385 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cl65/main.c b/src/cl65/main.c index 8b9fe029a..62ce40e2e 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -336,17 +336,19 @@ static void Link (void) { unsigned I; - /* If we have a linker config file given, set the linker config file. - * Otherwise set the target system. + /* 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) { CmdAddArg (&LD65, "-C"); CmdAddArg (&LD65, LinkerConfig); - } else { + } else if (Target != TGT_NONE) { CmdSetTarget (&LD65, Target); - SetTargetFiles (); } + /* 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.