Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. RESULT := civicc
  2. GLOBALS := types globals stringify util
  3. PHASES := load parse print desug context typecheck extern dimreduce boolop \
  4. constprop 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; CIVAS=$(CIVAS) CIVVM=$(CIVVM) CIVCC=$(CIVCC) bash run.bash
  31. dist: $(DIST_TGT)
  32. $(DIST_TGT): $(DIST_FILES)
  33. tar -czvf $@ $^ --exclude=types.ml
  34. include OCamlMakefile