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