OCAML=ocaml OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLDEP=ocamldep OCAMLFLAGS=-I json -g OCAMLOPTFLAGS= CXX=g++ CXXFLAGS=-O2 -DNDEBUG -Wall -lrt #CXXFLAGS=-g -Wall -lrt EXES=tokeniser_ocaml tokeniser_ocaml_opt tokeniser_cpp tokeniser_test all: depend verify $(EXES) OCAML_SOURCES = \ common.ml \ codegen.ml \ lang_base.ml \ lang_cpp.ml \ lang_js.ml \ lang_perl.ml \ entities.ml \ tokeniser_interp.ml \ tokeniser_run.ml \ tokeniser_spec.ml \ tokeniser_test.ml \ treeconstructor_spec.ml \ treeconstructor_interp.ml \ treeconstructor_test.ml \ TOKENISER_OBJS=tokeniser_spec tokeniser_interp tokeniser_run tokeniser_test tokeniser_ocaml: $(addsuffix .cmo,$(TOKENISER_OBJS)) $(OCAMLC) $(OCAMLFLAGS) -o $@ $^ tokeniser_ocaml_opt: $(addsuffix .cmx,$(TOKENISER_OBJS)) $(OCAMLOPT) $(OCAMLOPTFLAGS) -o $@ $^ tokeniser_cpp: tokeniser.cpp tokeniser_auto.cpp $(CXX) $(CXXFLAGS) -o $@ $< tokeniser_auto.cpp tokeniser_auto.js tokeniser_auto.pl tokeniser_auto.py: common.cmo tokeniser_states.cmo tokeniser_spec.cmo lang_base.cmo lang_cpp.cmo lang_js.cmo lang_perl.cmo entities.cmo codegen.ml $(OCAML) str.cma $^ tokeniser_test: entities.cmo tokeniser_spec.cmo tokeniser_interp.cmo tokeniser_test.cmo ocamlfind $(OCAMLC) $(OCAMLFLAGS) -o $@ -package netstring str.cma unix.cma netsys.cma pcre.cma netstring.cma jsonwheel.cma $^ verify: .verify .verify: common.cmo tokeniser_states.cmo tokeniser_spec.cmo entities.cmo verify.ml $(OCAML) $^ touch .verify #test_gen: entities.cmo common.cmo tokeniser_states.cmo tokeniser_spec.cmo tokeniser_interp.cmo test_gen.ml # ocamlfind $(OCAMLC) $(OCAMLFLAGS) -o $@ $^ test_gen: entities.cmx common.cmx tokeniser_states.cmx tokeniser_spec.cmx tokeniser_interp.cmx test_gen.ml ocamlfind $(OCAMLOPT) $(OCAMLOPTFLAGS) -o $@ $^ ./test_gen dot -Tpng -o tokeniser_test_coverage.png tokeniser_test_coverage.dot graphs: graph_states.png graph_modes.svg graph_states.dot graph_modes.dot: common.cmo tokeniser_states.cmo tokeniser_spec.cmo treeconstructor_spec.cmo graph_gen.ml $(OCAML) str.cma $^ graph_states.png: graph_states.dot dot -Tpng -o graph_states.png graph_states.dot graph_modes.svg: graph_modes.dot dot -Tsvg -o graph_modes.svg graph_modes.dot sed -i s/font:/font-family:/ graph_modes.svg treeconstructor_spec.ml: treeconstructor.pl section-tree-construction.html ./treeconstructor.pl > .treeconstructor_spec.ml mv .treeconstructor_spec.ml treeconstructor_spec.ml treetest: treeconstructor_spec.cmo treeconstructor_interp.cmo treeconstructor_test.cmo ocamlfind $(OCAMLC) $(OCAMLFLAGS) -o $@ -package netstring unix.cma netsys.cma pcre.cma netstring.cma jsonwheel.cma $^ treeconstructor_auto.js: common.cmo treeconstructor_spec.cmo lang_base.cmo lang_js.cmo treeconstructor_codegen.ml $(OCAML) str.cma $^ .SUFFIXES: .ml .cmo .cmx .ml.cmo: $(OCAMLC) $(OCAMLFLAGS) -c $< .ml.cmx: $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $< clean: rm -f *.o *.cm[iox] .depend .verify $(EXES) tokeniser_auto.* treeconstructor_spec.ml graph.dot graph_states.png depend: .depend .depend: $(OCAML_SOURCES) $(OCAMLDEP) $(INCLUDES) $^ > .depend include .depend