forked from greenplum-db/gpdb-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
602 lines (514 loc) · 20.9 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
#---------------------------------------------------------------------
# Makefile for Greenplum Database
#---------------------------------------------------------------------
# keep the default target above any targets from included makefiles
all : devel
#---------------------------------------------------------------------
# Declare the targets
#---------------------------------------------------------------------
# Targets for building GPDB with various options
# (development builds)
.PHONY : devel
# (release builds)
.PHONY : dist dist_prof
# Targets recognized by the PostgreSQL makefile (GNUmakefile)
.PHONY : all install installdirs uninstall distprep
.PHONY : clean distclean maintainer-clean
# The pvk target builds a subset of the GPDB package that includes just the
# tools used to verify the configuration of a set of GPDB servers.
.PHONY : pvk
# Targets for running autoconf and autoheader
.PHONY : autoconf
# Internal functions which are invoked by other rules within this makefile
.PHONY : mgmtcopy copylibs
.PHONY : RECONFIG HOMEDEP GPROOTDEP GPROOTDEP GPROOTFAIL
.PHONY : clients
#---------------------------------------------------------------------
# Make 3rd-party libraries and tools
#---------------------------------------------------------------------
# tell included makefiles where to find build-top-level resources
BLD_TOP:=$(shell sh -c pwd)
include Makefile.global
include Makefile.thirdparty
ifneq "$(BLD_BITS)" ""
export NO_M64=1
endif
#$(warning )
#$(warning PATH=$(PATH))
#$(warning LD_LIBRARY_PATH=$(LD_LIBRARY_PATH))
#$(warning )
#$(warning BLD_ARCH=$(BLD_ARCH))
#$(warning BLD_BITS=$(BLD_BITS))
#$(warning BLD_CFLAGS=$(BLD_CFLAGS))
#$(warning )
BLD_CXX_LIB_DIR=$($(BLD_ARCH)_CXX_LIB_DIR)
#---------------------------------------------------------------------
# Directory paths and file names
#---------------------------------------------------------------------
GPPGDIR=$(shell cd .. && pwd)
GPMGMT=../gpMgmt
BUILDDIR=$(GPPGDIR)
RELEASE=devel
GPDIR=greenplum-db-$(RELEASE)
PLRDIR=greenplum-plr-$(RELEASE)
CLIENTSDIR=greenplum-clients-$(RELEASE)
DISTPATH=$(GPROOT)/$(GPDIR)
CLIENTSDISTPATH=$(GPROOT)/$(CLIENTSDIR)
ifeq "$(DEVPATH)" ""
BLD_HOME=$(HOME)
DEVPATH=$(BLD_HOME)/$(GPDIR)
CLIENTSDEVPATH=$(BLD_HOME)/$(CLIENTSDIR)
else
# DEVPATH has been passed in as by the build scripts
GPROOT_DEV=$(dir $(DEVPATH))
CLIENTSDEVPATH=$(GPROOT_DEV)$(CLIENTSDIR)
endif
# files generated by 'configure'
ISCONFIG=$(GPPGDIR)/GNUmakefile
##
## On these platforms, we do the full build including the server. On other
## platforms, we do a client-only build.
##
SERVER_PLATFORMS=rhel7_x86_64 rhel6_x86_64 rhel8_x86_64 linux_x86_64
#---------------------------------------------------------------------
# Compiler options
#---------------------------------------------------------------------
OPTFLAGS="$(strip $(BLD_CFLAGS) -O3 -fargument-noalias-global -fno-omit-frame-pointer -g)"
PROFFLAGS="$(strip $(BLD_CFLAGS) -O3 -fargument-noalias-global -fno-omit-frame-pointer -g)"
ifeq (on, ${GPDBGOPT})
CFLAGS_OPT=-O1 -fno-omit-frame-pointer
else
CFLAGS_OPT=-O0
endif
ifeq (on, ${GPDBGCOV})
DEBUG_CFLAGS_OPT=
else
DEBUG_CFLAGS_OPT=-g3
endif
DEBUGFLAGS="$(strip $(BLD_CFLAGS) $(CFLAGS_OPT) $(DEBUG_CFLAGS_OPT))"
#---------------------------------------------------------------------
# configure
#---------------------------------------------------------------------
DEFPORT=5432
ORCA_CONFIG=--enable-orca
rhel6_x86_64_CONFIGFLAGS=--with-quicklz --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy ${ORCA_CONFIG} --enable-gpcloud --with-libxml --with-openssl --with-pam --with-ldap
rhel7_x86_64_CONFIGFLAGS=--with-quicklz --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy ${ORCA_CONFIG} --enable-gpcloud --with-libxml --with-openssl --with-pam --with-ldap
rhel8_x86_64_CONFIGFLAGS=--with-quicklz --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy ${ORCA_CONFIG} --enable-gpcloud --with-libxml --with-openssl --with-pam --with-ldap
ubuntu18.04_x86_64_CONFIGFLAGS=--with-quicklz --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy ${ORCA_CONFIG} --enable-gpcloud --with-libxml --with-openssl --with-pam --with-ldap
sles12_x86_64_CONFIGFLAGS=--with-quicklz --with-gssapi --enable-mapreduce --enable-orafce --enable-ic-proxy ${ORCA_CONFIG} --enable-gpcloud --with-libxml --with-openssl --with-pam --with-ldap
BLD_CONFIGFLAGS=$($(BLD_ARCH)_CONFIGFLAGS)
CONFIGFLAGS=$(strip $(BLD_CONFIGFLAGS) --with-pgport=$(DEFPORT) $(BLD_DEPLOYMENT_SETTING))
ifdef CONFIGURE_FLAGS
CONFIGFLAGS+= $(CONFIGURE_FLAGS)
endif
ifneq (false, ${PG_LANG})
CONFIGFLAGS+= --with-perl --with-python PYTHON=python3
ifdef TCL_CFG
CONFIGFLAGS+= --with-tcl-config=${TCL_CFG}
endif
endif
# Configure in thirdparty libraries from the ext/ directory
CONFIG_INCLUDES=$(BLD_THIRDPARTY_INCLUDE_DIR) $(BLD_THIRDPARTY_INCLUDE_DIR)/libxml2
CONFIG_LIBRARIES=$(strip $(BLD_THIRDPARTY_LIB_DIR) $(BLD_CXX_LIB_DIR) $(BLD_PTHREADS_LIB_DIR))
CONFIGFLAGS+= --with-includes="$(CONFIG_INCLUDES)" --with-libraries="$(CONFIG_LIBRARIES)"
CONFIGFLAGS+= --disable-rpath
CONFIGFLAGS+= LDFLAGS='-Wl,--enable-new-dtags -Wl,-rpath,\$$$$ORIGIN/../lib'
RECONFIG :
rm -f Debug/GNUmakefile
rm -f Release/GNUmakefile
rm -f $(GPPGDIR)/GNUmakefile
$(GPPGDIR)/GNUmakefile : $(GPPGDIR)/configure env.sh
rm -rf $(INSTLOC)
mkdir -p $(GPPGDIR)
echo "Running ./configure with CONFIGFLAGS=$(CONFIGFLAGS)\n"
cd $(GPPGDIR) && \
CFLAGS=$(INSTCFLAGS) \
./configure $(CONFIGFLAGS) \
--prefix=$(INSTLOC) \
--mandir=$(INSTLOC)/man
Debug/GNUmakefile : $(GPPGDIR)/configure env.sh
rm -rf $(INSTLOC)
mkdir -p Debug
echo "Running ./configure with CONFIGFLAGS=$(CONFIGFLAGS)\n"
cd Debug && \
CFLAGS=$(INSTCFLAGS) \
./configure $(CONFIGFLAGS) \
--prefix=$(INSTLOC) \
--mandir=$(INSTLOC)/man
Release/GNUmakefile : $(GPPGDIR)/configure env.sh
rm -rf $(INSTLOC)
mkdir -p Release
echo "Running ./configure with CONFIGFLAGS=$(CONFIGFLAGS)\n"
cd Release && \
CFLAGS=$(INSTCFLAGS) \
./configure $(CONFIGFLAGS) \
--prefix=$(INSTLOC) \
--mandir=$(INSTLOC)/man
#---------------------------------------------------------------------
# autoconf
#---------------------------------------------------------------------
# Whenever there is a change to the configure.in file, autoconf and
# autoheader should be run to regenerate the files configure and
# src/include/pg_config.h.in. Note that autoconf and autoheader
# don't update the timestamps of their output files unless there is an
# actual change in the contents; thus 'make' rules don't work well for
# rebuilding those files automatically. Developers should rebuild them
# manually when needed, which can be done by invoking 'make autoconf'.
autoconf : RECONFIG
cd $(GPPGDIR) && autoconf && autoheader
#---------------------------------------------------------------------
# standardized build rules
#---------------------------------------------------------------------
BLD_LD_LIBRARY_PATH:=$($(BLD_ARCH)_LD_LIBRARY_PATH):$($(BLD_WHERE_THE_LIBRARY_THINGS_ARE))
export $(BLD_WHERE_THE_LIBRARY_THINGS_ARE)=$(BLD_LD_LIBRARY_PATH)
perl_archlibexp:=$(shell perl -MConfig -e 'print $$Config{archlibexp}')
# set default build steps
define BUILD_STEPS
@$(MAKE) -C $(BUILDDIR)/src/backend generated-headers
cd $(BUILDDIR) && PYGRESQL_LDFLAGS='-Wl,-rpath,\$$$$ORIGIN/../../../lib -Wl,--enable-new-dtags' QUICKLZ_LDFLAGS='-Wl,-rpath,\$$$$ORIGIN/../../lib -Wl,--enable-new-dtags' $(MAKE) $(PARALLEL_MAKE_OPTS) install
cd $(BUILDDIR)/src/pl/plpython && $(MAKE) clean && echo 'LDFLAGS += -Wl,-rpath,\$$$$ORIGIN/../../ext/python/lib/ -Wl,--enable-new-dtags' >> Makefile && $(MAKE) $(PARALLEL_MAKE_OPTS) install && cd $(BUILDDIR)
cd $(BUILDDIR)/src/pl/plperl && $(MAKE) clean && echo "LDFLAGS += -Wl,-rpath,$(perl_archlibexp)/CORE -Wl,--enable-new-dtags" >> GNUmakefile && echo "LDFLAGS_SL += -Wl,-rpath,$(perl_archlibexp)/CORE -Wl,--enable-new-dtags" >> GNUmakefile && $(MAKE) $(PARALLEL_MAKE_OPTS) install && cd $(BUILDDIR)
#@$(MAKE) greenplum_path INSTLOC=$(INSTLOC)
#@$(MAKE) mgmtcopy INSTLOC=$(INSTLOC)
@$(MAKE) copylibs INSTLOC=$(INSTLOC)
@$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTSINSTLOC=$(CLIENTSINSTLOC)
@$(MAKE) set_scripts_version INSTLOC=$(CLIENTSINSTLOC)
@$(MAKE) copylicense INSTLOC=$(INSTLOC) \
CLIENTSINSTLOC=$(CLIENTSINSTLOC)
endef
ifeq "$(BLD_GPDB_BUILDSET)" "partial"
define BUILD_STEPS
rm -rf $(INSTLOC)
cd $(BUILDDIR)/gpMgmt/ && $(MAKE) generate_greenplum_path_file
cd $(BUILDDIR)/src/backend/ && $(MAKE) ../../src/include/parser/gram.h
cd $(BUILDDIR)/src/backend/ && $(MAKE) ../../src/include/utils/errcodes.h
cd $(BUILDDIR)/src/backend/ && $(MAKE) ../../src/include/utils/fmgroids.h
cd $(BUILDDIR)/src/port/ && $(MAKE) install
cd $(BUILDDIR)/src/bin/scripts/ && $(MAKE) install
cd $(BUILDDIR)/src/bin/psql/ && $(MAKE) install
cd $(BUILDDIR)/src/bin/pg_config/ && $(MAKE) install
cd $(BUILDDIR)/src/bin/pg_dump/ && $(MAKE) pg_dump
cp -p $(BUILDDIR)/src/bin/pg_dump/pg_dump $(INSTLOC)/bin/
cd $(BUILDDIR)/src/bin/pg_dump/ && $(MAKE) pg_dumpall
cp -p $(BUILDDIR)/src/bin/pg_dump/pg_dumpall $(INSTLOC)/bin/
cd $(BUILDDIR)/src/bin/pg_dump/ && $(MAKE) pg_restore
cp -p $(BUILDDIR)/src/bin/pg_dump/pg_restore $(INSTLOC)/bin/
cd $(BUILDDIR)/src/interfaces/ecpg/ && $(MAKE) install
cd $(BUILDDIR)/src/include/ && $(MAKE) install
cd $(BUILDDIR)/src/interfaces/libpq/ && $(MAKE) install
cd $(BUILDDIR)/src/bin/gpfdist && $(MAKE) install
cp -p $(GPMGMT)/bin/gpload $(INSTLOC)/bin/gpload
cp -p $(GPMGMT)/bin/gpload.py $(INSTLOC)/bin/gpload.py
$(MAKE) copylibs INSTLOC=$(INSTLOC)
cd $(GPMGMT)/bin && $(MAKE) pygresql INSTLOC=$(INSTLOC)
$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTSINSTLOC=$(CLIENTSINSTLOC)
endef
endif
#---------------------------------------------------------------------
# environment for later builds inside the source tree
#
# run this to create an environment-loading script, source it,
# and be able to build inside the source tree with the same
# results as building from here at the top
#---------------------------------------------------------------------
env.sh:
echo "export BLD_ARCH=$(BLD_ARCH)" > env.sh
echo "export NO_M64=$(NO_M64)" >> env.sh
echo "export PATH=$(PATH)" >> env.sh
echo "export $(BLD_WHERE_THE_LIBRARY_THINGS_ARE)=$($(BLD_WHERE_THE_LIBRARY_THINGS_ARE))" >> env.sh
ifneq "$(PERL_DIR)" ""
echo "export PERL5LIB=$(PERL_DIR)/lib/site_perl/5.12.4/x86_64-linux:$(PERL_DIR)/lib/site_perl/5.12.4:$(PERL_DIR)/lib/5.12.4/x86_64-linux:$(PERL_DIR)/lib/5.12.4" >> env.sh
endif
#---------------------------------------------------------------------
# Development builds
#---------------------------------------------------------------------
devel : INSTCFLAGS=$(DEBUGFLAGS)
devel : INSTLOC=$(DEVPATH)
devel : CLIENTSINSTLOC=$(CLIENTSDEVPATH)
devel : CONFIGFLAGS+= --enable-cassert --enable-debug --enable-depend
ifdef ENABLE_VPATH_BUILD
devel : BUILDDIR=Debug
devel : ISCONFIG=$(BUILDDIR)/GNUmakefile
devel : HOMEDEP Debug/GNUmakefile
else
devel : HOMEDEP $(ISCONFIG)
endif
$(BUILD_STEPS)
#---------------------------------------------------------------------
# Release builds
#---------------------------------------------------------------------
dist : INSTCFLAGS=$(OPTFLAGS)
dist : INSTLOC=$(DISTPATH)
dist : CLIENTSINSTLOC=$(CLIENTSDISTPATH)
ifdef ENABLE_VPATH_BUILD
dist : BUILDDIR=Release
dist : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist : GPROOTDEP RECONFIG Release/GNUmakefile
else
dist : GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
dist_prof : INSTCFLAGS=$(PROFFLAGS)
dist_prof : INSTLOC=$(DISTPATH)
dist_prof : CLIENTSINSTLOC=$(CLIENTSDISTPATH)
ifdef ENABLE_VPATH_BUILD
dist_prof : BUILDDIR=Release
dist_prof : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist_prof : GPROOTDEP RECONFIG $(ISCONFIG)
else
dist_prof : ISCONFIG=../GNUmakefile
dist_prof : GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
dist_faultinj : CLIENTSINSTLOC=$(CLIENTSDISTPATH)
ifdef ENABLE_VPATH_BUILD
dist_faultinj : BUILDDIR=Release
dist_faultinj : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist_faultinj : GPROOTDEP RECONFIG Release/GNUmakefile
else
dist_faultinj : ISCONFIG=../GNUmakefile
dist_faultinj : GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
#---------------------------------------------------------------------
# clientTools
#---------------------------------------------------------------------
#
# The clients target builds GPDB [f]or a subset of files needed for client
# platforms. It also builds clientTools-specific items like the ODBC drivers.
#
ifneq "$(GPROOT)" ""
CLIENTS_HOME_DIR=$(GPROOT)
else
CLIENTS_HOME_DIR=$(BLD_HOME)
endif
CLIENTSINSTLOC=$(CLIENTS_HOME_DIR)/greenplum-clients
CLIENTSINSTLOC_BIN=$(CLIENTSINSTLOC)/bin
CLIENTSINSTLOC_BINEXT=$(CLIENTSINSTLOC)/bin/ext/
CLIENTSINSTLOC_EXT=$(CLIENTSINSTLOC)/ext
CLIENTSINSTLOC_LIB=$(CLIENTSINSTLOC)/lib
CLIENTSINSTLOC_LIB_PWARE=$(CLIENTSINSTLOC)/lib/pware
CLIENTSINSTLOC_DOCS=$(CLIENTSINSTLOC)/docs
CLIENTSINSTLOC_OPENSOURCE=$(CLIENTSINSTLOC)/thirdparty
DOC_TYPE=Unix
SCRIPT=.sh
define tmpCLIENTS_FILESET_BIN
gpfdist
gpload
gpload.py
pg_dump
pg_dumpall
psql
createdb
dropdb
createuser
dropuser
endef
CLIENTS_FILESET_BIN = $(strip $(tmpCLIENTS_FILESET_BIN))
# pg.py, pgdb.py, _pg.so are from pygresql which does not install into a single module
define tmpCLIENTS_FILESET_BINEXT
pg.py
pgdb.py
_pg*.so
yaml
endef
CLIENTS_FILESET_BINEXT = $(strip $(tmpCLIENTS_FILESET_BINEXT))
BLD_PYTHON_FILESET=.
BLD_OS:=$(shell uname -s)
Darwin_CLIENTS_LIBS=libcrypto.*.dylib libssl.*.dylib libpq.*.dylib* libkrb5.*.dylib libcom_err.*.dylib libldap_r-*.dylib libk5crypto.*.dylib libkrb5support.*.dylib liblber-*.dylib libyaml*.dylib
Linux_CLIENTS_LIBS=libpq.so*
define tmpCLIENTS_FILESET_LIB
$($(BLD_OS)_CLIENTS_LIBS)
endef
CLIENTS_FILESET_LIB = $(strip $(tmpCLIENTS_FILESET_LIB))
ifeq "$(MPP_ARCH)" ""
rhel6_x86_64_MPP_ARCH=RHEL6-x86_64
rhel7_x86_64_MPP_ARCH=RHEL7-x86_64
rhel8_x86_64_MPP_ARCH=RHEL8-x86_64
ifneq "$($(BLD_ARCH)_MPP_ARCH)" ""
export MPP_ARCH=$($(BLD_ARCH)_MPP_ARCH)
else
export MPP_ARCH=$(BLD_ARCH)
endif
endif
ifeq "$(INSTLOC)" ""
INSTLOC=$(GPDIR)
endif
VERSION:=$(shell [ -f ../VERSION ] && perl -pe 's, ,-,g' ../VERSION)
VERSION_SHORT:=$(shell [ -f ../VERSION ] && perl -pe 's, .*,,g' ../VERSION)
clients :
if [ ! -z "$(CLIENTSINSTLOC)" ] && [ "$(CLIENTSINSTLOC)" != "/" ]; then rm -rf $(CLIENTSINSTLOC); fi
ifeq "$(findstring clients,$(BLD_TARGETS))" ""
# ---- build and packaging of the clients package is currently disabled;
# ---- set BLD_TARGETS="clients" to enable them.
else
# ---- copy GPDB fileset ----
mkdir -p $(CLIENTSINSTLOC_BIN)
(cd $(INSTLOC)/bin/ && $(TAR) cf - $(CLIENTS_FILESET_BIN)) | (cd $(CLIENTSINSTLOC_BIN)/ && $(TAR) xpf -)$(check_pipe_for_errors)
mkdir -p $(CLIENTSINSTLOC_BINEXT)
(cd $(GPMGMT)/bin/ext/ && $(TAR) cf - $(CLIENTS_FILESET_BINEXT)) | (cd $(CLIENTSINSTLOC_BINEXT)/ && $(TAR) xpf -)$(check_pipe_for_errors)
ifneq "$(PYTHONHOME)" ""
mkdir -p $(CLIENTSINSTLOC_EXT)/python
(cd $(PYTHONHOME) && $(TAR) cf - $(BLD_PYTHON_FILESET)) | (cd $(CLIENTSINSTLOC_EXT)/python/ && $(TAR) xpf -)$(check_pipe_for_errors)
endif
mkdir -p $(CLIENTSINSTLOC_LIB)
ifneq "$(CLIENTS_FILESET_LIB)" ""
(cd $(INSTLOC)/lib/ && $(TAR) cf - $(CLIENTS_FILESET_LIB)) | (cd $(CLIENTSINSTLOC_LIB)/ && $(TAR) xpf -)$(check_pipe_for_errors)
endif
# ---- copy scripts fileset ----
mkdir -p $(CLIENTSINSTLOC)
cp -f client/scripts/greenplum_$@_path$(SCRIPT) $(CLIENTSINSTLOC)/
# ---- updating the version in required packages ----
@$(MAKE) set_scripts_version INSTLOC=$(CLIENTSINSTLOC)
endif
#---------------------------------------------------------------------
# Platform Verification Kit (PVK)
# formerly checkTools
#
# The pvk target builds a subset of the GPDB package that includes
# just the tools used to verify the configuration of a set of GPDB servers.
#---------------------------------------------------------------------
PVK_SCRIPTS = \
bin/gpscp \
bin/gpssh \
bin/gpcheckperf \
$(NULL)
PVK_FILESET = \
$(CHECKTOOLS_SCRIPTS) \
bin/lib/gplib.py \
bin/lib/pxssh.py \
bin/lib/pexpect.py \
bin/lib/multidd \
bin/lib/stream \
$(NULL)
pvk : INSTCFLAGS=$(OPTFLAGS)
pvk : INSTLOC=$(DISTPATH)
pvk : version GPROOTDEP
cd $(GPMGMT)/bin && $(MAKE) stream
mkdir -p $(INSTLOC)/bin/lib
@for file in $(PVK_FILESET); do \
echo "cp -p $(GPMGMT)/$${file} $(INSTLOC)/$${file}"; \
cp -p $(GPMGMT)/$${file} $(INSTLOC)/$${file}; \
done
perl putversion $(foreach script,$(PVK_SCRIPTS),$(INSTLOC)/$(script))
#---------------------------------------------------------------------
# Set Version
#---------------------------------------------------------------------
SET_VERSION_SCRIPTS = \
bin/gpactivatestandby \
bin/gpaddmirrors \
bin/gpcheckperf \
bin/gpdeletesystem \
bin/gpexpand \
bin/gpfilespace \
bin/gpinitstandby \
bin/gpinitsystem \
bin/gpload.py \
bin/gplogfilter \
bin/gpmovemirrors \
bin/gprecoverseg \
bin/gpreload \
bin/gpscp \
bin/gpssh \
bin/gpssh-exkeys \
bin/gpstart \
bin/gpstate \
bin/gpstop \
bin/lib/gpcheckcat \
sbin/gpconfig_helper.py \
sbin/gpcleansegmentdir.py \
sbin/gpgetstatususingtransition.py \
sbin/gpsegstart.py \
sbin/gpsegstop.py \
sbin/gpupgrademirror.py \
lib/python/gppylib/programs/clsAddMirrors.py \
lib/python/gppylib/programs/clsHostCacheLookup.py \
lib/python/gppylib/programs/clsRecoverSegment.py \
lib/python/gppylib/programs/clsSystemState.py \
lib/python/gppylib/programs/gppkg.py \
lib/python/gppylib/programs/kill.py \
lib/python/gppylib/mainUtils.py \
$(NULL)
set_scripts_version :
@for file in $(SET_VERSION_SCRIPTS); do \
if [ -f $(INSTLOC)/$${file} ]; then \
perl $(BLD_TOP)/../putversion $(INSTLOC)/$${file} ; \
fi ; \
done
#---------------------------------------------------------------------
# Internal functions
#---------------------------------------------------------------------
mgmtcopy :
#Copy the management utilities
mkdir -p $(INSTLOC)/bin
mkdir -p $(INSTLOC)/lib
mkdir -p $(INSTLOC)/lib/python
mkdir -p $(INSTLOC)/sbin
#Setup /lib/python contents
cp -rp $(GPMGMT)/bin/gppylib $(INSTLOC)/lib/python
cp -rp $(GPMGMT)/bin/ext/* $(INSTLOC)/lib/python
cp -rp $(GPMGMT)/bin $(INSTLOC)
cp -rp $(GPMGMT)/sbin/* $(INSTLOC)/sbin/.
if [ ! -d ${INSTLOC}/docs ] ; then mkdir ${INSTLOC}/docs ; fi
if [ -d $(GPMGMT)/doc ]; then cp -rp $(GPMGMT)/doc $(INSTLOC)/docs/cli_help; fi
if [ -d $(GPMGMT)/demo/gpfdist_transform ]; then \
mkdir -p $(INSTLOC)/demo; \
$(TAR) -C $(GPMGMT)/demo -czf $(INSTLOC)/demo/gpfdist_transform.tar.gz gpfdist_transform; \
fi
$(MAKE) set_scripts_version INSTLOC=$(INSTLOC)
# Remove unwanted files.
rm -rf $(INSTLOC)/bin/ext
rm -rf $(INSTLOC)/bin/pythonSrc
rm -rf $(INSTLOC)/bin/Makefile
rm -rf $(INSTLOC)/bin/src
rm -rf $(INSTLOC)/bin/gppylib
find $(INSTLOC)/lib/python/gppylib -name test -type d | xargs rm -rf
libcopy=(cd $(1) && $(TAR) cf - $(2)) | (cd $(3) && $(TAR) xvf -)$(check_pipe_for_errors)
copylibs : thirdparty-dist
mkdir -p $(INSTLOC)/etc
mkdir -p $(INSTLOC)/include
copylicense:
for proddir in $(INSTLOC) $(CLIENTSINSTLOC); do \
if [ -d $${proddir} ]; then \
echo cp -v ${BLD_TOP}/LICENSE $${proddir}; \
echo cp -v ${BLD_TOP}/NOTICE $${proddir}; \
fi; \
done
HOMEDEP :
@ #If the HOME variable isn't set, then execute the usage() path
@if [ x"$(HOME)" = x ]; then $(MAKE) HOMEFAIL; fi
GPROOTDEP :
@ #If the GPROOT variable isn't set, then execute the usage() path
@if [ x"$(GPROOT)" = x ]; then $(MAKE) GPROOTFAIL; fi
GPROOTFAIL :
@echo
@echo " The GPROOT path variable is not set."
@echo
@echo " You must decide where you will install to, and set GPROOT to that location, prior to"
@echo " installing the GP module with this Makefile."
@echo
@exit 1
HOMEFAIL :
@echo
@echo " The HOME environment variable is not set. Please set it to continue."
@echo
@exit 1
#---------------------------------------------------------------------
# Cleanup
#---------------------------------------------------------------------
clean :
# @if [ ! -f $(ISCONFIG) ]; then echo "GPDB root not configured, no need to clean it"; fi
@if [ -d Debug -a -f Debug/GNUmakefile ]; then cd Debug; $(MAKE) clean; fi
@if [ -d Release -a -f Release/GNUmakefile ]; then cd Release; $(MAKE) clean; fi
@if [ -d $(GPPGDIR) -a -f $(GPPGDIR)/GNUmakefile ]; then cd $(GPPGDIR); $(MAKE) clean; fi
@if [ -d $(GPMGMT)/bin ]; then cd $(GPMGMT)/bin; $(MAKE) clean; fi
distclean :
# @if [ ! -f $(ISCONFIG) ]; then echo "GPDB root not configured, no need to clean it"; fi
@if [ -d Debug -a -f Debug/GNUmakefile ]; then cd Debug; $(MAKE) distclean; fi
@if [ -d Release -a -f Release/GNUmakefile ]; then cd Release; $(MAKE) distclean; fi
@if [ -d $(GPPGDIR) -a -f $(GPPGDIR)/GNUmakefile ]; then cd $(GPPGDIR); $(MAKE) distclean; fi
@if [ -d $(GPMGMT)/bin ]; then cd $(GPMGMT)/bin; $(MAKE) distclean; fi
@rm -f VERSION
@rm -f env.sh
distprep : $(ISCONFIG)
@cd $(BUILDDIR) && $(MAKE) distprep