Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. RESULT := civicc
  2. GLOBALS := types globals stringify util
  3. PHASES := load parse print desug context typecheck extern dimreduce boolop \
  4. constprop 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.tgz
  19. DIST_FILES := $(RESULT) $(SOURCES) Makefile OCamlMakefile README.md test bin32 \
  20. .gitignore
  21. .PHONY: myclean check dist
  22. all: native-code
  23. clean:: myclean
  24. # The Types module needs an implementation to stop ocamlc from complaining
  25. types.ml: types.mli
  26. cp $< $@
  27. myclean:
  28. rm -f a.out $(DIST_TGT)
  29. check: all
  30. @cd test; \
  31. CIVAS=../$(CIVAS) \
  32. CIVVM=../$(CIVVM) \
  33. CIVCC=../$(CIVCC) \
  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 -czvf $@ $^ --exclude=types.ml
  40. include OCamlMakefile