GNUmakefile.in 3.7 KB
Newer Older
1 2 3
#
# PostgreSQL top level makefile
#
4
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.45 2006/08/18 19:58:05 adunstan 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 16 17
	@echo "All of PostgreSQL successfully made. Ready to install."

install:
18 19 20
	$(MAKE) -C doc $@
	$(MAKE) -C src $@
	$(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 29 30 31 32 33
distprep:
	$(MAKE) -C doc $@
	$(MAKE) -C src $@
	$(MAKE) -C config $@
	$(MAKE) -C contrib $@

34 35 36 37 38 39
# clean, distclean, etc should apply to contrib too, even though
# it's not built by default
clean:
	$(MAKE) -C doc $@
	$(MAKE) -C contrib $@
	$(MAKE) -C src $@
40
	$(MAKE) -C config $@
41 42
# Garbage from autoconf:
	@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 53
# Garbage from autoconf:
	@rm -rf autom4te.cache/
54

55 56
check: all

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 67 68 69
##########################################################################

distdir	:= postgresql-$(VERSION)
dummy	:= =install=
garbage := =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*

P
 
PostgreSQL Daemon 已提交
70
dist: $(distdir).tar.gz 
71
ifeq ($(split-dist), yes)
P
 
PostgreSQL Daemon 已提交
72
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz 
73 74 75 76 77 78 79
endif
dist:
	-rm -rf $(distdir)

$(distdir).tar: distdir
	$(TAR) chf $@ $(distdir)

80
opt_files := \
81
	src/tools src/tutorial \
82
	$(addprefix src/pl/, plperl plpython tcl)
83

B
Bruce Momjian 已提交
84
docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail
85 86 87

postgresql-base-$(VERSION).tar: distdir
	$(TAR) -c $(addprefix --exclude $(distdir)/, $(docs_files) $(opt_files) src/test) \
88 89
	  -f $@ $(distdir)

90 91
postgresql-docs-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
92

93 94
postgresql-opt-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
95

96
postgresql-test-$(VERSION).tar: distdir
97 98
	$(TAR) cf $@ $(distdir)/src/test

99 100
distdir:
	-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 104 105
	  if test -d "$(top_srcdir)/$$file" ; then \
	    mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file";	\
	  else \
106 107
	    ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
	      || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
108 109
	  fi || exit; \
	done
110
	$(MAKE) -C $(distdir) distprep
111 112 113 114
	$(MAKE) -C $(distdir)/doc/src/sgml/ HISTORY INSTALL regress_README
	cp $(distdir)/doc/src/sgml/HISTORY $(distdir)/
	cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/
	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 120
	-rm -rf $(dummy)
	mkdir $(dummy)
121
	$(GZIP) -d -c $< | $(TAR) xf -
122 123 124 125 126 127 128 129
	install_prefix=`cd $(dummy) && pwd`; \
	cd $(distdir) \
	&& ./configure --prefix="$$install_prefix"
	$(MAKE) -C $(distdir) -q distprep
	$(MAKE) -C $(distdir)
	$(MAKE) -C $(distdir) install
	$(MAKE) -C $(distdir) uninstall
	@echo "checking whether \`$(MAKE) uninstall' works"
130
	test `find $(dummy) ! -type d | wc -l` -eq 0
131 132 133 134 135 136 137
	$(MAKE) -C $(distdir) dist
# Room for improvement: Check here whether this distribution tarball
# is sufficiently similar to the original one.
	-rm -rf $(distdir) $(dummy)
	@echo "Distribution integrity checks out."

.PHONY: dist distdir distcheck
138
unexport split-dist