From e625780d734a82c34d83a0f3b63b213bcbcc7aeb Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 8 Feb 2021 13:10:45 -0800 Subject: [PATCH] [sledge] Change build system to ensure report exe is built for testing Reviewed By: jvillard Differential Revision: D26250541 fbshipit-source-id: 31b96ac75 --- sledge/Makefile | 30 ++++++++++++++++-------------- sledge/test/Makefile | 20 ++++++++++++-------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/sledge/Makefile b/sledge/Makefile index f833a57f5..ab0c614cf 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -6,21 +6,19 @@ .PHONY: default default: exes -EXES = cli/sledge_cli report/sledge_report -INSTALLS = sledge +RELEASE_TARGETS = _build/release/cli/sledge_cli.exe _build/release/sledge.install +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_install_debug = dune install --context=debug --prefix=_build/_install/debug sledge 2>/dev/null +dune_build_trace = $(subst release,trace,$(dune_build_release)) +dune_install_trace = $(subst release,trace,$(dune_install_release)) -dune_build_debug_release = $(subst debug,trace,$(dune_build_debug)) -dune_install_debug_release = $(subst debug,trace,$(dune_install_debug)) - -dune_build_release = $(subst debug,release,$(dune_build_debug)) -dune_install_release = $(subst debug,release,$(dune_install_debug)) +dune_build_debug = $(subst debug,debug,$(dune_build_release)) +dune_install_debug = $(subst debug,debug,$(dune_install_release)) .PHONY: check check: @@ -30,7 +28,7 @@ check: exes: dune build $(TARGETS) $(dune_install_debug) - $(dune_install_debug_release) + $(dune_install_trace) $(dune_install_release) .PHONY: debug @@ -40,14 +38,18 @@ debug: .PHONY: trace trace: - $(dune_build_debug_release) - $(dune_install_debug_release) + $(dune_build_trace) + $(dune_install_trace) .PHONY: release release: $(dune_build_release) $(dune_install_release) +.PHONY: report +report: + dune build $(REPORT_TARGETS) + .PHONY: watch watch: dune build --watch --terminal-persistence=clear-on-rebuild $(TARGETS) diff --git a/sledge/test/Makefile b/sledge/test/Makefile index 77dc5f16f..fae61d41b 100644 --- a/sledge/test/Makefile +++ b/sledge/test/Makefile @@ -26,6 +26,10 @@ sledge_opt=./wrap.sh $(TIMEOUT) $(MEMOUT) $(SLEDGE_OPT) sledge_report=$(CURDIR)/../_build/debug/report/sledge_report.exe +.PHONY: sledge_report_exe +sledge_report_exe: + $(MAKE) -C .. report + # which utilities to use diff?=patdiff @@ -98,10 +102,10 @@ translate.sexp: baseline/translate.sexp: 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 $@ -translate-status: translate.sexp +translate-status: translate.sexp sledge_report_exe $(sledge_report) status -baseline baseline/translate.sexp translate.sexp | column -ts$$'\t' # @@ -134,10 +138,10 @@ analyze.sexp: baseline/analyze.sexp: 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 $@ -analyze-status: analyze.sexp +analyze-status: analyze.sexp sledge_report_exe $(sledge_report) status -baseline baseline/analyze.sexp analyze.sexp | column -ts$$'\t' # @@ -172,10 +176,10 @@ smt.sexp: baseline/smt.sexp: 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 $@ -smt-status: smt.sexp +smt-status: smt.sexp sledge_report_exe $(sledge_report) status -baseline baseline/smt.sexp smt.sexp | column -ts$$'\t' # @@ -194,10 +198,10 @@ llvm.sexp: baseline/llvm.sexp: 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 $@ -llvm-status: llvm.sexp +llvm-status: llvm.sexp sledge_report_exe $(sledge_report) status -baseline baseline/llvm.sexp llvm.sexp | column -ts$$'\t' #