From 571b5b209326f51a2920b0123a90238259eff361 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Tue, 14 Jun 2016 11:39:03 -0700 Subject: [PATCH] Prevent sbt from running multiple times in emulator If you have multi-target rules that don't have %s in them, make interprets that as "run this recipe multiple times, once to produce each target". If you have %s in the rules, then make interprets it as "run this recipe once to produce all targets". We want the second one. --- emulator/Makefrag-emulator | 4 ++-- emulator/Makefrag-verilator | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emulator/Makefrag-emulator b/emulator/Makefrag-emulator index cab1613c..642b58c6 100644 --- a/emulator/Makefrag-emulator +++ b/emulator/Makefrag-emulator @@ -27,10 +27,10 @@ $(addsuffix .o,$(CXXSRCS)): %.o: $(base_dir)/csrc/%.cc $(base_dir)/csrc/*.h $(mo $(addsuffix .debug.o,$(CXXSRCS)): %.debug.o: $(base_dir)/csrc/%.cc $(base_dir)/csrc/*.h $(model_header_debug) $(consts_header_debug) $(CXX) $(CXXFLAGS) -include $(scr_header_debug) -include $(model_header_debug) -include $(consts_header_debug) -I$(generated_dir_debug) -c -o $@ $< -$(generated_dir)/$(MODEL).$(CONFIG).d $(model_header) $(params_file): $(chisel_srcs) +$(generated_dir)/%.$(CONFIG).d $(generated_dir)/%.$(CONFIG).h $(generated_dir)/%.$(CONFIG).prm: $(chisel_srcs) cd $(base_dir) && $(SBT) "project $(PROJECT)" "run $(CHISEL_ARGS) --noIoDebug" -$(model_header_debug) $(params_file_debug): $(chisel_srcs) +$(generated_dir_debug)/%.$(CONFIG).d $(generated_dir_debug)/%.$(CONFIG).h $(generated_dir_debug)/%.$(CONFIG).prm: $(chisel_srcs) cd $(base_dir) && $(SBT) "project $(PROJECT)" "run $(CHISEL_ARGS)-debug --debug --vcd --ioDebug" $(emu): $(model_header) $(OBJS) libdramsim.a diff --git a/emulator/Makefrag-verilator b/emulator/Makefrag-verilator index ff61405b..b0489c59 100644 --- a/emulator/Makefrag-verilator +++ b/emulator/Makefrag-verilator @@ -19,7 +19,7 @@ $(generated_dir)/%.$(CONFIG).fir $(generated_dir)/%.$(CONFIG).prm $(generated_di cd $(base_dir) && $(SBT) "run $(PROJECT) $(MODEL) $(CONFIG) --targetDir $(generated_dir)" mv $(generated_dir)/$(MODEL).fir $(generated_dir)/$(MODEL).$(CONFIG).fir -$(generated_dir_debug)/%.$(MODEL).$(CONFIG).fir $(generated_dir_debug)/%.$(CONFIG).prm $(generated_dir_debug)/%.$(CONFIG).d: $(chisel_srcs) +$(generated_dir_debug)/%.$(CONFIG).fir $(generated_dir_debug)/%.$(CONFIG).prm $(generated_dir_debug)/%.$(CONFIG).d: $(chisel_srcs) mkdir -p $(dir $@) cd $(base_dir) && $(SBT) "run $(PROJECT) $(MODEL) $(CONFIG) --targetDir $(generated_dir_debug)" mv $(generated_dir_debug)/$(MODEL).fir $(generated_dir_debug)/$(MODEL).$(CONFIG).fir