Makefile 1.4 KB

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