INC := -I $(shell camlp4o -where) -I . -I frontc/ FE := camlp4o ./mlex.cmo ./fe.cmo LIBSHELL := /usr/lib/ocaml/shell SHELLAR := dllshell.so TMPS := Makefile-test-out Makefile-test-out.c TMPS += Makefile-test-tmp Makefile-test-dump.ml Makefile-test.ml TMPS += clex.ml frontc/clexer.ml frontc/cparser.ml a.out all: fe.cmo be.cmo clean: rm -f *.c *.cmo *.cmi $(TMPS) frontc/*.cmo frontc/*.cmi mkc-fe mkc mkc-fe:./mlex.cmo ./fe.cmo mkcamlp4 -o $@ -I . $^ pr_o.cmo mkc: mkc-fe driver.ml mlex.cmo fe.cmo be.cmo mk.cmo frontc/frontc.cma ocamlc -I $(LIBSHELL) $(SHELLAR) -o mkc str.cma unix.cma shell.cma driver.ml test: Makefile-test-out ./Makefile-test-out test-dump: Makefile-test-dump.ml cat $< test-dump-c: Makefile-test-out.c cat $< Makefile-test-dump.ml: Makefile-test mk.cmo fe.cmo mlex.cmo $(FE) pr_o.cmo -impl $< >$@ Makefile-test.ml: ln -s Makefile-test Makefile-test.ml Makefile-test-tmp: mk.cmo be.cmo fe.cmo mlex.cmo Makefile-test.ml frontc/frontc.cma ocamlc -pp '$(FE)' -o $@ frontc/frontc.cma mk.cmo be.cmo -impl Makefile-test.ml Makefile-test-out.c: Makefile-test-tmp ./$< >$@ Makefile-test-out: Makefile-test-out.c gcc -o $@ $< be.cmo: be.ml clex.cmo cquot.cmo ocamlc -pp 'camlp4o ./clex.cmo ./cquot.cmo' -c $(INC) be.ml fe.cmo: fe.ml mk.cmo mlex.cmo ocamlc -pp 'camlp4o q_MLast.cmo pa_extend.cmo' -c $(INC) fe.ml # making cquot clex.cmo: clex.ml frontc/frontc.cma ocamlc -c clex.ml cquot.cmo: cquot.ml clex.cmo frontc/frontc.cma ocamlc -pp 'camlp4o q_MLast.cmo pa_extend.cmo' -c $(INC) cquot.ml # making frontc FC_ML:=frontc/cabs.ml frontc/cprint.ml frontc/frontc.ml frontc/rewrite.ml FC_MLI:=frontc/cabs.mli frontc/cparser.mli frontc/cprint.mli frontc/frontc.mli FC_CMO:=$(FC_ML:.ml=.cmo) FC_CMI:=$(FC_MLI:.mli=.cmi) frontc/cparser.cmo: frontc/cabs.cmi frontc/clexer.cmi frontc/clexer.cmo: frontc/cabs.cmi frontc/cparser.cmi frontc/cprint.cmi : frontc/cabs.cmi $(FC_CMO) : $(FC_CMI) frontc/clexer.cmo frontc/cparser.cmo frontc/frontc.cma: $(FC_CMO) ocamlc -a -o $@ $^ # basic pattern rules %.ml: %.mly ocamlyacc $< %.ml: %.mll ocamllex $< %.cmi: %.mli ocamlc -c $(INC) $< %.cmo: %.ml ocamlc -c $(INC) $< # presentation rules P=ols-lang-eng .PHONY: present present-end present-end: $P.mgp mgp -x vflib -t 120 $P.mgp -p 38 present: $P.mgp mgp -x vflib -t 120 $P.mgp $P.ps: $P.mgp mgp2ps -t -p letter $P.mgp >$P.ps