Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. RESULT := civicc
  2. GLOBALS := types globals stringify util
  3. PHASES := load parse print desug context typecheck dimreduce boolop extern \
  4. constprop index assemble peephole output
  5. SOURCES := $(addsuffix .mli,$(GLOBALS)) $(addsuffix .ml,$(GLOBALS)) \
  6. lexer.mll parser.mly \
  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. OCAMLFLAGS := -g
  12. OCAMLDOCFLAGS :=
  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
  20. .PHONY: myclean check dist
  21. all: native-code
  22. clean:: myclean
  23. # The Types module needs an implementation to stop ocamlc from complaining
  24. types.ml: types.mli
  25. cp $< $@
  26. myclean:
  27. rm -f a.out $(DIST_TGT)
  28. check: all
  29. @cd test; CIVAS=$(CIVAS) CIVVM=$(CIVVM) CIVCC=$(CIVCC) bash run.bash
  30. dist: $(DIST_TGT)
  31. $(DIST_TGT): $(DIST_FILES)
  32. tar -czvf $@ $^ --exclude=types.ml
  33. include OCamlMakefile