Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. TOP=../
  2. include $(TOP)/mk/paths.mk
  3. include tests.mk
  4. # Note: The use of ":=" rather than "=" ensures that the right-hand
  5. # side of TAG is not expanded multiple times.
  6. TAG := $(shell echo `date +"%Y%m%d-%H.%M"`-`hostname -s`)
  7. LOG_DIR = logs
  8. PROC_INFO := $(shell which procinfo)
  9. HOST_INFO := $(shell which hostinfo)
  10. ifeq ($(HOST_INFO),)
  11. ifeq ($(PROC_INFO),)
  12. INFO = echo "No info"
  13. else
  14. INFO = $(PROC_INFO)
  15. endif
  16. else
  17. INFO = $(HOST_INFO)
  18. endif
  19. logDir = $(LOG_DIR)/$(TAG)
  20. logFiles = $(patsubst %,$(logDir)/%,$(allTests))
  21. verbose = -v0 --profile=constraints --profile=metas
  22. all : clean $(logDir) $(logFiles)
  23. # If an error is encountered, then the logs are not removed.
  24. without-creating-logs : all
  25. @$(RUNGHC) Benchmark.hs $(TAG)
  26. rm -r $(logDir)
  27. summary :
  28. @$(RUNGHC) Benchmark.hs
  29. $(logDir) :
  30. @mkdir -p $@
  31. $(LOG_DIR)/$(TAG)/% :
  32. @echo Running benchmark $*
  33. @$(AGDA_BIN) $(verbose) --no-default-libraries $($*) +RTS -slogs/.tmp > $@
  34. @cat logs/.tmp >> $@
  35. @rm logs/.tmp
  36. @echo "──────────────────────────────────────────────────────────────────" >> $@
  37. @$(INFO) >> $@
  38. clean :
  39. @find . -type f -name '*.agdai' -delete