GNUmakefile.in 6.7 KB
Newer Older
1 2 3
#
# PostgreSQL top level makefile
#
4
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.46 2007/02/09 15:55:57 petere Exp $
5 6
#

7
subdir =
8
top_builddir = .
9
include $(top_builddir)/src/Makefile.global
10

11

12
all:
13
#	$(MAKE) -C doc all
14
	$(MAKE) -C src all
15
	$(MAKE) -C config all
16
	$(MAKE) -C contrib/xlogdump all
17 18 19 20 21 22 23 24 25 26
	$(MAKE) -C contrib/changetrackingdump all
	$(MAKE) -C contrib/formatter all
	$(MAKE) -C contrib/formatter_fixedwidth all
	$(MAKE) -C contrib/fuzzystrmatch all
	$(MAKE) -C contrib/extprotocol all	
	$(MAKE) -C contrib/gp_sparse_vector all
	$(MAKE) -C contrib/gp_distribution_policy all
	$(MAKE) -C contrib/gp_internal_tools all
	$(MAKE) -C contrib/gp_cancel_query all
	$(MAKE) -C contrib/indexscan all
27 28
	$(MAKE) -C contrib/pg_upgrade_support all
	$(MAKE) -C contrib/pg_upgrade all
29
	$(MAKE) -C gpAux/extensions mapreduce
30
	@echo "All of Greenplum Database successfully made. Ready to install."
31 32

install:
33
#	$(MAKE) -C doc $@
34 35
	$(MAKE) -C src $@
	$(MAKE) -C config $@
36
	$(MAKE) -C contrib/xlogdump $@
37 38 39 40 41 42 43 44 45 46
	$(MAKE) -C contrib/changetrackingdump $@
	$(MAKE) -C contrib/formatter $@
	$(MAKE) -C contrib/formatter_fixedwidth $@
	$(MAKE) -C contrib/fuzzystrmatch $@
	$(MAKE) -C contrib/extprotocol $@
	$(MAKE) -C contrib/gp_sparse_vector $@
	$(MAKE) -C contrib/gp_distribution_policy $@
	$(MAKE) -C contrib/gp_internal_tools $@
	$(MAKE) -C contrib/gp_cancel_query $@
	$(MAKE) -C contrib/indexscan $@ 
47 48
	$(MAKE) -C contrib/pg_upgrade_support $@
	$(MAKE) -C contrib/pg_upgrade $@
49
	$(MAKE) -C gpMgmt $@
50
	$(MAKE) -C gpAux/extensions $@
51 52

	@echo "Greenplum Database installation complete."
53

54
installdirs uninstall:
55
#	$(MAKE) -C doc $@
56
	$(MAKE) -C src $@
57
	$(MAKE) -C config $@
58
	$(MAKE) -C contrib/xlogdump $@
59 60 61 62 63 64 65 66 67 68
	$(MAKE) -C contrib/changetrackingdump $@
	$(MAKE) -C contrib/formatter $@
	$(MAKE) -C contrib/formatter_fixedwidth $@
	$(MAKE) -C contrib/fuzzystrmatch $@
	$(MAKE) -C contrib/extprotocol $@
	$(MAKE) -C contrib/gp_sparse_vector $@
	$(MAKE) -C contrib/gp_distribution_policy $@
	$(MAKE) -C contrib/gp_internal_tools $@
	$(MAKE) -C contrib/gp_cancel_query $@
	$(MAKE) -C contrib/indexscan $@ 
69 70
	$(MAKE) -C contrib/pg_upgrade_support $@
	$(MAKE) -C contrib/pg_upgrade $@
71

72
distprep:
73
#	$(MAKE) -C doc $@
74 75 76 77
	$(MAKE) -C src $@
	$(MAKE) -C config $@
	$(MAKE) -C contrib $@

78 79 80
# clean, distclean, etc should apply to contrib too, even though
# it's not built by default
clean:
81
#	$(MAKE) -C doc $@
82 83
	$(MAKE) -C contrib $@
	$(MAKE) -C src $@
84
	$(MAKE) -C config $@
85
	$(MAKE) -C contrib/xlogdump $@
86 87 88 89 90 91 92 93 94 95
	$(MAKE) -C contrib/changetrackingdump $@
	$(MAKE) -C contrib/formatter $@
	$(MAKE) -C contrib/formatter_fixedwidth $@
	$(MAKE) -C contrib/fuzzystrmatch $@
	$(MAKE) -C contrib/extprotocol $@
	$(MAKE) -C contrib/gp_sparse_vector $@
	$(MAKE) -C contrib/gp_distribution_policy $@
	$(MAKE) -C contrib/gp_internal_tools $@
	$(MAKE) -C contrib/gp_cancel_query $@
	$(MAKE) -C contrib/indexscan $@
