From a31285d3ad6c29ac0fda3dc3738961d2213464e2 Mon Sep 17 00:00:00 2001 From: Guillaume Bury Date: Wed, 5 Nov 2014 23:00:23 +0100 Subject: [PATCH] New bench target in root Makefile bench/Makefile now builds the test utility if not already built --- Makefile | 5 ++++- bench/Makefile | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 5000c118..0b981b9f 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ test: $(TEST) $(TEST): $(LIB) $(COMP) $(FLAGS) $(DIRS) $(TEST) +bench: $(TEST) + cd bench && $(MAKE) + log: cat _build/$(LOG) || true @@ -43,4 +46,4 @@ reinstall: all ocamlfind remove msat || true ocamlfind install msat $(TO_INSTALL) -.PHONY: clean doc all install uninstall reinstall +.PHONY: clean doc all bench install uninstall reinstall diff --git a/bench/Makefile b/bench/Makefile index 4f3b23e0..fdf4adc6 100644 --- a/bench/Makefile +++ b/bench/Makefile @@ -1,25 +1,27 @@ SOLVER :=../sat_solve.native OPTIONS :=-t 30s -s 1G -LOGDIR := $(shell echo "logs/`git rev-parse HEAD`") -LOGDIRE := $(shell echo "logs\/`git rev-parse HEAD`") -INDEX := $(shell echo "$(LOGDIR)/index") +LOGDIR := $(shell echo "./logs/`git rev-parse HEAD`") +INDEX := $(shell echo "./$(LOGDIR)/index") CNF := $(shell find -L ./ -name "*.cnf" -type f) DONE := $(addprefix $(LOGDIR)/raw/, $(CNF:.cnf=.done)) -PROVER := $(shell echo "$(LOGDIR)/prover") +PROVER := $(shell echo "./$(LOGDIR)/prover") CMD := $(PROVER) $(OPTIONS) all: $(INDEX) - @echo "All done." $(INDEX): $(PROVER) $(DONE) - @echo "Ended at `date +'%H:%M:%S %d/%m/%Y'`" > $(INDEX) - @echo "Index created" + @echo "Bench ended for commit `git rev-parse HEAD`" | tee -a $(INDEX) + @echo "Ended at `date +'%H:%M:%S %d/%m/%Y'`" | tee -a $(INDEX) -$(PROVER): - @echo "Creating log directory..." && mkdir -p $(LOGDIR)/raw - @echo "Copying prover..." && cp $(SOLVER) $(PROVER) +$(PROVER): $(SOLVER) + @mkdir -p $(LOGDIR)/raw + @cp $(SOLVER) $(PROVER) + @echo "Bench started for commit `git rev-parse HEAD`" + +$(SOLVER): + cd .. && $(MAKE) $(LOGDIR)/raw/%.done : $(PROVER) @mkdir -p $(dir $@)