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) $(OCAML_DEBUG_FLAGS)
15 OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLC_FLAGS)
16 OCAMLOPT = $(OCAMLFIND) opt $(OCAMLC_FLAGS)
17 OCAMLDEP = $(OCAMLFIND) ocamldep $(OCAML_FLAGS)
18 # objects for matita (GTK GUI)
23 matitaGeneratedGui.cmo \
30 matitaDisambiguator.cmo \
32 matitaInterpreter.cmo \
34 # objects for matitac (batch compiler)
42 matitaDisambiguator.cmo \
45 LIB_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(REQUIRES))
47 all: matita matitac cicbrowser
49 ifeq ($(HAVE_OCAMLOPT),yes)
50 CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
51 CCMXS = $(patsubst %.cmo,%.cmx,$(CCMOS))
52 LIBX_DEPS = $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(REQUIRES))
53 opt: matita.opt matitac.opt cicbrowser.opt
56 @echo "Native code compilation is disabled"
59 matita: $(LIB_DEPS) $(CMOS) matita.ml
60 $(OCAMLC) $(PKGS) -linkpkg -o $@ $(CMOS) matita.ml
61 matita.opt: $(LIBX_DEPS) $(CMXS) matita.ml
62 $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(CMXS) matita.ml
64 matitac: $(LIB_DEPS) $(CCMOS) matitac.ml
65 $(OCAMLC) $(CPKGS) -linkpkg -o $@ $(CCMOS) matitac.ml
66 matitac.opt: $(LIBX_DEPS) $(CMXS) matitac.ml
67 $(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml
70 @test -f $@ || ln -s $< $@
71 cicbrowser.opt: matita.opt
72 @test -f $@ || ln -s $< $@
74 matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade
75 $(LABLGLADECC) $< > matitaGeneratedGui.ml
76 $(OCAMLC) $(PKGS) -i matitaGeneratedGui.ml > matitaGeneratedGui.mli
79 $(OCAMLC) $(PKGS) -c $<
81 $(OCAMLC) $(PKGS) -c $<
83 $(OCAMLOPT) $(PKGS) -c $<
86 rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \
87 matita matita.opt matitac matitac.opt \
88 cicbrowser cicbrowser.opt
90 rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
91 rm -f config.log config.status Makefile buildTimeConf.ml
92 rm -f matita.glade.bak matita.gladep.bak
93 rm -rf autom4te.cache/
95 depend: matitaGeneratedGui.ml matitaGeneratedGui.mli
96 $(OCAMLDEP) *.ml *.mli > .depend
100 .PHONY: all opt clean distclean depend