2 OCAMLFIND = @OCAMLFIND@
4 LABLGLADECC = @LABLGLADECC@
5 REQUIRES = @FINDLIB_REQUIRES@
6 CREQUIRES = @FINDLIB_CREQUIRES@
7 HAVE_OCAMLOPT = @HAVE_OCAMLOPT@
9 OCAML_FLAGS = -pp $(CAMLP4O)
10 PKGS = -package "$(REQUIRES)"
11 CPKGS = -package "$(CREQUIRES)"
12 OCAML_THREADS_FLAGS = -thread
13 OCAML_DEBUG_FLAGS = -g
14 OCAMLC_FLAGS = $(OCAML_FLAGS) $(OCAML_THREADS_FLAGS)
15 OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLC_FLAGS) $(OCAML_DEBUG_FLAGS)
16 OCAMLOPT = $(OCAMLFIND) opt $(OCAMLC_FLAGS)
17 OCAMLDEP = $(OCAMLFIND) ocamldep $(OCAML_FLAGS)
18 # objects for matita (GTK GUI)
26 matitaDisambiguator.cmo \
29 matitaGeneratedGui.cmo \
33 # objects for matitac (batch compiler)
41 matitaDisambiguator.cmo \
44 LIB_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(REQUIRES))
46 all: matita matitac cicbrowser
48 ifeq ($(HAVE_OCAMLOPT),yes)
49 CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
50 CCMXS = $(patsubst %.cmo,%.cmx,$(CCMOS))
51 LIBX_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(REQUIRES))
52 opt: matita.opt matitac.opt cicbrowser.opt
55 @echo "Native code compilation is disabled"
58 matita: $(LIB_DEPS) $(CMOS) matita.ml
59 $(OCAMLC) $(PKGS) -linkpkg -o $@ $(CMOS) matita.ml
60 matita.opt: $(LIBX_DEPS) $(CMXS) matita.ml
61 $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(CMXS) matita.ml
63 matitac: $(LIB_DEPS) $(CCMOS) matitac.ml
64 $(OCAMLC) $(CPKGS) -linkpkg -o $@ $(CCMOS) matitac.ml
65 matitac.opt: $(LIBX_DEPS) $(CMXS) matitac.ml
66 $(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml
69 @test -f $@ || ln -s $< $@
70 cicbrowser.opt: matita.opt
71 @test -f $@ || ln -s $< $@
73 matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade
74 $(LABLGLADECC) -embed $< > matitaGeneratedGui.ml
75 $(OCAMLC) $(PKGS) -i matitaGeneratedGui.ml > matitaGeneratedGui.mli
78 $(OCAMLC) $(PKGS) -c $<
80 $(OCAMLC) $(PKGS) -c $<
82 $(OCAMLOPT) $(PKGS) -c $<
84 $(OCAMLC) -dtypes $(PKGS) -c $<
87 rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \
88 matita matita.opt matitac matitac.opt \
89 cicbrowser cicbrowser.opt
91 rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
92 rm -f config.log config.status Makefile buildTimeConf.ml
93 rm -f matita.glade.bak matita.gladep.bak
94 rm -rf autom4te.cache/
99 otags -vi -r ../ocaml/ .
101 #.depend: matitaGeneratedGui.ml matitaGeneratedGui.mli *.ml *.mli
103 $(OCAMLDEP) *.ml *.mli > .depend
107 .PHONY: all opt clean distclean depend