" --check-stack\t\tGenerate stack overflow checks\n"
" --code-name seg\tSet the name of the CODE segment\n"
" --codesize x\t\tAccept larger code by factor x\n"
" --check-stack\t\tGenerate stack overflow checks\n"
" --code-name seg\tSet the name of the CODE segment\n"
" --codesize x\t\tAccept larger code by factor x\n"
" --create-dep\t\tCreate a make dependency file\n"
" --data-name seg\tSet the name of the DATA segment\n"
" --debug\t\tDebug mode\n"
" --create-dep\t\tCreate a make dependency file\n"
" --data-name seg\tSet the name of the DATA segment\n"
" --debug\t\tDebug mode\n"
" --debug-opt name\tDebug optimization steps\n"
" --disable-opt name\tDisable an optimization step\n"
" --enable-opt name\tEnable an optimization step\n"
" --debug-opt name\tDebug optimization steps\n"
" --disable-opt name\tDisable an optimization step\n"
" --enable-opt name\tEnable an optimization step\n"
" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet an include directory search path\n"
" --list-opt-steps\tList all optimizer steps and exit\n"
" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet an include directory search path\n"
" --list-opt-steps\tList all optimizer steps and exit\n"
static void OptCPU (const char* Opt, const char* Arg)
/* Handle the --cpu option */
{
static void OptCPU (const char* Opt, const char* Arg)
/* Handle the --cpu option */
{
- if (strcmp (Arg, "6502") == 0) {
- CPU = CPU_6502;
- } else if (strcmp (Arg, "65C02") == 0) {
- CPU = CPU_65C02;
- } else {
+ /* Find the CPU from the given name */
+ CPU = FindCPU (Arg);
+ if (CPU != CPU_6502 && CPU != CPU_65C02) {
+static void OptForgetIncPaths (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* Forget all currently defined include paths */
+{
+ ForgetAllIncludePaths ();
+}
+
+
+
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{ "--debug-info", 0, OptDebugInfo },
{ "--debug-opt", 1, OptDebugOpt },
{ "--disable-opt", 1, OptDisableOpt },
{ "--debug-info", 0, OptDebugInfo },
{ "--debug-opt", 1, OptDebugOpt },
{ "--disable-opt", 1, OptDisableOpt },
- { "--enable-opt", 1, OptEnableOpt, },
+ { "--enable-opt", 1, OptEnableOpt },
+ { "--forget-inc-paths", 0, OptForgetIncPaths },
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--list-opt-steps", 0, OptListOptSteps },
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--list-opt-steps", 0, OptListOptSteps },
+ /* If no CPU given, use the default CPU for the target */
+ if (CPU == CPU_UNKNOWN) {
+ if (Target != TGT_UNKNOWN) {
+ CPU = DefaultCPU[Target];
+ } else {
+ CPU = CPU_6502;
+ }
+ }
+