]> matita.cs.unibo.it Git - helm.git/blob - Makefile
- factorization of the recursive rule
[helm.git] / Makefile
1
2 include Makefile.defs
3
4 SUBDIRS = components matita
5
6 all: $(foreach d,$(SUBDIRS),rec@all@$(d))
7 opt: $(foreach d,$(SUBDIRS),rec@opt@$(d))
8 world: $(foreach d,$(SUBDIRS),rec@world@$(d))
9 clean: $(foreach d,$(SUBDIRS),rec@clean@$(d))
10 distclean: $(foreach d,$(SUBDIRS),rec@distclean@$(d))
11         rm -rf .matita library-stamp
12 install: $(foreach d,$(SUBDIRS),rec@install@$(d))
13 uninstall: $(foreach d,$(SUBDIRS),rec@uninstall@$(d))
14
15 rec@%:
16         $(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*))
17
18 # {{{ Distribution stuff
19
20 ifeq ($(DISTRIBUTED),yes)
21 library: library-stamp
22 library-stamp:
23         $(MAKE) -C matita/ dist_library_clean dist_library
24         touch $@
25 endif
26
27 BASENAME = matita
28 NULL =
29 DISTDIR = $(BASENAME)-$(MATITA_VERSION)
30 CLEAN_ON_DIST =                 \
31         components/license      \
32         $(NULL)
33 EXTRA_DIST =                    \
34         matita/dist/AUTHORS     \
35         matita/dist/COPYING     \
36         matita/dist/INSTALL     \
37         matita/dist/README      \
38         matita/dist/ChangeLog   \
39         Makefile                \
40         Makefile.defs.in        \
41         $(NULL)
42
43 distcheck: dist dist_extract dist_build
44
45 dist: dist_mktmpdir dist_export dist_mktarball dist_rmtmpdir
46 dist/configure.ac: configure.ac matita/dist/configure.ac.sed
47         sed -f matita/dist/configure.ac.sed < $< > $@
48 dist/configure: dist/configure.ac
49         cd dist && autoconf
50 dist_mktmpdir:
51         test -d dist || mkdir dist
52 dist_rmtmpdir:
53         test -d dist && rm -rf dist/ || true
54 dist_export: dist/configure
55         rm -rf $(DISTDIR)
56         mkdir $(DISTDIR)
57         svn export components $(DISTDIR)/components
58         svn export matita $(DISTDIR)/matita
59         (cd $(DISTDIR) && rm -f $(CLEAN_ON_DIST))
60         ln -fs matita.conf.xml.user $(DISTDIR)/matita/matita.conf.xml
61         cp $< $(DISTDIR)/configure
62         cp -r $(EXTRA_DIST) $(DISTDIR)
63 dist_mktarball:
64         tar czf $(DISTDIR).tar.gz $(DISTDIR)
65         rm -rf $(DISTDIR)
66
67 dist_extract:
68         tar xzf $(DISTDIR).tar.gz
69 dist_build:
70         (cd $(DISTDIR)/ \
71           && ./configure \
72           && $(MAKE) world \
73           && $(MAKE) library)
74
75 .PHONY: dist dist_export dist_mktarball distcheck dist_extract dist_build dist_autotools
76
77 # }}} End of distribution stuff
78
79 .PHONY: all opt clean distclean
80
81 # vim: set foldmethod=marker: