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