| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- # Config for OCamlMakefile
- BIN_DIR := bin
- RESULT := $(BIN_DIR)/civcc
- GLOBALS := types globals stringify util
- PHASES := load parse print context desug typecheck dimreduce boolop constprop \
- unroll index assemble peephole output
- SOURCES := $(addsuffix .mli,$(GLOBALS)) $(addsuffix .ml,$(GLOBALS)) \
- lexer.mll parser.mly main.mli \
- $(patsubst %,phases/%.mli,$(PHASES)) $(patsubst %,phases/%.ml,$(PHASES)) \
- main.ml
- PRE_TARGETS := types.ml $(addsuffix .cmi,$(GLOBALS))
- LIBS := str unix
- # Other config
- CIVAS := $(BIN_DIR)/civas
- CIVVM := $(BIN_DIR)/civvm
- DIST_TGT := civicaml.tar.gz
- DIST_FILES := $(BIN_DIR) $(SOURCES) Makefile OCamlMakefile README.md test \
- .gitignore
- TESTSUITE_TGT := testsuite.tar.gz
- TOOLCHAIN_TGT := toolchain.tar.gz
- # Set debugging flag to enable exception backtraces for OCAMLRUNPARAM=b
- OCAMLFLAGS := -g
- OCAMLYACC := menhir
- YFLAGS := --infer --explain
- .PHONY: all check dist testsuite myclean cleaner toolchain
- all: native-code
- # The Types module needs an implementation file to stop ocamlc from complaining
- types.ml: types.mli
- cp $< $@
- check: all $(CIVAS) $(CIVVM)
- @cd test; \
- CIVAS=../$(CIVAS) \
- CIVVM=../$(CIVVM) \
- CIVCC=../$(RESULT) \
- CFLAGS="-v 1" \
- RUN_FUNCTIONAL=1 \
- bash run.bash basic preprocess nested_funs arrays
- dist: $(DIST_TGT)
- $(DIST_TGT): $(DIST_FILES)
- tar -czf $@ $^ --exclude=types.ml
- testsuite: $(TESTSUITE_TGT)
- $(TESTSUITE_TGT): TESTSUITE_README test
- tar -czf $@ $^
- clean:: myclean
- myclean:
- rm -f a.out $(DIST_TGT) $(TESTSUITE_TGT) $(TOOLCHAIN_TGT)
- cleaner: clean
- rm -rf doc/$(RESULT) $(CIVAS) $(CIVVM)
- toolchain: $(TOOLCHAIN_TGT)
- $(TOOLCHAIN_TGT): all $(CIVAS) $(CIVVM)
- tar -czf $@ $(BIN_DIR)
- $(CIVAS): civic/as/civas
- make -C civic
- cp $< $@
- $(CIVVM): civic/vm/civvm
- cp $< $@
- doc/assembler.pdf: civic/docs/manual.pdf
- make -C $(<D)
- cp $< $@
- include OCamlMakefile
|