Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. TOOLCHAIN_TGT := toolchain.tar.gz
  21. # Set debugging flag to enable exception backtraces for OCAMLRUNPARAM=b
  22. #OCAMLFLAGS := -g
  23. OCAMLYACC := menhir
  24. YFLAGS := --infer --explain
  25. .PHONY: all check dist testsuite myclean cleaner
  26. all: native-code
  27. clean:: myclean
  28. # The Types module needs an implementation file to stop ocamlc from complaining
  29. types.ml: types.mli
  30. cp $< $@
  31. check: all
  32. @cd test; \
  33. CIVAS=../$(CIVAS) \
  34. CIVVM=../$(CIVVM) \
  35. CIVCC=../$(RESULT) \
  36. CFLAGS="-v 1" \
  37. RUN_FUNCTIONAL=1 \
  38. bash run.bash basic preprocess nested_funs arrays
  39. dist: $(DIST_TGT)
  40. $(DIST_TGT): $(DIST_FILES)
  41. tar -czf $@ $^ --exclude=types.ml
  42. testsuite: $(TESTSUITE_TGT)
  43. $(TESTSUITE_TGT): TESTSUITE_README test
  44. tar -czf $@ $^
  45. myclean:
  46. rm -f a.out $(DIST_TGT) $(TESTSUITE_TGT) $(TOOLCHAIN_TGT)
  47. cleaner: clean
  48. rm -rf doc/$(RESULT)
  49. toolchain: $(TOOLCHAIN_TGT)
  50. $(TOOLCHAIN_TGT): $(RESULT) $(CIVAS) $(CIVVM)
  51. tar -czf $@ $(BIN_DIR)
  52. include OCamlMakefile