]> matita.cs.unibo.it Git - helm.git/blob - matita/Makefile
Update online helper entries
[helm.git] / matita / 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=$(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         matita/TPTP/            \
58         matita/contribs/        \
59         components/binaries/matitaprover/benchmarks/ \
60         matita/library/         \
61         matita/nlibrary/        \
62         matita/scripts/ \
63         matita/tests/   \
64         matita/lib/lambdaN/     \
65         matita/lib/lambda/      \
66         $(NULL)
67 EXTRA_DIST =                    \
68         matita/AUTHORS          \
69         matita/LICENSE          \
70         matita/dist/BUGS        \
71         matita/dist/ChangeLog   \
72         matita/dist/COPYING     \
73         Makefile                \
74         Makefile.defs.in        \
75         $(NULL)
76 EXTRA_DIST_matita =                     \
77         matita/matitaGeneratedGui.ml    \
78         $(NULL)
79
80 distcheck: dist dist_extract dist_test
81
82 dist: dist_mktmpdir dist_pre dist_export dist_mktarball dist_rmtmpdir
83 dist/configure.ac: configure.ac matita/dist/configure.ac.sed
84         sed -f matita/dist/configure.ac.sed < $< > $@
85 dist/configure: dist/configure.ac
86         cd dist && autoconf
87 dist_mktmpdir:
88         test -d dist || mkdir dist
89 dist_rmtmpdir:
90         test -d dist && rm -rf dist/ || true
91 dist_pre:
92         $(MAKE) -C matita dist_pre
93 dist_export: dist/configure
94         rm -rf $(DISTDIR)
95         mkdir $(DISTDIR)
96         git archive matita-lablgtk3 components | tar -x -C $(DISTDIR)
97         git archive matita-lablgtk3 matita | tar -x -C $(DISTDIR)
98         (cd $(DISTDIR) && find . -name .depend -exec rm \{\} \;)
99         (cd $(DISTDIR) && find . -name .depend.opt -exec rm \{\} \;)
100         (cd $(DISTDIR) && rm -rf $(CLEAN_ON_DIST))
101         cp $< $(DISTDIR)/configure
102         cp dist/configure.ac $(DISTDIR)/configure.ac 
103         cp -r $(EXTRA_DIST) $(DISTDIR)
104         cp -r $(EXTRA_DIST_matita) $(DISTDIR)/matita
105         # distribute HTML version of the manual
106         mkdir -p $(DISTDIR)/docs/manual/
107         $(MAKE) -C matita/help/C/ install DESTDIR=$(CURDIR)/$(DISTDIR)/docs/manual/
108 dist_mktarball:
109         tar czf $(DISTDIR).tar.gz $(DISTDIR)
110         #tar cjf $(DISTDIR).tar.bz2 $(DISTDIR)
111         rm -rf $(DISTDIR)
112
113 dist_extract:
114         tar xzf $(DISTDIR).tar.gz
115 dist_test:
116         (cd $(DISTDIR)/ \
117           && ./configure \
118           && $(MAKE) world \
119           && $(MAKE) install DESTDIR=`pwd`/install)
120
121 .PHONY: dist dist_export dist_mktarball distcheck dist_extract dist_test dist_autotools
122
123 # }}} End of distribution stuff
124
125 .PHONY: all opt clean distclean
126
127 # vim: set foldmethod=marker: