Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. CIVCC := ./$(RESULT)
  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
  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=../$(CIVCC) \
  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. include OCamlMakefile