OSDN Git Service

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