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