export SHELL=/bin/bash
+NULL =
+
MAKEFLAGS+=--no-print-directory
OCAMLPATH = ../ocaml/METAS/
OCAMLFIND = OCAMLPATH=$(OCAMLPATH):$$OCAMLPATH @OCAMLFIND@
OCAMLOPT = $(OCAMLFIND) opt $(OCAMLC_FLAGS)
OCAMLDEP = $(OCAMLFIND) ocamldep $(OCAML_FLAGS)
+STATIC_LINK = dist/static_link/static_link
+STATIC_LIBS = \
+ t1 t1x \
+ gtkmathview_gmetadom mathview mathview_backend_gtk mathview_frontend_gmetadom \
+ gtksourceview-1.0 \
+ gdome gmetadom_gdome_cpp_smart \
+ stdc++ \
+ mysqlclient \
+ expat \
+ $(NULL)
+STATIC_EXTRA_LIBS = -cclib -lt1x -cclib -lstdc++ -cclib -lart_lgpl_2
+
MATITA_FLAGS =
NODB=false
ifeq ($(NODB),true)
MATITA_FLAGS += -nodb
endif
-
# objects for matita (GTK GUI)
-NULL =
CMOS = \
buildTimeConf.cmo \
matitaLog.cmo \
$(NULL)
CLEANCMOS = $(CCMOS)
MAKECMOS = $(CCMOS)
-PROGRAMS_BYTE = matita matitac cicbrowser matitadep matitaclean matitamake
-PROGRAMS = $(PROGRAMS_BYTE) matitatop dump_moo
+PROGRAMS_BYTE = matita matitac cicbrowser matitadep matitaclean matitamake dump_moo
+PROGRAMS = $(PROGRAMS_BYTE) matitatop
PROGRAMS_OPT = $(patsubst %,%.opt,$(PROGRAMS_BYTE))
+PROGRAMS_STATIC = $(patsubst %,%.static,$(PROGRAMS_OPT))
all: matita.conf.xml $(PROGRAMS) coq.moo
MAKELIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(MAKEREQUIRES))
MAKELIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(MAKEREQUIRES))
opt: $(PROGRAMS_OPT) coq.moo.opt
+static: $(PROGRAMS_STATIC) coq.moo.opt
+ strip *.static
else
opt:
@echo "Native code compilation is disabled"
+static:
+ @echo "Native code compilation is disabled"
endif
matita: $(LIB_DEPS) $(CMOS) matita.ml
$(OCAMLC) $(PKGS) -linkpkg -o $@ $(CMOS) matita.ml
matita.opt: $(LIBX_DEPS) $(CMXS) matita.ml
$(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(CMXS) matita.ml
+matita.opt.static: $(LIBX_DEPS) $(CMXS) matita.ml
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(CMXS) matita.ml \
+ $(STATIC_EXTRA_LIBS)
dump_moo: buildTimeConf.cmo matitaLog.cmo matitaMoo.cmo dump_moo.ml
$(OCAMLC) $(PKGS) -linkpkg -o $@ $^
+dump_moo.opt: buildTimeConf.cmx matitaLog.cmx matitaMoo.cmx dump_moo.ml
+ $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $^
+dump_moo.opt.static: buildTimeConf.cmx matitaLog.cmx matitaMoo.cmx dump_moo.ml
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $^ \
+ $(STATIC_EXTRA_LIBS)
matitac: $(CLIB_DEPS) $(CCMOS) matitac.ml
$(OCAMLC) $(CPKGS) -linkpkg -o $@ $(CCMOS) matitac.ml
matitac.opt: $(CLIBX_DEPS) $(CCMXS) matitac.ml
$(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml
+matitac.opt.static: $(CLIBX_DEPS) $(CCMXS) matitac.ml
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml \
+ $(STATIC_EXTRA_LIBS)
matitatop: matitatop.ml $(CLIB_DEPS) $(CCMOS)
$(OCAMLC) $(CPKGS) -linkpkg -o $@ toplevellib.cma $(CCMOS) $<
$(OCAMLC) $(DEPPKGS) -linkpkg -o $@ $(CCMOS) $<
matitadep.opt: matitadep.ml $(DEPLIB_DEPS) $(CCMXS)
$(OCAMLOPT) $(DEPPKGS) -linkpkg -o $@ $(CCMXS) $<
+matitadep.opt.static: matitadep.ml $(DEPLIB_DEPS) $(CCMXS)
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(DEPPKGS) -linkpkg -o $@ $(CCMXS) $< \
+ $(STATIC_EXTRA_LIBS)
matitaclean: matitaclean.ml $(CLEANLIB_DEPS) $(CLEANCMOS)
$(OCAMLC) $(CLEANPKGS) -linkpkg -o $@ $(CLEANCMOS) $<
matitaclean.opt: matitaclean.ml $(CLEANLIB_DEPS) $(CLEANCMXS)
$(OCAMLOPT) $(CLEANPKGS) -linkpkg -o $@ $(CLEANCMXS) $<
+matitaclean.opt.static: matitaclean.ml $(CLEANLIB_DEPS) $(CLEANCMXS)
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(CLEANPKGS) -linkpkg -o $@ $(CLEANCMXS) $< \
+ $(STATIC_EXTRA_LIBS)
matitamake: matitamake.ml $(MAKECMOS)
$(OCAMLC) $(PKGS) -linkpkg -o $@ $(MAKECMOS) $<
matitamake.opt: matitamake.ml $(MAKECMXS)
$(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(MAKECMXS) $<
+matitamake.opt.static: matitamake.ml $(MAKECMXS)
+ $(STATIC_LINK) $(STATIC_LIBS) -- \
+ $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(MAKECMXS) $< \
+ $(STATIC_EXTRA_LIBS)
cicbrowser: matita
@test -f $@ || ln -s $< $@
cicbrowser.opt: matita.opt
@test -f $@ || ln -s $< $@
+cicbrowser.opt.static: matita.opt.static
+ @test -f $@ || ln -s $< $@
matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade
$(LABLGLADECC) -embed $< > matitaGeneratedGui.ml
$(OCAMLC) -dtypes $(PKGS) -c $<
clean:
- rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \
- matita matita.opt matitac matitac.opt \
- cicbrowser cicbrowser.opt \
- matitadep matitadep.opt \
- matitaclean matitaclean.opt \
- matitamake matitamake.opt \
- matitatop matitatop.opt \
- dump_moo
+ rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \
+ $(PROGRAMS) \
+ $(PROGRAMS_OPT) \
+ $(PROGRAMS_STATIC) \
+ $(NULL)
distclean: clean
rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
rm -f config.log config.status Makefile buildTimeConf.ml
done
OCAMLFIND_COMMANDS=""
-AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
-if test $HAVE_OCAMLC_OPT = "yes"; then
- if test "$OCAMLFIND_COMMANDS" = ""; then
- OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
- else
- OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
- fi
-fi
-AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
-if test $HAVE_OCAMLOPT_OPT = "yes"; then
- if test "$OCAMLFIND_COMMANDS" = ""; then
- OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
- else
- OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
- fi
-fi
+# AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
+# if test $HAVE_OCAMLC_OPT = "yes"; then
+# if test "$OCAMLFIND_COMMANDS" = ""; then
+# OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
+# else
+# OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
+# fi
+# fi
+# AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
+# if test $HAVE_OCAMLOPT_OPT = "yes"; then
+# if test "$OCAMLFIND_COMMANDS" = ""; then
+# OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
+# else
+# OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
+# fi
+# fi
if test "$OCAMLFIND_COMMANDS" != ""; then
OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
fi