Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Config for OCamlMakefile
  2. BIN_DIR := bin
  3. RESULT := $(BIN_DIR)/civcc
  4. GLOBALS := types globals stringify util
  5. PHASES := load parse print desug context typecheck dimreduce boolop constprop \
  6. unroll index assemble peephole output
  7. SOURCES := $(addsuffix .mli,$(GLOBALS)) $(addsuffix .ml,$(GLOBALS)) \
  8. lexer.mll parser.mly main.mli \
  9. $(patsubst %,phases/%.mli,$(PHASES)) $(patsubst %,phases/%.ml,$(PHASES)) \
  10. main.ml
  11. PRE_TARGETS := types.ml $(addsuffix .cmi,$(GLOBALS))
  12. LIBS := str unix
  13. # Other config
  14. CIVAS := $(BIN_DIR)/civas
  15. CIVVM := $(BIN_DIR)/civvm
  16. DIST_TGT := civicaml.tar.gz
  17. DIST_FILES := $(RESULT) $(SOURCES) Makefile OCamlMakefile README.md test bin32 \
  18. .gitignore
  19. TESTSUITE_TGT := testsuite.tar.gz
  20. # Set debugging flag to enable exception backtraces for OCAMLRUNPARAM=b
  21. #OCAMLFLAGS := -g
  22. OCAMLYACC := menhir
  23. YFLAGS := --infer --explain
  24. .PHONY: all check dist testsuite myclean cleaner
  25. all: native-code
  26. clean:: myclean
  27. # The Types module needs an implementation file to stop ocamlc from complaining
  28. types.ml: types.mli
  29. cp $< $@
  30. check: all
  31. @cd test; \
  32. CIVAS=../$(CIVAS) \
  33. CIVVM=../$(CIVVM) \
  34. CIVCC=../$(RESULT) \
  35. CFLAGS="-v 1" \
  36. RUN_FUNCTIONAL=1 \
  37. bash run.bash basic preprocess nested_funs arrays
  38. dist: $(DIST_TGT)
  39. $(DIST_TGT): $(DIST_FILES)
  40. tar -czf $@ $^ --exclude=types.ml
  41. testsuite: $(TESTSUITE_TGT)
  42. $(TESTSUITE_TGT): TESTSUITE_README test
  43. tar -czf $@ $^
  44. myclean:
  45. rm -f a.out $(DIST_TGT) $(TESTSUITE_TGT)
  46. cleaner: clean
  47. rm -rf doc/$(RESULT)
  48. TOOLCHAIN_TGT := toolchain.tar.gz
  49. toolchain: $(TOOLCHAIN_TGT)
  50. $(TOOLCHAIN_TGT): $(RESULT) $(CIVAS) $(CIVVM)
  51. tar -czf $@ $(BIN_DIR)
  52. include OCamlMakefile