1 include ../../../Makefile.defs
5 REQUIRES = unix str helm-grafite_parser
7 MLS = types.ml options.ml \
8 gallina8Parser.ml gallina8Lexer.ml \
9 grafiteParser.ml grafiteLexer.ml \
10 grafite.ml engine.ml top.ml
11 MLIS = gallina8Parser.mli grafiteParser.mli grafite.mli engine.mli
12 CLEAN = gallina8Parser.ml gallina8Parser.mli gallina8Lexer.ml \
13 grafiteParser.ml grafiteParser.mli grafiteLexer.ml
17 LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
18 LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
20 CMOS = $(MLS:%.ml=%.cmo)
21 CMXS = $(MLS:%.ml=%.cmx)
22 CMIS = $(MLIS:%.mli=%.cmi)
25 OCAMLC = $(OCAMLFIND) ocamlc -thread -package "$(REQUIRES)" -linkpkg -rectypes
26 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread -package "$(REQUIRES)" -linkpkg -rectypes
27 OCAMLDEP = $(OCAMLFIND) ocamldep
31 all: transcript .depend
34 opt: transcript.opt $(EXTRAS) .depend.opt
37 transcript: $(CMIS) $(CMOS) $(EXTRAS)
38 @echo " OCAMLC $(CMOS)"
39 $(H)$(OCAMLC) -o $@ $(CMOS)
41 transcript.opt: $(CMIS) $(CMXS) $(EXTRAS)
42 @echo " OCAMLOPT $(CMXS)"
43 $(H)$(OCAMLOPT) -o $@ $(CMXS)
46 $(H)rm -f *.cm[iox] *.a *.o *.output
47 $(H)rm -f transcript transcript.opt $(CLEAN)
49 .depend: $(MLIS) $(MLS) $(EXTRAS)
50 @echo " OCAMLDEP $(MLIS) $(MLS)"
51 $(H)$(OCAMLDEP) $(MLIS) $(MLS) > .depend
53 .depend.opt: $(MLIS) $(MLS) $(EXTRAS)
54 @echo " OCAMLDEP -native $(MLIS) $(MLS)"
55 $(H)$(OCAMLDEP) -native $(MLIS) $(MLS) > .depend.opt
57 test: transcript transcript.conf.xml $(PACKAGES:%=%.conf.xml)
58 @echo " TRANSCRIPT $(PACKAGES)"
61 test.opt: transcript.opt transcript.conf.xml $(PACKAGES:%=%.conf.xml)
62 @echo " TRANSCRIPT.OPT $(PACKAGES)"
67 @echo " TAR transcript"
68 $(H)cd .. && tar --exclude=transcript/.svn -czf transcript.tgz transcript
72 depend.opt: .depend.opt
74 %.cmi: %.mli $(EXTRAS)
77 %.cmo %.cmi: %.ml $(EXTRAS) $(LIBRARIES)
80 %.o %.cmx %.cmi: %.ml $(EXTRAS) $(LIBRARIES_OPT)
83 %.ml %.mli: %.mly $(EXTRAS)
85 $(H)$(OCAMLYACC) -v $<
90 ifeq ($(MAKECMDGOALS),)
94 ifeq ($(MAKECMDGOALS), all)
98 ifeq ($(MAKECMDGOALS), opt)
102 ifeq ($(MAKECMDGOALS), test)
106 ifeq ($(MAKECMDGOALS), test.opt)