]> granicus.if.org Git - postgresql/blob - GNUmakefile.in
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
[postgresql] / GNUmakefile.in
1 #
2 # PostgreSQL top level makefile
3 #
4 # $PostgreSQL: pgsql/GNUmakefile.in,v 1.41 2004/10/06 08:49:58 momjian 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 distprep:
24         $(MAKE) -C doc $@
25         $(MAKE) -C src $@
26         $(MAKE) -C config $@
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         $(MAKE) -C config $@
35 # Garbage from autoconf:
36         @rm -rf autom4te.cache/
37
38 # Important: distclean `src' last, otherwise Makefile.global
39 # will be gone too soon.
40 distclean maintainer-clean:
41         -$(MAKE) -C doc $@
42         -$(MAKE) -C contrib $@
43         -$(MAKE) -C config $@
44         -$(MAKE) -C src $@
45         -rm -f config.cache config.log config.status GNUmakefile
46 # Garbage from autoconf:
47         @rm -rf autom4te.cache/
48
49 check: all
50
51 check installcheck:
52         $(MAKE) -C src/test $@
53
54 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
55         ./config.status $@
56
57
58 ##########################################################################
59
60 distdir := postgresql-$(VERSION)
61 dummy   := =install=
62 garbage := =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
63
64 dist: $(distdir).tar.gz 
65 ifeq ($(split-dist), yes)
66 dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz 
67 endif
68 dist:
69         -rm -rf $(distdir)
70
71 $(distdir).tar: distdir
72         $(TAR) chf $@ $(distdir)
73
74 opt_files := \
75         src/tools src/corba src/tutorial \
76         $(addprefix src/pl/, plperl plpython tcl)
77
78 docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail
79
80 postgresql-base-$(VERSION).tar: distdir
81         $(TAR) -c $(addprefix --exclude $(distdir)/, $(docs_files) $(opt_files) src/test) \
82           -f $@ $(distdir)
83
84 postgresql-docs-$(VERSION).tar: distdir
85         $(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
86
87 postgresql-opt-$(VERSION).tar: distdir
88         $(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
89
90 postgresql-test-$(VERSION).tar: distdir
91         $(TAR) cf $@ $(distdir)/src/test
92
93 distdir:
94         -rm -rf $(distdir)* $(dummy)
95         for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
96           file=`expr X$$x : 'X\./\(.*\)'`; \
97           if test -d "$(top_srcdir)/$$file" ; then \
98             mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file"; \
99           else \
100             ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
101               || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
102           fi || exit; \
103         done
104         $(MAKE) -C $(distdir) distprep
105         $(MAKE) -C $(distdir) distclean
106         rm -f $(distdir)/README.CVS
107
108 distcheck: $(distdir).tar.gz
109         -rm -rf $(dummy)
110         mkdir $(dummy)
111         $(GZIP) -d -c $< | $(TAR) xf -
112         install_prefix=`cd $(dummy) && pwd`; \
113         cd $(distdir) \
114         && ./configure --prefix="$$install_prefix"
115         $(MAKE) -C $(distdir) -q distprep
116         $(MAKE) -C $(distdir)
117         $(MAKE) -C $(distdir) install
118         $(MAKE) -C $(distdir) uninstall
119         @echo "checking whether \`$(MAKE) uninstall' works"
120         test `find $(dummy) ! -type d | wc -l` -eq 0
121         $(MAKE) -C $(distdir) dist
122 # Room for improvement: Check here whether this distribution tarball
123 # is sufficiently similar to the original one.
124         -rm -rf $(distdir) $(dummy)
125         @echo "Distribution integrity checks out."
126
127 .PHONY: dist distdir distcheck
128 unexport split-dist