GNUmakefile.in 3.5 KB
Newer Older
1 2 3
#
# PostgreSQL top level makefile
#
P
 
PostgreSQL Daemon 已提交
4
# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.33 2003/08/05 04:40:29 pgsql 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 15 16
	@echo "All of PostgreSQL successfully made. Ready to install."

install:
17
	$(MAKE) -C doc install
18
	$(MAKE) -C src install
19 20
	@cat $(srcdir)/register.txt

21
installdirs uninstall distprep:
22
	$(MAKE) -C doc $@
23 24
	$(MAKE) -C src $@

25 26 27
install-all-headers:
	$(MAKE) -C src $@

28 29 30 31 32 33
# 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 $@
34 35
# Garbage from autoconf:
	@rm -rf autom4te.cache/
36 37

# Important: distclean `src' last, otherwise Makefile.global
38
# will be gone too soon.
39
distclean maintainer-clean:
40
	-$(MAKE) -C doc $@
41
	-$(MAKE) -C contrib $@
42
	-$(MAKE) -C src $@
43
	-rm -f config.cache config.log config.status GNUmakefile
44 45
# Garbage from autoconf:
	@rm -rf autom4te.cache/
46

47 48 49
check: all

check installcheck:
50
	$(MAKE) -C src/test $@
51

52
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
53
	./config.status $@
54 55


56 57 58 59 60 61
##########################################################################

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

P
 
PostgreSQL Daemon 已提交
62
dist: $(distdir).tar.gz $(distdir).tar.bz2
63
ifeq ($(split-dist), yes)
P
 
PostgreSQL Daemon 已提交
64
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz postgresql-base-$(VERSION).tar.bz2 postgresql-docs-$(VERSION).tar.bz2 postgresql-opt-$(VERSION).tar.bz2 postgresql-test-$(VERSION).tar.bz2
65 66 67 68 69 70 71
endif
dist:
	-rm -rf $(distdir)

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

72
opt_files := \
P
 
PostgreSQL Daemon 已提交
73
	src/tools src/corba src/tutorial \
74
	src/bin/pgtclsh \
M
 
Marc G. Fournier 已提交
75
	$(addprefix src/interfaces/, libpgtcl jdbc) \
76
	$(addprefix src/pl/, plperl plpython tcl)
77

B
Bruce Momjian 已提交
78
docs_files := doc/postgres.tar.gz doc/src doc/TODO.detail
79 80 81

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

84 85
postgresql-docs-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
86

87 88
postgresql-opt-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
89

90
postgresql-test-$(VERSION).tar: distdir
91 92
	$(TAR) cf $@ $(distdir)/src/test

93 94
distdir:
	-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 98 99
	  if test -d "$(top_srcdir)/$$file" ; then \
	    mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file";	\
	  else \
100 101
	    ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
	      || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
102 103
	  fi || exit; \
	done
104
	$(MAKE) -C $(distdir) distprep
105 106
	$(MAKE) -C $(distdir) distclean

107
distcheck: $(distdir).tar.gz
108 109
	-rm -rf $(dummy)
	mkdir $(dummy)
110
	$(GZIP) -d -c $< | $(TAR) xf -
111 112 113 114 115 116 117 118
	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"
119
	test `find $(dummy) ! -type d | wc -l` -eq 0
120 121 122 123 124 125 126
	$(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
127
unexport split-dist