1 include ../../../Makefile.defs
5 REQUIRES = unix str helm-grafite_parser
7 MLS = types.ml options.ml v8Parser.ml v8Lexer.ml grafite.ml engine.ml top.ml
8 MLIS = v8Parser.mli grafite.mli engine.mli
9 CLEAN = v8Parser.ml v8Parser.mli v8Lexer.ml
13 LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
14 LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
16 CMOS = $(MLS:%.ml=%.cmo)
17 CMXS = $(MLS:%.ml=%.cmx)
18 CMIS = $(MLIS:%.mli=%.cmi)
21 OCAMLC = $(OCAMLFIND) ocamlc -thread -package "$(REQUIRES)" -linkpkg -rectypes
22 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread -package "$(REQUIRES)" -linkpkg -rectypes
23 OCAMLDEP = $(OCAMLFIND) ocamldep
27 all: transcript .depend
30 opt: transcript.opt $(EXTRAS) .depend.opt
33 transcript: $(CMIS) $(CMOS) $(EXTRAS)
34 @echo " OCAMLC $(CMOS)"
35 $(H)$(OCAMLC) -o $@ $(CMOS)
37 transcript.opt: $(CMIS) $(CMXS) $(EXTRAS)
38 @echo " OCAMLOPT $(CMXS)"
39 $(H)$(OCAMLOPT) -o $@ $(CMXS)
42 $(H)rm -f *.cm[iox] *.a *.o *.output
43 $(H)rm -f transcript transcript.opt $(CLEAN)
45 .depend: $(MLIS) $(MLS) $(EXTRAS)
46 @echo " OCAMLDEP $(MLIS) $(MLS)"
47 $(H)$(OCAMLDEP) $(MLIS) $(MLS) > .depend
49 .depend.opt: $(MLIS) $(MLS) $(EXTRAS)
50 @echo " OCAMLDEP -native $(MLIS) $(MLS)"
51 $(H)$(OCAMLDEP) -native $(MLIS) $(MLS) > .depend.opt
53 test: transcript transcript.conf.xml $(PACKAGES:%=%.conf.xml)
54 @echo " TRANSCRIPT $(PACKAGES)"
57 test.opt: transcript.opt transcript.conf.xml $(PACKAGES:%=%.conf.xml)
58 @echo " TRANSCRIPT.OPT $(PACKAGES)"
63 @echo " TAR transcript"
64 $(H)cd .. && tar --exclude=transcript/.svn -czf transcript.tgz transcript
68 depend.opt: .depend.opt
70 %.cmi: %.mli $(EXTRAS)
73 %.cmo %.cmi: %.ml $(EXTRAS) $(LIBRARIES)
76 %.o %.cmx %.cmi: %.ml $(EXTRAS) $(LIBRARIES_OPT)
79 %.ml %.mli: %.mly $(EXTRAS)
81 $(H)$(OCAMLYACC) -v $<
86 ifeq ($(MAKECMDGOALS),)
90 ifeq ($(MAKECMDGOALS), all)
94 ifeq ($(MAKECMDGOALS), opt)
98 ifeq ($(MAKECMDGOALS), test)
102 ifeq ($(MAKECMDGOALS), test.opt)