# coq.moo.opt: library/legacy/coq.ma matitac.opt
# ./matitac.opt $(MATITA_FLAGS) $<
-ifeq ($(HAVE_OCAMLOPT),yes)
-
CMXS = $(patsubst %.cmo,%.cmx,$(CMOS))
CCMXS = $(patsubst %.cmo,%.cmx,$(CCMOS))
MAINCMXS = $(patsubst %.cmo,%.cmx,$(MAINCMOS))
LIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(MATITA_REQUIRES))
CLIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(MATITA_CREQUIRES))
CLIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(MATITA_CREQUIRES))
-.PHONY: opt
-opt: $(PROGRAMS_OPT) coq.moo.opt
-.PHONY: upx
-upx: $(PROGRAMS_UPX) coq.moo.opt
+opt: $(PROGRAMS_OPT)
+upx: $(PROGRAMS_UPX)
+.PHONY: opt upx
+ifeq ($(HAVE_OCAMLOPT),yes)
+world: all opt
else
-
-opt:
- @echo "Native code compilation is disabled"
-
+world: all
endif
matita: matita.ml $(LIB_DEPS) $(CMOS)
$(PROGRAMS_UPX) \
$(NULL)
+.PHONY: distclean
+distclean: clean
+ $(MAKE) -C dist/ clean
+ rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
+ rm -f buildTimeConf.ml
+ rm -f matita.glade.bak matita.gladep.bak
+ rm -f matita.conf.xml.sample
+ rm -rf .matita
+
TEST_DIRS = \
library \
tests \
cleantests: $(foreach d,$(TEST_DIRS),$(d)-cleantests)
cleantests.opt: $(foreach d,$(TEST_DIRS),$(d)-cleantests-opt)
-%-test: matitac matitadep matitaclean coq.moo
+%-test: matitac matitadep matitaclean
-cd $* && make -k clean all
-%-test-opt: matitac.opt matitadep.opt matitaclean.opt coq.moo.opt
+%-test-opt: matitac.opt matitadep.opt matitaclean.opt
-cd $* && make -k clean.opt opt
%-cleantests: matitaclean
-cd $* && make clean
# {{{ Distribution stuff
-ifeq ($(wildcard matitac.opt),matitac.opt)
+ifeq ($(HAVE_OCAMLOPT),yes)
BEST=opt
+BEST_EXT=.opt
else
BEST=all
+BEST_EXT=
endif
-stdlib:
- MATITA_RT_BASE_DIR=`pwd` \
- MATITA_FLAGS="-system -conffile `pwd`/matita.conf.xml.build" \
- ./matitamake -init build_stdlib
+ifeq ($(DISTRIBUTED),yes)
+
+dist_library: dist_library@library
+dist_library_clean:
+ @echo "MATITACLEAN -system all"
+ $(H)./matitaclean$(BEST_EXT) \
+ -system -conffile `pwd`/matita.conf.xml.build all
+dist_library@%:
+ @echo "MATITAMAKE -system init"
+ $(H)MATITA_RT_BASE_DIR=`pwd` \
+ MATITA_FLAGS="-system -conffile `pwd`/matita.conf.xml.build" \
+ ./matitamake$(BEST_EXT) -conffile `pwd`/matita.conf.xml.build \
+ init $* `pwd`/$*
+ @echo "MATITAMAKE -system build"
+ $(H)MATITA_RT_BASE_DIR=`pwd` \
+ MATITA_FLAGS="-system -conffile `pwd`/matita.conf.xml.build" \
+ ./matitamake$(BEST_EXT) -conffile `pwd`/matita.conf.xml.build \
+ build $*
+ touch $@
-# MATITA_RT_BASE_DIR=`pwd` \
- $(MAKE) MATITA_FLAGS="-system -conffile `pwd`/matita.conf.xml.build" -C library/ $(BEST)
+endif
-DEST = @RT_BASE_DIR@
+DESTDIR = $(RT_BASE_DIR)
INSTALL_STUFF = \
icons/ \
matita.gtkrc \
matita.ma.templ \
core_notation.moo \
matita.conf.xml \
+ matita.conf.xml.user \
closed.xml \
gtkmathview.matita.conf.xml \
template_makefile.in \
- library/ \
- $(PROGRAMS_BYTE) \
+ AUTHORS \
+ LICENSE \
$(NULL)
ifeq ($(HAVE_OCAMLOPT),yes)
INSTALL_STUFF += $(PROGRAMS_OPT)
+else
+INSTALL_STUFF += $(PROGRAMS_BYTE)
endif
install:
- install -d $(DEST)
- cp -a .matita/
- cp -a $(INSTALL_STUFF) $(DEST)
+ # install main dir and executables
+ install -d $(DESTDIR)
+ cp -a $(INSTALL_STUFF) $(DESTDIR)
+ # install the library and corresponding scripts
+ if [ -d $(DESTDIR)/library ]; then rm -rf $(DESTDIR)/library; fi
+ cp -a .matita/xml/matita/ $(DESTDIR)/library/
+ if [ -d $(DESTDIR)/ma ]; then rm -rf $(DESTDIR)/ma; fi
+ install -d $(DESTDIR)/ma
+ifeq ($(HAVE_OCAMLOPT),yes)
+ for p in $(PROGRAMS_BYTE); do ln -s $$p.opt $(DESTDIR)/$$p; done
+endif
+ cp -a library/ $(DESTDIR)/ma/stdlib/
+ cp -a contribs/ $(DESTDIR)/ma/contribs/
uninstall:
+ rm -rf $(DESTDIR)
STATIC_LINK = dist/static_link/static_link
# for matita
PROGRAMS_UPX = $(patsubst %,%.upx,$(PROGRAMS_STATIC))
ifeq ($(HAVE_OCAMLOPT),yes)
-static: $(STATIC_LINK) $(PROGRAMS_STATIC) coq.moo.opt
+static: $(STATIC_LINK) $(PROGRAMS_STATIC)
else
upx:
@echo "Native code compilation is disabled"
cicbrowser.opt.static.upx: matita.opt.static.upx
@test -f $@ || ln -s $< $@
-.PHONY: distclean
-distclean: clean
- $(MAKE) -C dist/ clean
- rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli
- rm -f buildTimeConf.ml
- rm -f matita.glade.bak matita.gladep.bak
- rm -f matita.conf.xml.sample
-
%.upx: %
cp $< $@
strip $@
tags: TAGS
.PHONY: TAGS
TAGS:
- cd ..; otags -vi -r ocaml/ matita/
+ cd ..; otags -vi -r components/ matita/
#.depend: matitaGeneratedGui.ml matitaGeneratedGui.mli *.ml *.mli