96 97
	$(MAKE) -C contrib/pg_upgrade_support $@
	$(MAKE) -C contrib/pg_upgrade $@
98
	$(MAKE) -C gpAux/extensions $@
99
	$(MAKE) -C gpMgmt $@
100 101
# Garbage from autoconf:
	@rm -rf autom4te.cache/
102 103

# Important: distclean `src' last, otherwise Makefile.global
104
# will be gone too soon.
105
distclean maintainer-clean:
106
#	-$(MAKE) -C doc $@
107
	-$(MAKE) -C gpAux/extensions $@
108
	-$(MAKE) -C contrib $@
109
	-$(MAKE) -C config $@
110
	-$(MAKE) -C src $@
111
	-rm -f config.cache config.log config.status GNUmakefile
112 113
# Garbage from autoconf:
	@rm -rf autom4te.cache/
114

115 116 117 118 119 120 121 122 123
# This is a top-level target that runs "all" regression test suites against
# a running server. This is what the CI pipeline runs.
installcheck-world:
	$(MAKE) -C src/test installcheck-good
	$(MAKE) -C src/test installcheck-bugbuster
	$(MAKE) -C src/test/isolation installcheck
	$(MAKE) -C src/pl installcheck
	#$(MAKE) -C src/interfaces/ecpg installcheck
	#$(MAKE) -C contrib installcheck
124
	$(MAKE) -C contrib/extprotocol installcheck
125 126 127 128 129 130 131 132 133 134 135 136
	$(MAKE) -C gpAux/extensions installcheck
	$(MAKE) -C src/bin/gpfdist installcheck


# Run mock tests, that don't require a running server. Arguably these should
# be part of [install]check-world, but we treat them more like part of
# compilation than regression testing, in the CI. But they are too heavy-weight
# to put into "make all", either.
.PHONY : unittest-check
unittest-check:
	$(MAKE) -C src/backend unittest-check
	$(MAKE) -C src/bin unittest-check
137

138

139
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
140
	./config.status $@
141 142


143 144
##########################################################################

145 146 147
distdir	= postgresql-$(VERSION)
dummy	= =install=
garbage = =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
148

149
dist: $(distdir).tar.gz $(distdir).tar.bz2
150
ifeq ($(split-dist), yes)
P
 
PostgreSQL Daemon 已提交
151
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz 
152 153 154 155 156 157 158
endif
dist:
	-rm -rf $(distdir)

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

159 160
.INTERMEDIATE: $(distdir).tar

161
opt_files = \
162
	src/tools src/tutorial \
163
	$(addprefix src/pl/, plperl plpython tcl)
164

165
docs_files =
166 167 168

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

171 172
postgresql-docs-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(docs_files))
173

174 175
postgresql-opt-$(VERSION).tar: distdir
	$(TAR) cf $@ $(addprefix $(distdir)/, $(opt_files))
176

177
postgresql-test-$(VERSION).tar: distdir
178 179
	$(TAR) cf $@ $(distdir)/src/test

180 181
distdir:
	-rm -rf $(distdir)* $(dummy)
182
	for x in `cd $(top_srcdir) && find . \( -name CVS -prune \) -o \( -name .git -prune \) -o -print`; do \
183
	  file=`expr X$$x : 'X\./\(.*\)'`; \
184 185 186
	  if test -d "$(top_srcdir)/$$file" ; then \
	    mkdir "$(distdir)/$$file" && chmod 777 "$(distdir)/$$file";	\
	  else \
187 188
	    ln "$(top_srcdir)/$$file" "$(distdir)/$$file" >/dev/null 2>&1 \
	      || cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
189 190
	  fi || exit; \
	done
191
	$(MAKE) -C $(distdir) distprep
192 193 194 195
	#$(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
196
	$(MAKE) -C $(distdir) distclean
197
	#rm -f $(distdir)/README.git
198

199
distcheck: dist
200 201
	-rm -rf $(dummy)
	mkdir $(dummy)
202
	$(GZIP) -d -c $(distdir).tar.gz | $(TAR) xf -
203 204 205 206 207 208 209 210
	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"
211
	test `find $(dummy) ! -type d | wc -l` -eq 0
212 213 214 215 216 217 218
	$(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
219
unexport split-dist