diff options
-rw-r--r-- | cparser/GNUmakefile | 3 | ||||
-rw-r--r-- | driver/Driver.ml | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cparser/GNUmakefile b/cparser/GNUmakefile index c2792301..d83c49e5 100644 --- a/cparser/GNUmakefile +++ b/cparser/GNUmakefile @@ -68,7 +68,7 @@ DATABASE := handcrafted.messages # We use (GNU) cut when de-lexing examples sentences. -CUT := $(shell if which gcut >/dev/null ; then echo gcut ; else echo cut ; fi) +CUT := $(shell if which gcut >&/dev/null ; then echo gcut ; else echo cut ; fi) # ------------------------------------------------------------------------------ @@ -184,4 +184,3 @@ clean: rm -f pre_parser.messages rm -f $(DATABASE).raw $(DATABASE).bak rm -f deLexer - diff --git a/driver/Driver.ml b/driver/Driver.ml index 8fe6b07d..a0d742c2 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -20,6 +20,9 @@ open Timing let stdlib_path = ref Configuration.stdlib_path +(* Optional sdump suffix *) +let sdump_suffix = ref ".json" + (* Invocation of external tools *) let command ?stdout args = @@ -180,7 +183,7 @@ let compile_c_ast sourcename csyntax ofile debug = exit 2 in (* Dump Asm in binary and JSON format *) if !option_sdump then - dump_jasm asm (output_filename sourcename ".c" ".json"); + dump_jasm asm (output_filename sourcename ".c" !sdump_suffix); (* Print Asm in text form *) let oc = open_out ofile in PrintAsm.print_program oc asm debug; @@ -470,7 +473,7 @@ Tracing options: -dltl Save LTL after register allocation in <file>.ltl -dmach Save generated Mach code in <file>.mach -dasm Save generated assembly in <file>.s - -sdump Save info for post-linking validation in <file>.sdump + -sdump Save info for post-linking validation in <file>.json General options: -stdlib <dir> Set the path of the Compcert run-time library -v Print external commands before invoking them @@ -581,6 +584,7 @@ let cmdline_actions = Exact "-dmach", Set option_dmach; Exact "-dasm", Set option_dasm; Exact "-sdump", Set option_sdump; + Exact "-sdump-suffix", String (fun s -> option_sdump := true; sdump_suffix:= s); (* General options *) Exact "-v", Set option_v; Exact "-stdlib", String(fun s -> stdlib_path := s); |