From 9d6c683ab6ad75eaa314a4eb2421087c08e8d879 Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 12 Aug 2003 19:31:06 +0000 Subject: [PATCH] New --config directive passed to the linker git-svn-id: svn://svn.cc65.org/cc65/trunk@2291 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cl65/main.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/cl65/main.c b/src/cl65/main.c index 1156b7e50..e0edab79d 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -629,6 +629,7 @@ static void Usage (void) " --code-label name\tDefine and export a CODE segment label\n" " --code-name seg\tSet the name of the CODE segment\n" " --codesize x\t\tAccept larger code by factor x\n" + " --config name\t\tUse linker config file\n" " --cpu type\t\tSet cpu type\n" " --create-dep\t\tCreate a make dependency file\n" " --data-label name\tDefine and export a DATA segment label\n" @@ -757,6 +758,17 @@ static void OptCodeSize (const char* Opt attribute ((unused)), const char* Arg) +static void OptConfig (const char* Opt attribute ((unused)), const char* Arg) +/* Config file (linker) */ +{ + if (LinkerConfig) { + Error ("Cannot specify -C/--config twice"); + } + LinkerConfig = Arg; +} + + + static void OptCPU (const char* Opt attribute ((unused)), const char* Arg) /* Handle the --cpu option */ { @@ -1010,7 +1022,7 @@ static void OptVersion (const char* Opt attribute ((unused)), VER_MAJOR, VER_MINOR, VER_PATCH); } - + static void OptZeropageLabel (const char* Opt attribute ((unused)), const char* Arg) /* Handle the --zeropage-label option */ @@ -1044,6 +1056,7 @@ int main (int argc, char* argv []) { "--code-label", 1, OptCodeLabel }, { "--code-name", 1, OptCodeName }, { "--codesize", 1, OptCodeSize }, + { "--config", 1, OptConfig }, { "--cpu", 1, OptCPU }, { "--create-dep", 0, OptCreateDep }, { "--data-label", 1, OptDataLabel }, @@ -1118,7 +1131,7 @@ int main (int argc, char* argv []) OptStaticLocals (Arg, 0); } else { /* Specify linker config file */ - LinkerConfig = GetArg (&I, 2); + OptConfig (Arg, GetArg (&I, 2)); } break; -- 2.39.5