Makefile 1.4 KB

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