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