Mercurial > hg > index.cgi
diff lwasm/main.c @ 484:469a130e7029
Add option to suppress output file
Add --no-output to suppress creation of the output file altogether. Useful
when the assembler is used for other features without needing the assembled
object.
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 19 Mar 2019 14:45:53 -0600 |
parents | 141a1beb98ae |
children | 7fbf3171ca15 |
line wrap: on
line diff
--- a/lwasm/main.c Tue Mar 19 14:37:56 2019 -0600 +++ b/lwasm/main.c Tue Mar 19 14:45:53 2019 -0600 @@ -64,6 +64,7 @@ { "preprocess", 'P', 0, 0, "Preprocess macros and conditionals and output revised source to stdout" }, { "unicorns", 0x142, 0, 0, "Add sooper sekrit sauce"}, { "6800compat", 0x200, 0, 0, "Enable 6800 compatibility instructions, equivalent to --pragma=6800compat" }, + { "no-output", 0x105, 0, 0, "Inhibit creation of output file" }, { 0 } }; @@ -103,6 +104,11 @@ if (as -> output_file) lw_free(as -> output_file); as -> output_file = lw_strdup(arg); + as -> flags &= ~FLAG_NOOUT; + break; + + case 0x105: + as -> flags |= FLAG_NOOUT; break; case 'd': @@ -371,7 +377,7 @@ lw_free(n); } } - else + else if ((asmstate.flags & FLAG_NOOUT) == 0) { debug_message(&asmstate, 50, "Doing output"); do_output(&asmstate);