comparison lwasm/main.c @ 73:1f77ae5c3590

Added --dependnoerr flag to list dependencies on non-existent files without bailing out; also suppress error reports during dependency generation
author lost@l-w.ca
date Tue, 12 Apr 2011 17:56:51 -0600
parents ceab04fd2969
children ed7f970f3688
comparison
equal deleted inserted replaced
72:84eb35251849 73:1f77ae5c3590
47 { "symbols", 's', 0, lw_cmdline_opt_optional, "Generate symbol list in listing, no effect without --list"}, 47 { "symbols", 's', 0, lw_cmdline_opt_optional, "Generate symbol list in listing, no effect without --list"},
48 { "decb", 'b', 0, 0, "Generate DECB .bin format output, equivalent of --format=decb"}, 48 { "decb", 'b', 0, 0, "Generate DECB .bin format output, equivalent of --format=decb"},
49 { "raw", 'r', 0, 0, "Generate raw binary format output, equivalent of --format=raw"}, 49 { "raw", 'r', 0, 0, "Generate raw binary format output, equivalent of --format=raw"},
50 { "obj", 0x100, 0, 0, "Generate proprietary object file format for later linking, equivalent of --format=obj" }, 50 { "obj", 0x100, 0, 0, "Generate proprietary object file format for later linking, equivalent of --format=obj" },
51 { "depend", 0x101, 0, 0, "Output a dependency list to stdout; do not do any actual output though assembly is completed as usual" }, 51 { "depend", 0x101, 0, 0, "Output a dependency list to stdout; do not do any actual output though assembly is completed as usual" },
52 { "dependnoerr", 0x102, 0, 0, "Output a dependency list to stdout; do not do any actual output though assembly is completed as usual; don't bail on missing include files" },
52 { "pragma", 'p', "PRAGMA", 0, "Set an assembler pragma to any value understood by the \"pragma\" pseudo op"}, 53 { "pragma", 'p', "PRAGMA", 0, "Set an assembler pragma to any value understood by the \"pragma\" pseudo op"},
53 { "6809", '9', 0, 0, "Set assembler to 6809 only mode" }, 54 { "6809", '9', 0, 0, "Set assembler to 6809 only mode" },
54 { "6309", '3', 0, 0, "Set assembler to 6309 mode (default)" }, 55 { "6309", '3', 0, 0, "Set assembler to 6309 mode (default)" },
55 { "includedir", 'I', "PATH", 0, "Add entry to include path" }, 56 { "includedir", 'I', "PATH", 0, "Add entry to include path" },
56 { 0 } 57 { 0 }
106 as -> output_format = OUTPUT_OBJ; 107 as -> output_format = OUTPUT_OBJ;
107 break; 108 break;
108 109
109 case 0x101: 110 case 0x101:
110 as -> flags |= FLAG_DEPEND; 111 as -> flags |= FLAG_DEPEND;
112 break;
113
114 case 0x102:
115 as -> flags |= FLAG_DEPEND | FLAG_DEPENDNOERR;
111 break; 116 break;
112 117
113 case 'f': 118 case 'f':
114 if (!strcasecmp(arg, "decb")) 119 if (!strcasecmp(arg, "decb"))
115 as -> output_format = OUTPUT_DECB; 120 as -> output_format = OUTPUT_DECB;
238 debug_message(&asmstate, 50, "After pass %d (%s)\n", passnum, passlist[passnum].passname); 243 debug_message(&asmstate, 50, "After pass %d (%s)\n", passnum, passlist[passnum].passname);
239 dump_state(&asmstate); 244 dump_state(&asmstate);
240 245
241 if (asmstate.errorcount > 0) 246 if (asmstate.errorcount > 0)
242 { 247 {
248 if (asmstate.flags & FLAG_DEPEND)
249 {
250 // don't show errors during dependency scanning but
251 // stop processing immediately
252 break;
253 }
243 lwasm_show_errors(&asmstate); 254 lwasm_show_errors(&asmstate);
244 exit(1); 255 exit(1);
245 } 256 }
246 } 257 }
247 258