OSDN Git Service

Rearrange distribution split as discussed on -hackers.
[pg-rex/syncrep.git] / GNUmakefile.in
1 #
2 # PostgreSQL top level makefile
3 #
4 # $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.18 2001/04/08 17:28:10 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         @echo "All of PostgreSQL successfully made. Ready to install."
15
16 install:
17         $(MAKE) -C doc install
18         $(MAKE) -C src install
19         @cat $(srcdir)/register.txt
20
21 installdirs uninstall distprep:
22         $(MAKE) -C doc $@
23         $(MAKE) -C src $@
24
25 install-all-headers:
26         $(MAKE) -C src $@
27
28 # clean, distclean, etc should apply to contrib too, even though
29 # it's not built by default
30 clean:
31         $(MAKE) -C doc $@
32         $(MAKE) -C contrib $@
33         $(MAKE) -C src $@
34
35 # Important: distclean `src' last, otherwise Makefile.global
36 # will be gone too soon.
37 distclean maintainer-clean:
38         -$(MAKE) -C doc $@
39         -$(MAKE) -C contrib $@
40         -$(MAKE) -C src $@
41         -rm -f config.cache config.log config.status GNUmakefile
42
43 check: all
44
45 check installcheck:
46         $(MAKE) -C src/test $@
47
48 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
49         CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
50
51
52 ##########################################################################
53
54 distdir := postgresql-$(VERSION)
55 dummy   := =install=
56 garbage := =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
57
58 GZIP    := gzip
59 BZIP2   := bzip2
60
61 dist: $(distdir).tar.gz
62 ifeq ($(split-dist), yes)
63 dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz
64 endif
65 dist:
66         -rm -rf $(distdir)
67
68 $(distdir).tar: distdir
69         $(TAR) chf $@ $(distdir)
70
71 opt_files := src/backend/utils/mb contrib/retep build.xml \
72         src/tools src/corba src/data src/tutorial \
73         $(addprefix src/bin/, pgaccess pgtclsh pg_encoding) \
74         $(addprefix src/interfaces/, odbc libpq++ libpgtcl perl5 python jdbc) \
75         $(addprefix src/pl/, plperl tcl)
76
77 docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail doc/internals.ps
78
79 postgresql-base-$(VERSION).tar: distdir
80         $(TAR) -c $(addprefix --exclude $(distdir)/, $(docs_files) $(opt_files) src/test) \
81           -f $@ $(distdir)
82
83 postgresql-docs-$(VERSION).tar: distdir
84         $(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
85
86 postgresql-opt-$(VERSION).tar: distdir
87         $(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
88
89 postgresql-test-$(VERSION).tar: distdir
90         $(TAR) cf $@ $(distdir)/src/test
91
92 %.gz: %
93         $(GZIP) -f --best $<
94
95 %.bz2: %
96         $(BZIP2) -f $<
97
98 distdir:
99         -rm -rf $(distdir)* $(dummy)
100         for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
101           file=`expr X$$x : 'X\./\(.*\)'`; \
102           if test -d "$(top_srcdir)/$$file" ; then \
103             mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
104           else \
105             ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
106               || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
107           fi || exit; \
108         done
109         $(MAKE) -C $(distdir) distprep
110         $(MAKE) -C $(distdir) distclean
111
112 distcheck: $(distdir).tar.gz
113         -rm -rf $(dummy)
114         mkdir $(dummy)
115         gzip -d -c $< | $(TAR) xf -
116         install_prefix=`cd $(dummy) && pwd`; \
117         cd $(distdir) \
118         && ./configure --prefix="$$install_prefix"
119         $(MAKE) -C $(distdir) -q distprep
120         $(MAKE) -C $(distdir)
121         $(MAKE) -C $(distdir) install
122         $(MAKE) -C $(distdir) uninstall
123         @echo "checking whether \`$(MAKE) uninstall' works"
124         test `find $(dummy) ! -type d | wc -l` -eq 0
125         $(MAKE) -C $(distdir) dist
126 # Room for improvement: Check here whether this distribution tarball
127 # is sufficiently similar to the original one.
128         -rm -rf $(distdir) $(dummy)
129         @echo "Distribution integrity checks out."
130
131 .PHONY: dist distdir distcheck
132 unexport split-dist