[sledge] Change build system to ensure report exe is built for testing

Reviewed By: jvillard

Differential Revision: D26250541

fbshipit-source-id: 31b96ac75
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 17a3bec2ca
commit e625780d73

@ -6,21 +6,19 @@
.PHONY: default .PHONY: default
default: exes default: exes
EXES = cli/sledge_cli report/sledge_report RELEASE_TARGETS = _build/release/cli/sledge_cli.exe _build/release/sledge.install
INSTALLS = sledge REPORT_TARGETS = _build/debug/report/sledge_report.exe
DEBUG_TARGETS = $(patsubst %,_build/debug/%.exe,$(EXES)) $(patsubst %,_build/debug/%.install,$(INSTALLS)) TARGETS = $(subst release,debug,$(RELEASE_TARGETS)) $(subst release,trace,$(RELEASE_TARGETS)) $(RELEASE_TARGETS) $(REPORT_TARGETS) _build/release/sledge-help.txt
TARGETS = $(DEBUG_TARGETS) $(subst debug,trace,$(DEBUG_TARGETS)) $(subst debug,release,$(DEBUG_TARGETS)) _build/release/sledge-help.txt dune_build_release = dune build $(RELEASE_TARGETS)
dune_install_release = dune install --context=release --prefix=_build/_install/release sledge 2>/dev/null
dune_build_debug = dune build $(DEBUG_TARGETS) dune_build_trace = $(subst release,trace,$(dune_build_release))
dune_install_debug = dune install --context=debug --prefix=_build/_install/debug sledge 2>/dev/null dune_install_trace = $(subst release,trace,$(dune_install_release))
dune_build_debug_release = $(subst debug,trace,$(dune_build_debug)) dune_build_debug = $(subst debug,debug,$(dune_build_release))
dune_install_debug_release = $(subst debug,trace,$(dune_install_debug)) dune_install_debug = $(subst debug,debug,$(dune_install_release))
dune_build_release = $(subst debug,release,$(dune_build_debug))
dune_install_release = $(subst debug,release,$(dune_install_debug))
.PHONY: check .PHONY: check
check: check:
@ -30,7 +28,7 @@ check:
exes: exes:
dune build $(TARGETS) dune build $(TARGETS)
$(dune_install_debug) $(dune_install_debug)
$(dune_install_debug_release) $(dune_install_trace)
$(dune_install_release) $(dune_install_release)
.PHONY: debug .PHONY: debug
@ -40,14 +38,18 @@ debug:
.PHONY: trace .PHONY: trace
trace: trace:
$(dune_build_debug_release) $(dune_build_trace)
$(dune_install_debug_release) $(dune_install_trace)
.PHONY: release .PHONY: release
release: release:
$(dune_build_release) $(dune_build_release)
$(dune_install_release) $(dune_install_release)
.PHONY: report
report:
dune build $(REPORT_TARGETS)
.PHONY: watch .PHONY: watch
watch: watch:
dune build --watch --terminal-persistence=clear-on-rebuild $(TARGETS) dune build --watch --terminal-persistence=clear-on-rebuild $(TARGETS)

@ -26,6 +26,10 @@ sledge_opt=./wrap.sh $(TIMEOUT) $(MEMOUT) $(SLEDGE_OPT)
sledge_report=$(CURDIR)/../_build/debug/report/sledge_report.exe sledge_report=$(CURDIR)/../_build/debug/report/sledge_report.exe
.PHONY: sledge_report_exe
sledge_report_exe:
$(MAKE) -C .. report
# which utilities to use # which utilities to use
diff?=patdiff diff?=patdiff
@ -98,10 +102,10 @@ translate.sexp:
baseline/translate.sexp: translate.sexp baseline/translate.sexp: translate.sexp
cp translate.sexp $@ cp translate.sexp $@
translate.html: translate.sexp translate.html: translate.sexp sledge_report_exe
$(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/translate.sexp translate.sexp -output $@ $(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/translate.sexp translate.sexp -output $@
translate-status: translate.sexp translate-status: translate.sexp sledge_report_exe
$(sledge_report) status -baseline baseline/translate.sexp translate.sexp | column -ts$$'\t' $(sledge_report) status -baseline baseline/translate.sexp translate.sexp | column -ts$$'\t'
# #
@ -134,10 +138,10 @@ analyze.sexp:
baseline/analyze.sexp: analyze.sexp baseline/analyze.sexp: analyze.sexp
cp analyze.sexp $@ cp analyze.sexp $@
analyze.html: analyze.sexp analyze.html: analyze.sexp sledge_report_exe
$(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/analyze.sexp analyze.sexp -output $@ $(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/analyze.sexp analyze.sexp -output $@
analyze-status: analyze.sexp analyze-status: analyze.sexp sledge_report_exe
$(sledge_report) status -baseline baseline/analyze.sexp analyze.sexp | column -ts$$'\t' $(sledge_report) status -baseline baseline/analyze.sexp analyze.sexp | column -ts$$'\t'
# #
@ -172,10 +176,10 @@ smt.sexp:
baseline/smt.sexp: smt.sexp baseline/smt.sexp: smt.sexp
cp smt.sexp $@ cp smt.sexp $@
smt.html: smt.sexp smt.html: smt.sexp sledge_report_exe
$(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/smt.sexp smt.sexp -output $@ $(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/smt.sexp smt.sexp -output $@
smt-status: smt.sexp smt-status: smt.sexp sledge_report_exe
$(sledge_report) status -baseline baseline/smt.sexp smt.sexp | column -ts$$'\t' $(sledge_report) status -baseline baseline/smt.sexp smt.sexp | column -ts$$'\t'
# #
@ -194,10 +198,10 @@ llvm.sexp:
baseline/llvm.sexp: llvm.sexp baseline/llvm.sexp: llvm.sexp
cp llvm.sexp $@ cp llvm.sexp $@
llvm.html: llvm.sexp llvm.html: llvm.sexp sledge_report_exe
$(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/llvm.sexp llvm.sexp -output $@ $(sledge_report) html $(SLEDGE_R_ARGS) -baseline baseline/llvm.sexp llvm.sexp -output $@
llvm-status: llvm.sexp llvm-status: llvm.sexp sledge_report_exe
$(sledge_report) status -baseline baseline/llvm.sexp llvm.sexp | column -ts$$'\t' $(sledge_report) status -baseline baseline/llvm.sexp llvm.sexp | column -ts$$'\t'
# #

Loading…
Cancel
Save