]> matita.cs.unibo.it Git - helm.git/commitdiff
- factorization of the recursive rule
authorStefano Zacchiroli <zack@upsilon.cc>
Tue, 7 Feb 2006 10:52:35 +0000 (10:52 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Tue, 7 Feb 2006 10:52:35 +0000 (10:52 +0000)
- added "library" target to build the stdlib when distributed
- implemented "distcheck" target

helm/software/Makefile

index 5ffb3574affefb6ee61818c9e5b8211c342c64be..9be238e0ca8ed15e339d36fb49f2547b1dd0af05 100644 (file)
@@ -3,23 +3,26 @@ include Makefile.defs
 
 SUBDIRS = components matita
 
-all: $(foreach d,$(SUBDIRS),all.$(d))
-opt: $(foreach d,$(SUBDIRS),opt.$(d))
-clean: $(foreach d,$(SUBDIRS),clean.$(d))
-distclean: $(foreach d,$(SUBDIRS),distclean.$(d))
+all: $(foreach d,$(SUBDIRS),rec@all@$(d))
+opt: $(foreach d,$(SUBDIRS),rec@opt@$(d))
+world: $(foreach d,$(SUBDIRS),rec@world@$(d))
+clean: $(foreach d,$(SUBDIRS),rec@clean@$(d))
+distclean: $(foreach d,$(SUBDIRS),rec@distclean@$(d))
+       rm -rf .matita library-stamp
+install: $(foreach d,$(SUBDIRS),rec@install@$(d))
+uninstall: $(foreach d,$(SUBDIRS),rec@uninstall@$(d))
 
-all.%:
-       $(MAKE) -C $* all
-opt.%:
-       $(MAKE) -C $* opt
-clean.%:
-       $(MAKE) -C $* clean
-distclean.%:
-       $(MAKE) -C $* distclean
-install.%:
-       $(MAKE) -C $* install
-uninstall.%:
-       $(MAKE) -C $* uninstall
+rec@%:
+       $(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*))
+
+# {{{ Distribution stuff
+
+ifeq ($(DISTRIBUTED),yes)
+library: library-stamp
+library-stamp:
+       $(MAKE) -C matita/ dist_library_clean dist_library
+       touch $@
+endif
 
 BASENAME = matita
 NULL =
@@ -37,9 +40,9 @@ EXTRA_DIST =                  \
        Makefile.defs.in        \
        $(NULL)
 
-dist: dist_mktmpdir dist_export dist_mktarball dist_rmtmpdir
 distcheck: dist dist_extract dist_build
 
+dist: dist_mktmpdir dist_export dist_mktarball dist_rmtmpdir
 dist/configure.ac: configure.ac matita/dist/configure.ac.sed
        sed -f matita/dist/configure.ac.sed < $< > $@
 dist/configure: dist/configure.ac
@@ -57,10 +60,22 @@ dist_export: dist/configure
        ln -fs matita.conf.xml.user $(DISTDIR)/matita/matita.conf.xml
        cp $< $(DISTDIR)/configure
        cp -r $(EXTRA_DIST) $(DISTDIR)
-
 dist_mktarball:
        tar czf $(DISTDIR).tar.gz $(DISTDIR)
+       rm -rf $(DISTDIR)
+
+dist_extract:
+       tar xzf $(DISTDIR).tar.gz
+dist_build:
+       (cd $(DISTDIR)/ \
+         && ./configure \
+         && $(MAKE) world \
+         && $(MAKE) library)
 
 .PHONY: dist dist_export dist_mktarball distcheck dist_extract dist_build dist_autotools
+
+# }}} End of distribution stuff
+
 .PHONY: all opt clean distclean
 
+# vim: set foldmethod=marker: