OSDN Git Service

Catch all errors in for and while loops in makefiles. Don't ignore any
[pg-rex/syncrep.git] / GNUmakefile.in
1 #
2 # PostgreSQL top level makefile
3 #
4 # $PostgreSQL: pgsql/GNUmakefile.in,v 1.47 2008/03/18 16:24:50 petere Exp $
5 #
6
7 subdir =
8 top_builddir = .
9 include $(top_builddir)/src/Makefile.global
10
11 all:
12         $(MAKE) -C doc all
13         $(MAKE) -C src all
14         $(MAKE) -C config all
15         @echo "All of PostgreSQL successfully made. Ready to install."
16
17 install:
18         $(MAKE) -C doc $@
19         $(MAKE) -C src $@
20         $(MAKE) -C config $@
21         @echo "PostgreSQL installation complete."
22
23 installdirs uninstall:
24         $(MAKE) -C doc $@
25         $(MAKE) -C src $@
26         $(MAKE) -C config $@
27
28 distprep:
29         $(MAKE) -C doc $@
30         $(MAKE) -C src $@
31         $(MAKE) -C config $@
32         $(MAKE) -C contrib $@
33
34 # clean, distclean, etc should apply to contrib too, even though
35 # it's not built by default
36 clean:
37         $(MAKE) -C doc $@
38         $(MAKE) -C contrib $@
39         $(MAKE) -C src $@
40         $(MAKE) -C config $@
41 # Garbage from autoconf:
42         @rm -rf autom4te.cache/
43
44 # Important: distclean `src' last, otherwise Makefile.global
45 # will be gone too soon.
46 distclean maintainer-clean:
47         $(MAKE) -C doc $@
48         $(MAKE) -C contrib $@
49         $(MAKE) -C config $@
50         $(MAKE) -C src $@
51         rm -f config.cache config.log config.status GNUmakefile
52 # Garbage from autoconf:
53         @rm -rf autom4te.cache/
54
55 check: all
56
57 check installcheck installcheck-parallel:
58         $(MAKE) -C src/test $@
59
60 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
61         ./config.status $@
62
63
64 ##########################################################################
65
66 distdir = postgresql-$(VERSION)
67 dummy   = =install=
68 garbage = =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
69
70 dist: $(distdir).tar.gz 
71 ifeq ($(split-dist), yes)
72 dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz 
73 endif
74 dist:
75         rm -rf $(distdir)
76
77 $(distdir).tar: distdir
78         $(TAR) chf $@ $(distdir)
79
80 opt_files = \
81         src/tools src/tutorial \
82         $(addprefix src/pl/, plperl plpython tcl)
83
84 docs_files = doc/postgres.tar.gz doc/src doc/TODO.detail
85
86 postgresql-base-$(VERSION).tar: distdir
87         $(TAR) -c $(addprefix --exclude $(distdir)/, $(docs_files) $(opt_files) src/test) \
88           -f $@ $(distdir)
89
90 postgresql-docs-$(VERSION).tar: distdir
91         $(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
92
93 postgresql-opt-$(VERSION).tar: distdir
94         $(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
95
96 postgresql-test-$(VERSION).tar: distdir
97         $(TAR) cf $@ $(distdir)/src/test
98
99 distdir:
100         rm -rf $(distdir)* $(dummy)
101         for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
102           file=`expr X$$x : 'X\./\(.*\)'`; \
103           if test -d "$(top_srcdir)/$$file" ; then \
104             mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
105           else \
106             ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
107               || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
108           fi || exit; \
109         done
110         $(MAKE) -C $(distdir) distprep
111         $(MAKE) -C $(distdir)/doc/src/sgml/ HISTORY INSTALL regress_README
112         cp $(distdir)/doc/src/sgml/HISTORY $(distdir)/
113         cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/
114         cp $(distdir)/doc/src/sgml/regress_README $(distdir)/src/test/regress/README
115         $(MAKE) -C $(distdir) distclean
116         rm -f $(distdir)/README.CVS
117
118 distcheck: $(distdir).tar.gz
119         rm -rf $(dummy)
120         mkdir $(dummy)
121         $(GZIP) -d -c $< | $(TAR) xf -
122         install_prefix=`cd $(dummy) && pwd`; \
123         cd $(distdir) \
124         && ./configure --prefix="$$install_prefix"
125         $(MAKE) -C $(distdir) -q distprep
126         $(MAKE) -C $(distdir)
127         $(MAKE) -C $(distdir) install
128         $(MAKE) -C $(distdir) uninstall
129         @echo "checking whether \`$(MAKE) uninstall' works"
130         test `find $(dummy) ! -type d | wc -l` -eq 0
131         $(MAKE) -C $(distdir) dist
132 # Room for improvement: Check here whether this distribution tarball
133 # is sufficiently similar to the original one.
134         rm -rf $(distdir) $(dummy)
135         @echo "Distribution integrity checks out."
136
137 .PHONY: dist distdir distcheck
138 unexport split-dist