OSDN Git Service

Add distprep target to take some of the job of the release_prep script.
[pg-rex/syncrep.git] / GNUmakefile.in
1 #
2 # PostgreSQL top level makefile
3 #
4 # $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.9 2000/07/19 16:29:41 petere Exp $
5 #
6
7 subdir =
8 top_builddir = .
9 include 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 clean distprep:
22         $(MAKE) -C doc $@
23         $(MAKE) -C src $@
24
25 # Important: distclean `doc' before `src', otherwise Makefile.global
26 # will be gone too soon.
27 distclean maintainer-clean:
28         -$(MAKE) -C doc $@
29         -$(MAKE) -C src $@
30         -rm -f config.cache config.log config.status GNUmakefile
31
32
33 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
34         CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
35
36
37 # These dependencies are risky because both the target and the sources
38 # are in CVS and CVS doesn't preserve timestamps, thus leading to
39 # unnecessary reruns of these rules.
40
41 AUTOCONF = autoconf
42
43 # Only use this rule if you actually said `make configure'.
44 ifeq ($(MAKECMDGOALS),configure)
45 $(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4
46         cd $(top_srcdir) && $(AUTOCONF)
47 endif
48
49 # This one we can leave unprotected because by default nothing depends
50 # on aclocal.m4. This rule is only invoked if you say `make
51 # aclocal.m4' or `make configure'.
52 $(top_srcdir)/aclocal.m4: $(wildcard $(top_srcdir)/config/*.m4)
53         cat $^ > $@
54
55
56 ##########################################################################
57
58 distdir := postgresql-$(VERSION)
59 dummy   := =install=
60 garbage := =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
61
62
63 dist: $(distdir).tar.gz
64 ifeq ($(split-dist), yes)
65 dist: $(distdir).base.tar.gz $(distdir).docs.tar.gz $(distdir).support.tar.gz $(distdir).test.tar.gz
66 endif
67 dist:
68         -rm -rf $(distdir)
69
70 $(distdir).tar: distdir
71         $(TAR) chf $@ $(distdir)
72
73 $(distdir).base.tar: distdir
74         $(TAR) -c $(addprefix --exclude $(distdir)/, doc src/test src/interfaces src/bin) \
75           -f $@ $(distdir)
76
77 $(distdir).docs.tar: distdir
78         $(TAR) cf $@ $(distdir)/doc
79
80 $(distdir).support.tar: distdir
81         $(TAR) cf $@ $(distdir)/src/interfaces $(distdir)/src/bin
82
83 $(distdir).test.tar: distdir
84         $(TAR) cf $@ $(distdir)/src/test
85
86 %.gz: %
87         gzip -f --best $<
88         @text="$@ is ready for distribution." ; \
89          frame=`echo "$$text" | sed -e 's/./=/g'` ; \
90          echo "$$frame" ; echo "$$text" ; echo "$$frame"
91
92 distdir: distprep
93         -rm -rf $(distdir)* $(install)
94         for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
95           file=`expr $$x : '\./\(.*\)'`; \
96           if test -d "$(top_srcdir)/$$file" ; then \
97             mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
98           else \
99             ln "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
100           fi || exit; \
101         done
102         $(MAKE) -C $(distdir) distclean
103
104 distcheck: dist
105         -rm -rf $(dummy)
106         mkdir $(dummy)
107         gunzip -c $(distdir).tar.gz | $(TAR) xf -
108         install_prefix=`cd $(dummy) && pwd`; \
109         cd $(distdir) \
110         && ./configure --prefix="$$install_prefix"
111         $(MAKE) -C $(distdir) -q distprep
112         $(MAKE) -C $(distdir)
113         $(MAKE) -C $(distdir) install
114         $(MAKE) -C $(distdir) uninstall
115         @echo "checking whether \`$(MAKE) uninstall' works"
116         test `find $(dummy) -not -type d | wc -l` -eq 0
117         $(MAKE) -C $(distdir) dist
118 # Room for improvement: Check here whether this distribution tarball
119 # is sufficiently similar to the original one.
120         -rm -rf $(distdir) $(dummy)
121         @echo "Distribution integrity checks out."
122
123 .PHONY: dist distdir distcheck