]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/Makefile
hand-like cursor when the cursor is on an href in a clickable math view
[helm.git] / matita / Makefile
index 78e8fe8d574abc27b5fb33bd5e516f2acc78809d..272711ad763b563605d418167e331d0dabbd083f 100644 (file)
@@ -53,13 +53,17 @@ MAINCMOS =                  \
        matitadep.cmo           \
        matitaclean.cmo         \
        matitamake.cmo          \
+       gragrep.cmo             \
        $(NULL)
-PROGRAMS_BYTE = matita matitac cicbrowser matitadep matitaclean matitamake dump_moo
+PROGRAMS_BYTE = \
+       matita matitac cicbrowser matitadep matitaclean matitamake
 PROGRAMS = $(PROGRAMS_BYTE) matitatop
 PROGRAMS_OPT = $(patsubst %,%.opt,$(PROGRAMS_BYTE))
+NOINST_PROGRAMS = dump_moo gragrep
+NOINST_PROGRAMS_OPT = $(patsubst %,%.opt,$(EXTRA_PROGRAMS))
 
 .PHONY: all
-all: $(PROGRAMS)
+all: $(PROGRAMS) $(NOINST_PROGRAMS)
 #  all: matita.conf.xml $(PROGRAMS) coq.moo
 
 #  matita.conf.xml: matita.conf.xml.sample
@@ -87,7 +91,7 @@ LIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d
 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))
-opt: $(PROGRAMS_OPT)
+opt: $(PROGRAMS_OPT) $(NOINST_PROGRAMS_OPT)
 upx: $(PROGRAMS_UPX)
 .PHONY: opt upx
 
@@ -137,6 +141,11 @@ matitamake: matitac
 matitamake.opt: matitac.opt
        @test -f $@ || ln -s $< $@
        
+gragrep: matitac
+       @test -f $@ || ln -s $< $@
+gragrep.opt: matitac.opt
+       @test -f $@ || ln -s $< $@
+       
 cicbrowser: matita
        @test -f $@ || ln -s $< $@
 cicbrowser.opt: matita.opt
@@ -149,8 +158,8 @@ matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade
 .PHONY: clean
 clean:
        rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \
-               $(PROGRAMS) \
-               $(PROGRAMS_OPT) \
+               $(PROGRAMS) $(PROGRAMS_OPT) \
+               $(NOINST_PROGRAMS) $(NOINST_PROGRAMS_OPT) \
                $(PROGRAMS_STATIC) \
                $(PROGRAMS_UPX) \
                $(NULL)
@@ -178,9 +187,9 @@ tests.opt: $(foreach d,$(TEST_DIRS),$(d)-test-opt)
 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
@@ -209,17 +218,17 @@ dist_library@%:
        $(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 dist_$* `pwd`/$*
+                       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 dist_$*
+                       build $*
        touch $@
 
 endif
 
-DEST = @RT_BASE_DIR@
+DESTDIR = $(RT_BASE_DIR)
 INSTALL_STUFF =                        \
        icons/                          \
        matita.gtkrc                    \
@@ -227,21 +236,35 @@ INSTALL_STUFF =                   \
        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