blob: a1b88b7faba71c9e3280cc9df45009263d42ef72 [file] [log] [blame]
#---------------------------------------------------------------------
# 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 devel_faultinj
# (release builds)
.PHONY : dist dist_prof
# Targets which refresh files via rsync before building
.PHONY : dbg opt both
# Targets recognized by the PostgreSQL makefile (cdb-pg/GNUmakefile)
.PHONY : all install installdirs uninstall distprep
.PHONY : clean distclean maintainer-clean
.PHONY : check installcheck installcheck-parallel
# Targets for running regression tests
.PHONY : installcheck-good installcheck-olaptest
# 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
# Miscellaneous special purpose targets
.PHONY : test2 test3
# Internal functions which are invoked by other rules within this makefile
.PHONY : groupSession mkgpcc plr copydocs mgmtcopy copylibs
.PHONY : greenplum_path RECONFIG HOMEDEP GPROOTDEP GPROOTDEP GPROOTFAIL goh
.PHONY : version gccVersionCheck pygres authlibs clients loaders connectivity gppkg
#---------------------------------------------------------------------
# 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
include releng/releng.mk
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 )
# help gpcheckdb, our only C++ binary, find the right copy of libstdc++
sol10_sparc_32_CXX_LIB_DIR=/usr/sfw/lib
BLD_CXX_LIB_DIR=$($(BLD_ARCH)_CXX_LIB_DIR)
# help Windows builds find the cross-compiler and a pre-built curl
ifeq "$(findstring win,$(BLD_ARCH))" "win"
tmpPATH:=/usr/local/mingw32/bin:/usr/local/mingw32/mingw32/bin:/opt/curl-7.16.1-crosscompile/bin:$(PATH)
export PATH:=$(tmpPATH)
export WINDOWS=true
export ANT_OPTS="-DminGW=true"
export SCRIPT_EXT=bat
export EXE_EXT=.exe
export PY_EXT=.py
endif
#---------------------------------------------------------------------
# Directory paths and file names
#---------------------------------------------------------------------
GPPGDIR=cdb-pg
GPMGMT=gpMgmt
GPCC=gpcc
PLR=$(GPPGDIR)/src/pl/plr
GPPERFMON=gpperfmon
PLATFORM=platform
BUILDDIR=$(GPPGDIR)
RELEASE=$(shell $(CURDIR)/releasetag)
GPDIR=greenplum-db$(RELEASE)
PLRDIR=greenplum-plr$(RELEASE)
CLIENTDIR=greenplum-clients$(RELEASE)
CONNECTIVITYDIR=greenplum-connectivity$(RELEASE)
LOADERSDIR=greenplum-loaders$(RELEASE)
GPDOCDIR=$(CURDIR)/docs/release
DISTPATH=$(GPROOT)/$(GPDIR)
CLIENTDISTPATH=$(GPROOT)/$(CLIENTDIR)
CONNECTIVITYDISTPATH=$(GPROOT)/$(CONNECTIVITYDIR)
LOADERSDISTPATH=$(GPROOT)/$(LOADERSDIR)
GPPERFMONDISTPATH=$(GPROOT)
GPPKGDISTPATH=$(GPROOT)
ifeq "$(DEVPATH)" ""
BLD_HOME=$(HOME)
DEVPATH=$(BLD_HOME)/$(GPDIR)
GPPERFMONDEVPATH=$(BLD_HOME)
GPPKGDEVPATH=$(BLD_HOME)
CLIENTDEVPATH=$(BLD_HOME)/$(CLIENTDIR)
CONNECTIVITYDEVPATH=$(BLD_HOME)/$(CONNECTIVITYDIR)
LOADERSDEVPATH=$(BLD_HOME)/$(LOADERSDIR)
else
# DEVPATH has been passed in as by the build scripts
GPROOT_DEV=$(dir $(DEVPATH))
GPPERFMONDEVPATH=$(GPROOT_DEV)
GPPKGDEVPATH=$(GPROOT_DEV)
CLIENTDEVPATH=$(GPROOT_DEV)$(CLIENTDIR)
CONNECTIVITYDEVPATH=$(GPROOT_DEV)$(CONNECTIVITYDIR)
LOADERSDEVPATH=$(GPROOT_DEV)$(LOADERSDIR)
endif
# files generated by 'configure'
ISCONFIG=cdb-pg/GNUmakefile
#---------------------------------------------------------------------
# GPPKG
#---------------------------------------------------------------------
##
## Support gppkg platforms
##
GPPKG_PLATFORMS=rhel5_x86_64 rhel6_x86_64 suse10_x86_64
#---------------------------------------------------------------------
# Compiler options
#---------------------------------------------------------------------
INLINE_FLAGS=-finline-limit=1800
OPTFLAGS="$(strip -O3 -funroll-loops -fargument-noalias-global -fno-omit-frame-pointer $(COPTX) -g $(INLINE_FLAGS) $(TRACE_GCC_FLAG))"
PROFFLAGS="$(strip -O3 -funroll-loops -fargument-noalias-global -fno-omit-frame-pointer $(COPTX) -g $(INLINE_FLAGS) $(TRACE_GCC_FLAG))"
ifeq (on, ${GPDBGINLINE})
CFLAGS_INLINE=$(INLINE_FLAGS)
else
CFLAGS_INLINE=-fno-inline
endif
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 $(CFLAGS_INLINE) $(CFLAGS_OPT) $(DEBUG_CFLAGS_OPT) $(TRACE_GCC_FLAG))"
#---------------------------------------------------------------------
# configure
#---------------------------------------------------------------------
DEFPORT=5432
rhel5_x86_32_CONFIGFLAGS=--host=i686-pc-linux-gnu --enable-email --enable-snmp --enable-ddboost
rhel5_x86_64_CONFIGFLAGS=--enable-email --enable-snmp --enable-connectemc --enable-ddboost
rhel6_x86_64_CONFIGFLAGS=--enable-email --enable-snmp --enable-connectemc --enable-ddboost
sol10_x86_64_CONFIGFLAGS=--enable-email --enable-snmp
sol_x86_64_CONFIGFLAGS=--enable-email
suse10_x86_64_CONFIGFLAGS=--enable-email --enable-snmp --enable-ddboost
linux_x86_64_CONFIGFLAGS=--enable-email --enable-snmp
osx105_x86_CONFIGFLAGS=--enable-email --enable-snmp
osx106_x86_CONFIGFLAGS=--enable-email --enable-snmp
BLD_CONFIGFLAGS=$($(BLD_ARCH)_CONFIGFLAGS)
CONFIGFLAGS=$(strip $(BLD_CONFIGFLAGS) --with-pgport=$(DEFPORT) --with-libedit-preferred $(TRACE_CFG_FLAG) $(BLD_DEPLOYMENT_SETTING))
# PL/Python does not compile on Tiger, skipping it on AIX
ifneq "$(findstring $(BLD_ARCH),aix5_ppc_64 aix5_ppc_32 osx104_x86)" ""
PG_LANG=false
endif
# Set R_HOME, make sync_tools download the appropriate R
R_HOME=/opt/releng/tools/R-Project/R/2.13.0-1/$(BLD_ARCH)/R-2.13.0/lib64/R
ifneq "$(findstring $(BLD_ARCH),osx106_x86)" ""
R_HOME=/opt/releng/tools/R-Project/R/2.13.0-1/$(BLD_ARCH)/R-2.13.0/lib/R
endif
ifneq (false, ${PG_LANG})
CONFIGFLAGS+= --with-perl --with-python --with-java
ifdef TCL_CFG
CONFIGFLAGS+= --with-tcl-config=${TCL_CFG}
endif
endif
# Configure in the extra path AIX requires for pthread support
aix5_ppc_64_PTHREADS_LIB_DIR=/usr/lib/threads
aix5_ppc_32_PTHREADS_LIB_DIR=/usr/lib/threads
BLD_PTHREADS_LIB_DIR=$($(BLD_ARCH)_PTHREADS_LIB_DIR)
# 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)"
# Configure in "authlibs"...
# ...without an ext/ dir copy of curl-config on Tiger or AIX
ifeq "$(findstring $(BLD_ARCH),aix5_ppc_64 aix5_ppc_32 osx104_x86)" ""
BLD_CURL_CONFIG=CURL_CONFIG=$(BLD_THIRDPARTY_BIN_DIR)/curl-config
endif
# ...and do not include the authlibs on Windows or AIX
ifeq "$(findstring $(BLD_ARCH),aix5_ppc_32 aix5_ppc_64 win32 win64)" ""
CONFIGFLAGS+= --with-openssl --with-pam --with-krb5 --with-gssapi --with-ldap $(BLD_CURL_CONFIG)
endif
# ...but do include some of the authlibs on AIX
ifneq "$(findstring $(BLD_ARCH),aix5_ppc_32 aix5_ppc_64)" ""
CONFIGFLAGS+= --with-openssl --with-pam --without-krb5 --with-gssapi --with-ldap $(BLD_CURL_CONFIG)
endif
# build with libxml2 on these platforms
# note that configure on our suse build servers doesn't understand --with-libraries above
# the same way it does on our rhel build servers so we also set LDFLAGS
rhel5_x86_32_LIBXML2=LIBS="-lxml2"
rhel5_x86_64_LIBXML2=LIBS="-lxml2"
rhel6_x86_64_LIBXML2=LIBS="-lxml2"
sol10_x86_64_LIBXML2=LIBS="-lxml2"
sol10_sparc_64_LIBXML2=LIBS="-lxml2"
suse10_x86_64_LIBXML2=LDFLAGS="-L$(BLD_THIRDPARTY_LIB_DIR)" LIBS="-lxml2"
osx105_x86_LIBXML2=LIBS="-lxml2"
osx106_x86_LIBXML2=LIBS="-lxml2"
LIBXML2FLAGS= $($(BLD_ARCH)_LIBXML2)
#$(warning )
#$(warning LIBXML2FLAGS=$(LIBXML2FLAGS))
#$(warning )
CONFIGFLAGS+= $(LIBXML2FLAGS)
# Platform-specific config flags
aix5_ppc_64_CONFIG_ADDITIONS=LDFLAGS="-Wl,-bbigtoc -L/usr/lib/threads"
aix5_ppc_32_CONFIG_ADDITIONS=LDFLAGS="-L/usr/lib/threads"
win32_CONFIG_ADDITIONS=--build=x86_x64-unknown-linux-gnu --host=i686-pc-mingw32 --without-zlib --enable-debug CC=/usr/local/mingw32/bin/mingw32-gcc LDFLAGS=-L/usr/local/mingw32/mingw32/lib CPP= CPPFLAGS=-I/usr/local/mingw32/mingw32/include
win64_CONFIG_ADDITIONS=--build=x86_x64-unknown-linux-gnu --host=x86_64-pc-mingw64 --without-zlib --enable-debug CC=/usr/local/mingw64/bin/x86_64-w64-mingw32-gcc LDFLAGS=-L/usr/local/mingw64/x86_64-w64-mingw32/lib CPP= CPPFLAGS=-I/usr/local/mingw64/x86_64-w64-mingw32/include
CONFIG_ADDITIONS=$($(BLD_ARCH)_CONFIG_ADDITIONS)
CONFIGFLAGS+= $(CONFIG_ADDITIONS)
RECONFIG :
rm -f Debug/GNUmakefile
rm -f Release/GNUmakefile
rm -f $(GPPGDIR)/GNUmakefile
# avoid AIX's restricted shell
aix5_ppc_64_CONFIG_SHELL=/usr/bin/bash
aix5_ppc_32_CONFIG_SHELL=/usr/bin/bash
BLD_CONFIG_SHELL=$($(BLD_ARCH)_CONFIG_SHELL)
$(GPPGDIR)/GNUmakefile : $(GPPGDIR)/configure env.sh
@if [ ! -d "$(BLD_TOP)/ext" ]; then \
echo "Please do make sync_tools to resolve dependencies"; \
exit 1; \
fi
rm -rf $(INSTLOC)
mkdir -p $(GPPGDIR)
cd $(GPPGDIR) && CC="$(strip $(BLD_CC) $(BLD_CFLAGS))" CFLAGS=$(INSTCFLAGS) $(BLD_CONFIG_SHELL) ../$(GPPGDIR)/configure $(CONFIGFLAGS) --prefix=$(INSTLOC) --with-docdir=$(INSTLOC)/doc --mandir=$(INSTLOC)/man
Debug/GNUmakefile : $(GPPGDIR)/configure env.sh
rm -rf $(INSTLOC)
mkdir -p Debug
cd Debug && CC="$(strip $(BLD_CC) $(BLD_CFLAGS))" CFLAGS=$(INSTCFLAGS) $(BLD_CONFIG_SHELL) ../$(GPPGDIR)/configure $(CONFIGFLAGS) --prefix=$(INSTLOC) --with-docdir=$(INSTLOC)/doc --mandir=$(INSTLOC)/man
Release/GNUmakefile : $(GPPGDIR)/configure env.sh
rm -rf $(INSTLOC)
mkdir -p Release
cd Release && CC="$(strip $(BLD_CC) $(BLD_CFLAGS))" CFLAGS=$(INSTCFLAGS) $(BLD_CONFIG_SHELL) ../$(GPPGDIR)/configure $(CONFIGFLAGS) --prefix=$(INSTLOC) --with-docdir=$(INSTLOC)/doc --mandir=$(INSTLOC)/man
## ======================================================================
## Generate json catalog file
##
## Requirement:
## This tidycat.pl utility has a perl JSON package dependency. You'll
## need to ensure you have this setup in your enviroment to execute
## this process.
##
## Here are the basic steps:
##
## 1) A "configure" must have been run. This is required so
## GP_MAJORVERSION can be retrieved from the
## cdb-pg/src/include/pg_config.h and used to create the
## json file name (eg. 4.2.json).
## 2) (manual) p4 edit gpMgmt/bin/gppylib/data/<version>.json
## 3) make gen_json_cat
## 4) (manual file generation review) p4 diff gpMgmt/bin/gppylib/data/<version>.json
## 5) (manual) p4 submit "Regenerate Json catalog file." gpMgmt/bin/gppylib/data/<version>.json
## ======================================================================
gen_json_cat:
@if [ ! -f $(ISCONFIG) ]; then echo ""; echo "FATAL: The cdb-pg environment has not been configured. Thus we cannot attempt to generate json catalog file."; echo ""; exit 1; fi
@JASON_CAT=gpMgmt/bin/gppylib/data/`grep GP_MAJORVERSION cdb-pg/src/include/pg_config.h | sed 's/.*"\(.*\)"/\1/g' `.json; \
if [ ! -w $$JASON_CAT ]; then echo ""; echo "FATAL: The json cat file is not writable ($$JASON_CAT). Have you performed a p4 edit $$JASON_CAT operation?"; echo ""; exit 1; fi; \
cd $(BLD_TOP)/cdb-pg/src/include/catalog; \
perl tidycat.pl -dd $(BLD_TOP)/$$JASON_CAT -df json *.h; \
if [ $$? != 0 ]; then echo ""; echo "FATAL: json cat file generation failed."; echo ""; exit 1; fi; \
echo "To manually review and submit the updated json cat file, run:"; \
echo " p4 diff $$JASON_CAT"; \
echo " p4 submit -d \"Regenerate Json catalog file. [JIRA: MPP-XXXX]\" $$JASON_CAT"; \
#---------------------------------------------------------------------
# autoconf
#---------------------------------------------------------------------
# Whenever there is a change to the cdb-pg/configure.in file, autoconf and
# autoheader should be run to regenerate the files cdb-pg/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
#---------------------------------------------------------------------
rhel5_x86_32_LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/lib
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)
#$(warning $(BLD_WHERE_THE_LIBRARY_THINGS_ARE)=$($(BLD_WHERE_THE_LIBRARY_THINGS_ARE)))
# how much of GPDB to build by platform (default is "full")
rhel4_x86_64_GPDB_BUILDSET=partial
rhel4_x86_32_GPDB_BUILDSET=partial
aix5_ppc_64_GPDB_BUILDSET=partial
aix5_ppc_32_GPDB_BUILDSET=partial
sol10_x86_32_GPDB_BUILDSET=partial
sol10_sparc_32_GPDB_BUILDSET=partial
sol9_sparc_32_GPDB_BUILDSET=partial
sol9_sparc_64_GPDB_BUILDSET=partial
sol9_sparc_GPDB_BUILDSET=partial
sol8_sparc_64_GPDB_BUILDSET=partial
sol8_sparc_32_GPDB_BUILDSET=partial
sol8_sparc_GPDB_BUILDSET=partial
win64_GPDB_BUILDSET=partial
win32_GPDB_BUILDSET=partial
BLD_GPDB_BUILDSET=$($(BLD_ARCH)_GPDB_BUILDSET)
# set default build steps
define BUILD_STEPS
@rm -rf $(INSTLOC)
cd $(BUILDDIR) && $(MAKE) $(parallelexec_opts) install
@$(MAKE) greenplum_path INSTLOC=$(INSTLOC)
@$(MAKE) goh INSTLOC=$(INSTLOC)
@$(MAKE) groupSession INSTLOC=$(INSTLOC)
@$(MAKE) mkgpcc INSTCFLAGS=$(INSTCFLAGS)
@$(MAKE) plr
@$(MAKE) mgmtcopy INSTLOC=$(INSTLOC)
@$(MAKE) mkpgbench INSTLOC=$(INSTLOC) BUILDDIR=$(BUILDDIR)
# @$(MAKE) mkgpperfmon INSTLOC=$(INSTLOC) BUILDDIR=$(BUILDDIR)
@$(MAKE) mkplatform INSTLOC=$(INSTLOC)
@$(MAKE) copydocs INSTLOC=$(INSTLOC)
@$(MAKE) copylibs INSTLOC=$(INSTLOC)
@$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTINSTLOC=$(CLIENTINSTLOC)
$(MAKE) set_scripts_version INSTLOC=$(CLIENTINSTLOC)
@$(MAKE) connectivity INSTLOC=$(INSTLOC) CONNECTIVITYINSTLOC=$(CONNECTIVITYINSTLOC)
$(MAKE) set_scripts_version INSTLOC=$(CONNECTIVITYINSTLOC)
@$(MAKE) loaders INSTLOC=$(INSTLOC) LOADERSINSTLOC=$(LOADERSINSTLOC)
@$(MAKE) set_scripts_version INSTLOC=$(LOADERSINSTLOC)
@$(MAKE) gppkg INSTLOC=$(INSTLOC) GPPKGINSTLOC=$(GPPKGINSTLOC)
endef
ifeq "$(BLD_GPDB_BUILDSET)" "aix_subset"
define BUILD_STEPS
rm -rf $(INSTLOC)
cd $(BUILDDIR)/src/include/ && $(MAKE) install
$(MAKE) mkgpcc
$(MAKE) mgmtcopy INSTLOC=$(INSTLOC)
$(MAKE) copylibs INSTLOC=$(INSTLOC)
$(MAKE) loaders INSTLOC=$(INSTLOC) LOADERSINSTLOC=$(LOADERSINSTLOC)
@$(MAKE) set_scripts_version INSTLOC=$(LOADERSINSTLOC)
$(MAKE) connectivity INSTLOC=$(INSTLOC) CONNECTIVITYINSTLOC=$(CONNECTIVITYINSTLOC)
@$(MAKE) set_scripts_version INSTLOC=$(CONNECTIVITYINSTLOC)
endef
endif
ifeq "$(BLD_GPDB_BUILDSET)" "partial"
define BUILD_STEPS
rm -f installcheck-good_SKIP
rm -rf $(INSTLOC)
@if [ "$(findstring win,$(BLD_ARCH))" = "win" ]; then \
echo "Modifying timezone Makefile for crosscompile."; \
perl -pi -e 's,./zic,zic,' cdb-pg/src/timezone/Makefile; \
fi
$(MAKE) greenplum_path INSTLOC=$(INSTLOC)
cd $(BUILDDIR)/src/backend/ && $(MAKE) ../../src/include/parser/gram.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$(EXE_EXT) $(INSTLOC)/bin/
cd $(BUILDDIR)/src/bin/pg_dump/ && $(MAKE) pg_dumpall
cp -p $(BUILDDIR)/src/bin/pg_dump/pg_dumpall$(EXE_EXT) $(INSTLOC)/bin/
cd $(BUILDDIR)/src/bin/pg_dump/ && $(MAKE) pg_restore
cp -p $(BUILDDIR)/src/bin/pg_dump/pg_restore$(EXE_EXT) $(INSTLOC)/bin/
cd $(BUILDDIR)/src/interfaces/ecpg/ && $(MAKE) install
cd $(BUILDDIR)/src/include/ && $(MAKE) install
cd $(BUILDDIR)/src/interfaces/libpq/ && $(MAKE) install
if [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
cd $(BUILDDIR)/src/bin/gpmapreduce/ && $(MAKE) install ; \
fi
cd $(GPCC) && $(MAKE) mkgpfdist
cp -p $(GPCC)/build/bin/gpfdist$(EXE_EXT) $(INSTLOC)/bin/
cp -p $(GPMGMT)/bin/gpload $(INSTLOC)/bin/gpload
cp -p $(GPMGMT)/bin/gpload.py $(INSTLOC)/bin/gpload.py
$(MAKE) copylibs INSTLOC=$(INSTLOC)
$(MAKE) clients INSTLOC=$(INSTLOC) CLIENTINSTLOC=$(CLIENTINSTLOC)
$(MAKE) connectivity INSTLOC=$(INSTLOC) CONNECTIVITYINSTLOC=$(CONNECTIVITYINSTLOC)
if [ "$(findstring win,$(BLD_ARCH))" != "win" ]; then \
cd $(GPMGMT)/bin && $(MAKE) pygresql INSTLOC=$(INSTLOC) ; \
fi
$(MAKE) loaders INSTLOC=$(INSTLOC) LOADERSINSTLOC=$(LOADERSINSTLOC)
touch installcheck-good_SKIP
endef
endif
define MAKE_ISO
@which mkisofs > /dev/null 2>&1 || \
(echo "cannot find mkisofs in your path, unable to build ISO"; exit 1)
mv $(INSTLOC)/greenplum_path.sh $(INSTLOC)/../greenplum_path.sh.orig
unset LIBPATH; \
releng/generate-greenplum-path.sh $(INSTLOC) ISO > $(INSTLOC)/greenplum_path.sh
mkisofs -r -J -v -iso-level 4 -f -o $(INSTLOC)/../greenplum-db-$(MPP_ARCH).iso $(INSTLOC)
mv $(INSTLOC)/../greenplum_path.sh.orig $(INSTLOC)/greenplum_path.sh
endef
#---------------------------------------------------------------------
# Miscellaneous special purpose targets
#---------------------------------------------------------------------
test2 :
echo "CWD ="$(CURDIR)
echo "RELEASE="$(RELEASE)
test3: INSTLOC=$(DEVPATH)
test3: HOMEDEP
@rm -rf $(INSTLOC)/lib/*
@$(MAKE) copylibs INSTLOC=$(INSTLOC)
#---------------------------------------------------------------------
# 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 CC=\"$(strip $(BLD_CC) $(BLD_CFLAGS))\"" >> 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
#---------------------------------------------------------------------
# rsync + build
#---------------------------------------------------------------------
both : dbg opt ;
dbg:
rsync -rlvt --exclude=devel*/ --exclude=dist*/ --exclude=LOG.* ./ devel$(BLD_BITS)/
cd devel$(BLD_BITS) && $(MAKE) BLD_HOME=`pwd` PG_LANG=true devel
opt:
rsync -rlvt --exclude=devel*/ --exclude=dist*/ --exclude=LOG.* ./ dist$(BLD_BITS)/
cd dist$(BLD_BITS) && $(MAKE) GPROOT=`pwd` PG_LANG=true dist
#---------------------------------------------------------------------
# Development builds
#---------------------------------------------------------------------
devel : INSTCFLAGS=$(DEBUGFLAGS)
devel : INSTLOC=$(DEVPATH)
devel : CLIENTINSTLOC=$(CLIENTDEVPATH)
devel : CONNECTIVITYINSTLOC=$(CONNECTIVITYDEVPATH)
devel : LOADERSINSTLOC=$(LOADERSDEVPATH)
devel : GPPERFMONINSTLOC=$(GPPERFMONDEVPATH)
devel : GPPKGINSTLOC=$(GPPKGDEVPATH)
devel : CONFIGFLAGS+= --enable-cassert --enable-debug --enable-testutils --enable-debugbreak --enable-depend
ifdef ENABLE_VPATH_BUILD
devel : BUILDDIR=Debug
devel : ISCONFIG=$(BUILDDIR)/GNUmakefile
devel : gccVersionCheck version HOMEDEP Debug/GNUmakefile
else
devel : ISCONFIG=cdb-pg/GNUmakefile
devel : gccVersionCheck version HOMEDEP $(GPPGDIR)/GNUmakefile
endif
$(BUILD_STEPS)
# For Aurora / Chorus
devel-iso : INSTLOC=$(DEVPATH)
devel-iso: devel
$(MAKE_ISO)
#---------------------------------------------------------------------
# Release builds
#---------------------------------------------------------------------
dist : INSTCFLAGS=$(OPTFLAGS)
dist : INSTLOC=$(DISTPATH)
dist : CLIENTINSTLOC=$(CLIENTDISTPATH)
dist : CONNECTIVITYINSTLOC=$(CONNECTIVITYDISTPATH)
dist : LOADERSINSTLOC=$(LOADERSDISTPATH)
dist : GPPERFMONINSTLOC=$(GPPERFMONDISTPATH)
dist : GPPKGINSTLOC=$(GPPKGDISTPATH)
ifdef ENABLE_VPATH_BUILD
dist : BUILDDIR=Release
dist : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist : gccVersionCheck version GPROOTDEP RECONFIG Release/GNUmakefile
else
dist : ISCONFIG=cdb-pg/GNUmakefile
dist : gccVersionCheck version GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
ifneq "$(BLD_GPDB_BUILDSET)" "partial"
@$(MAKE) qautils-tarball INSTLOC=$(INSTLOC)
endif
dist_prof : INSTCFLAGS=$(PROFFLAGS)
dist_prof : INSTLOC=$(DISTPATH)
dist_prof : CLIENTINSTLOC=$(CLIENTDISTPATH)
dist_prof : CONNECTIVITYINSTLOC=$(CONNECTIVITYDISTPATH)
dist_prof : LOADERSINSTLOC=$(LOADERSDISTPATH)
dist_prof : GPPERFMONINSTLOC=$(GPPERFMONDISTPATH)
dist_prof : CONFIGFLAGS+= --enable-testutils
ifdef ENABLE_VPATH_BUILD
dist_prof : BUILDDIR=Release
dist_prof : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist_prof : gccVersionCheck version GPROOTDEP RECONFIG $(ISCONFIG)
else
dist_prof : ISCONFIG=cdb-pg/GNUmakefile
dist_prof : gccVersionCheck version GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
dist_faultinj : CLIENTINSTLOC=$(CLIENTDISTPATH)
dist_faultinj : CONNECTIVITYINSTLOC=$(CONNECTIVITYDISTPATH)
dist_faultinj : LOADERSINSTLOC=$(LOADERSDISTPATH)
dist_faultinj : CONFIGFLAGS+= --enable-testutils --enable-debugbreak
ifdef ENABLE_VPATH_BUILD
dist_faultinj : BUILDDIR=Release
dist_faultinj : ISCONFIG=$(BUILDDIR)/GNUmakefile
dist_faultinj : gccVersionCheck version GPROOTDEP RECONFIG Release/GNUmakefile
else
dist_faultinj : ISCONFIG=cdb-pg/GNUmakefile
dist_faultinj : gccVersionCheck version GPROOTDEP RECONFIG $(ISCONFIG)
endif
$(BUILD_STEPS)
# ISO build for Chorus / Aurora
dist-iso : INSTLOC=$(DISTPATH)
dist-iso: dist
$(MAKE_ISO)
#---------------------------------------------------------------------
# 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)" ""
CLIENT_HOME_DIR=$(GPROOT)
CONNECTIVITY_HOME_DIR=$(GPROOT)
LOADERS_HOME_DIR=$(GPROOT)
else
CLIENT_HOME_DIR=$(BLD_HOME)
CONNECTIVITY_HOME_DIR=$(BLD_HOME)
dist_faultinj : CLIENTINSTLOC=$(CLIENTDISTPATH)
LOADERS_HOME_DIR=$(BLD_HOME)
endif
CLIENTINSTLOC=$(CLIENT_HOME_DIR)/greenplum-clients
CLIENTINSTLOC_BIN=$(CLIENTINSTLOC)/bin
CLIENTINSTLOC_LIB=$(CLIENTINSTLOC)/lib
CLIENTINSTLOC_INCLUDE=$(CLIENTINSTLOC)/include
CLIENTINSTLOC_DOCS=$(CLIENTINSTLOC)/docs
CLIENTINSTLOC_OPENSOURCE=$(CLIENTINSTLOC)/thirdparty
LOADERSINSTLOC=$(LOADERS_HOME_DIR)/greenplum-loaders
LOADERSINSTLOC_BIN=$(LOADERSINSTLOC)/bin
LOADERSINSTLOC_BINEXT=$(LOADERSINSTLOC)/bin/ext/
LOADERSINSTLOC_EXT=$(LOADERSINSTLOC)/ext
LOADERSINSTLOC_LIB=$(LOADERSINSTLOC)/lib
LOADERSINSTLOC_LIB_PWARE=$(LOADERSINSTLOC)/lib/pware
LOADERSINSTLOC_DOCS=$(LOADERSINSTLOC)/docs
LOADERSINSTLOC_OPENSOURCE=$(LOADERSINSTLOC)/thirdparty
CONNECTIVITYINSTLOC=$(CONNECTIVITY_HOME_DIR)/greenplum-connectivity
CONNECTIVITYINSTLOC_JDBC=$(CONNECTIVITYINSTLOC)/drivers/jdbc
CONNECTIVITYINSTLOC_ODBC=$(CONNECTIVITYINSTLOC)/drivers/odbc
CONNECTIVITYINSTLOC_LIB=$(CONNECTIVITYINSTLOC)/lib
CONNECTIVITYINSTLOC_INCLUDE=$(CONNECTIVITYINSTLOC)/include
CONNECTIVITYINSTLOC_DOCS=$(CONNECTIVITYINSTLOC)/docs
CONNECTIVITYINSTLOC_OPENSOURCE=$(CONNECTIVITYINSTLOC)/thirdparty
ifneq "$(findstring win,$(BLD_ARCH))" "win"
DOC_TYPE=Unix
SCRIPT=.sh
else
DOC_TYPE=Win
SCRIPT=.bat
endif
define tmpCLIENT_SCRIPTS
endef
CLIENT_SCRIPTS = $(strip $(tmpCLIENT_SCRIPTS))
define tmpCLIENT_SQLDOCS
html
endef
CLIENT_SQLDOCS = $(strip $(tmpCLIENT_SQLDOCS))
define tmpCLIENT_FILESET
pg_dump$(EXE_EXT)
pg_dumpall$(EXE_EXT)
psql$(EXE_EXT)
endef
define Unix_CLIENT_FILESET
gpmapreduce$(EXE_EXT)
endef
CLIENT_FILESET = $(strip $(tmpCLIENT_FILESET) $($(DOC_TYPE)_CLIENT_FILESET))
# yes, the doubled gpload lines are correct
# this gives win32, win64 just gpload.py, as they want, and wrappers on the unix platforms
define tmpLOADERS_FILESET_BIN
gpfdist$(EXE_EXT)
gpload$(PY_EXT)
gpload.py
endef
LOADERS_FILESET_BIN = $(strip $(tmpLOADERS_FILESET_BIN))
define tmpLOADERS_FILESET_BINEXT
pygresql
yaml
endef
LOADERS_FILESET_BINEXT = $(strip $(tmpLOADERS_FILESET_BINEXT))
# moved BLD_PYTHON definition and inclusion in path and library path to Makefile.global
# define python file subset to ship by platform, as desired
BLD_PYTHON_FILESET=.
aix5_ppc_32_PYTHON_FILESET=bin/python* lib/python* include/python*
aix5_ppc_64_PYTHON_FILESET=bin/python* lib/python* include/python*
ifneq "$($(BLD_ARCH)_PYTHON_FILESET)" ""
BLD_PYTHON_FILESET=$($(BLD_ARCH)_PYTHON_FILESET)
endif
ifneq "$(findstring $(BLD_ARCH),win32 win64)" ""
BLD_OS=Windows
else
BLD_OS:=$(shell uname -s)
endif
AIX_LOADERS_LIBS=libbz2.a libz.a libpq.a liblber*.a libldap*.a libyaml*.a
Darwin_LOADERS_LIBS=libbm.so libmadlib.so libcrypto.*.dylib libssl.*.dylib libpq.*.dylib* libkrb5.*.dylib libcom_err.*.dylib libldap_r-*.dylib libk5crypto.*.dylib libkrb5support.*.dylib liblber-*.dylib
Linux_LOADERS_LIBS=libbm.so libmadlib.so libcrypto.so* libssl.so.* libz.so* libpq.so* libkrb5.so* libcom_err.so* libk5crypto.so* libkrb5support.so* liblber*.so* libldap_r-*so*
SunOS_LOADERS_LIBS=libbm.so libmadlib.so libcrypto.so* libssl.so.* libgcc_s.so.1 libz.so* libpq.so* libk5crypto.so* libkrb5support.so* liblber*.so* libldap_r-*so* libcom_err.so* libkrb5.so*
Windows_LOADERS_LIBS=libpq.dll
define tmpLOADERS_FILESET_LIB
$($(BLD_OS)_LOADERS_LIBS)
endef
LOADERS_FILESET_LIB = $(strip $(tmpLOADERS_FILESET_LIB))
aix5_ppc_32_LOADERS_LIBS_PERZL=libz.a
aix5_ppc_64_LOADERS_LIBS_PERZL=libz.so libz.so.1 libz.so.1.2.4 libcrypto.so libcrypto.so.0.9.8 libssl.so libssl.so.0.9.8
aix5_ppc_32_LOADERS_LIBS_PERZL_LOC=/opt/freeware/lib
aix5_ppc_64_LOADERS_LIBS_PERZL_LOC=/opt/pware64/lib
LOADERS_FILESET_LIB_PERZL=$($(BLD_ARCH)_LOADERS_LIBS_PERZL)
LOADERS_FILESET_LIB_PERZL_LOC=$($(BLD_ARCH)_LOADERS_LIBS_PERZL_LOC)
AIX_LOADERS_LIBS_PWARE=libbz2.a libiconv.a libintl.a libncurses.a libpanel.a libsqlite3.a
LOADERS_FILESET_LIB_PWARE=$($(BLD_OS)_LOADERS_LIBS_PWARE)
ifeq "$(MPP_ARCH)" ""
sol10_x86_64_MPP_ARCH=SOL-x86_64
sol10_x86_32_MPP_ARCH=SOL-i386
sol10_sparc_MPP_ARCH=SOL10-sparc
sol10_sparc_64_MPP_ARCH=SOL10-sparc_64
sol10_sparc_32_MPP_ARCH=SOL10-sparc_32
sol9_sparc_MPP_ARCH=SOL9-sparc
sol9_sparc_64_MPP_ARCH=SOL9-sparc_64
sol9_sparc_32_MPP_ARCH=SOL9-sparc_32
sol8_sparc_MPP_ARCH=SOL8-sparc
sol8_sparc_64_MPP_ARCH=SOL8-sparc_64
sol8_sparc_32_MPP_ARCH=SOL8-sparc_32
rhel4_x86_32_MPP_ARCH=RHEL4-i386
rhel4_x86_64_MPP_ARCH=RHEL4-x86_64
rhel5_x86_64_MPP_ARCH=RHEL5-x86_64
rhel6_x86_64_MPP_ARCH=RHEL6-x86_64
osx10_x86_MPP_ARCH=OSX-i386
osx105_x86_MPP_ARCH=OSX-i386
osx106_x86_MPP_ARCH=OSX-i386
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
# define build flags for GP Optimizer UDFs library
ifeq (Darwin, $(BLD_OS))
GPOPT_UDF_FLAGS := -m32 -dynamiclib -flat_namespace -undefined dynamic_lookup
else
GPOPT_UDF_FLAGS := -m64 -shared
endif
VERSION:=$(shell [ -f VERSION ] && perl -pe 's, ,-,g' VERSION)
ifeq "$(findstring win,$(BLD_ARCH))" "win"
BLD_PACKAGING_PID:=$(shell ssh build@harpy 'echo $$$$')
endif
connectivity :
@if [ ! -z "$(CONNECTIVITYINSTLOC)" ] && [ "$(CONNECTIVITYINSTLOC)" != "/" ]; then \
echo "rm -rf $(CONNECTIVITYINSTLOC)"; \
rm -rf $(CONNECTIVITYINSTLOC); \
fi
ifeq "$(findstring connectivity,$(BLD_TARGETS))" ""
# ---- build and packaging of the Connectivity package is currently disabled;
# ---- set BLD_TARGETS="connectivity" to enable them.
else
# ---- load LD_LIBRARY_PATH with the GPDB library set and build the ODBC drivers ----
cd $(INSTLOC)/ && \
. ./greenplum_path.sh; \
cd $(BLD_TOP)/client/odbc/src && \
$(MAKE) all
# ---- copy GPDB fileset ----
mkdir -p $(CONNECTIVITYINSTLOC_LIB)
(cd $(INSTLOC)/lib && $(TAR) cf - *) | (cd $(CONNECTIVITYINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(CONNECTIVITYINSTLOC_INCLUDE)
(cd $(INSTLOC)/include && $(TAR) cf - *) | (cd $(CONNECTIVITYINSTLOC_INCLUDE)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
ifneq "$(findstring $(BLD_ARCH),sol8_sparc_32 sol9_sparc_32)" ""
(cd /usr/local/lib/ && $(TAR) cf - libiconv.so* libsasl2.so*) | (cd $(CONNECTIVITYINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(CONNECTIVITYINSTLOC_OPENSOURCE)
(cd $(BLD_TOP)/opensource/ && $(TAR) cf - libiconv-* sasl-*) | (cd $(CONNECTIVITYINSTLOC_OPENSOURCE)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
endif
# ---- copy JDBC fileset ----
mkdir -p $(CONNECTIVITYINSTLOC_JDBC)
cp -fp client/jdbc/*.jar $(CONNECTIVITYINSTLOC_JDBC)
# ---- copy ODBC fileset ----
mkdir -p $(CONNECTIVITYINSTLOC_ODBC)
(cd client/odbc/src/greenplum-connectivity/odbc/ && $(TAR) cf - --exclude=*.la *) | (cd $(CONNECTIVITYINSTLOC_ODBC)/ && $(TAR) xvf -)$(check_pipe_for_errors)
# ---- copy scripts fileset ----
mkdir -p $(CONNECTIVITYINSTLOC)
cp -f client/scripts/greenplum_$@_path$(SCRIPT) $(CONNECTIVITYINSTLOC)/
# ---- copy license files ----
if [ -d ${BLD_TOP}/../licenses ] ; then \
if [ -a $(CONNECTIVITYINSTLOC)/GPDB-LICENSE.txt ] ; then \
rm -f $(CONNECTIVITYINSTLOC)/GPDB-LICENSE.txt ; \
fi ; \
if [ -a $(CONNECTIVITYINSTLOC)/LICENSE.thirdparty ] ; then \
rm -f $(CONNECTIVITYINSTLOC)/LICENSE.thirdparty ; \
fi ; \
cp ${BLD_TOP}/../licenses/GPDB-LICENSE.txt $(CONNECTIVITYINSTLOC) ; \
cp ${BLD_TOP}/../licenses/LICENSE.thirdparty $(CONNECTIVITYINSTLOC) ; \
else \
echo "ERROR: LICENSE.thirdparty and GPDB-LICENSE.txt; ${BLD_TOP}/../licenses not found" ; \
exit 1; \
fi
# ---- create the installer ----
$(warn MPP_ARCH=$(MPP_ARCH))
# ---- updating the version in required packages ----
@$(MAKE) set_scripts_version INSTLOC=$(CONNECTIVITYINSTLOC)
ifneq "$(findstring win,$(BLD_ARCH))" "win"
cd client/install/src/unix/ && \
$(MAKE) TAR=$(TAR) PRODUCT=Connectivity PACKAGE=greenplum-connectivity README=GPConnectUnix VERSION=$(VERSION) INSTALL_SRC=$(CONNECTIVITYINSTLOC) INSTALL_DIR=../../../..
else
if [ "$(BLD_PACKAGING_PID)" = "" ]; then \
echo "ERROR: BLD_PACKAGING_PID must have a value for Windows packaging operations; check your Makefile"; \
exit 1; \
fi
ssh build@harpy 'if [ -d $(BLD_PACKAGING_PID) ]; then rm -rf $(BLD_PACKAGING_PID); fi'
ssh build@harpy 'mkdir -p $(BLD_PACKAGING_PID)/packaging/src/windows'
scp -r client/install/src/windows/* build@harpy:$(BLD_PACKAGING_PID)/packaging/src/windows/
scp -r $(CONNECTIVITYINSTLOC) build@harpy:$(BLD_PACKAGING_PID)/packaging/
ssh build@harpy 'cd $(BLD_PACKAGING_PID)/packaging/src/windows/ && make PACKAGE=greenplum-$@ VERSION=$(VERSION) SRCDIR=../../$(notdir $(CONNECTIVITYINSTLOC))'
scp build@harpy:$(BLD_PACKAGING_PID)/packaging/greenplum-$@-$(VERSION)-WinXP-x86_32.msi .
chmod 755 greenplum-$@-$(VERSION)-WinXP-x86_32.msi
ssh build@harpy 'rm -rf $(BLD_PACKAGING_PID)'
endif
# ---- create the pyodbc package(s) ----
for i in unixodbc-2.2.11 unixodbc-2.2.12 unixodbc-2.2.14 datadirect-5.1sp2 datadirect-5.2; do \
if [ -f client/odbc/src/pyodbc-2.1.4/.$${i}/.install/lib/python2.5/site-packages/pyodbc.so ]; then \
$(TAR) czvf pyodbc-2.1.4-$${i}.tar.gz -C client/odbc/src/pyodbc-2.1.4/.$${i}/.install/ lib ; \
fi ; \
done
endif
clients :
if [ ! -z "$(CLIENTINSTLOC)" ] && [ "$(CLIENTINSTLOC)" != "/" ]; then rm -rf $(CLIENTINSTLOC); 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 $(CLIENTINSTLOC_BIN)
(cd $(INSTLOC)/bin && $(TAR) cf - $(CLIENT_FILESET)) | (cd $(CLIENTINSTLOC_BIN)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(CLIENTINSTLOC_INCLUDE)
(cd $(INSTLOC)/include && $(TAR) cf - *) | (cd $(CLIENTINSTLOC_INCLUDE)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(CLIENTINSTLOC_LIB)
(cd $(INSTLOC)/lib && $(TAR) cf - *) | (cd $(CLIENTINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
ifneq "$(findstring $(BLD_ARCH),sol8_sparc_32 sol9_sparc_32)" ""
(cd /usr/local/lib/ && $(TAR) cf - libiconv.so* libidn.so* libintl.so* libsasl2.so*) | (cd $(CLIENTINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(CLIENTINSTLOC_OPENSOURCE)
(cd $(BLD_TOP)/opensource/ && $(TAR) cf - libiconv-* libidn-* libintl-* sasl-*) | (cd $(CLIENTINSTLOC_OPENSOURCE)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
endif
# ---- copy docs fileset ----
mkdir -p $(CLIENTINSTLOC_DOCS)
cp -rpf client/docs/release/$(CLIENT_SQLDOCS) $(CLIENTINSTLOC_DOCS)/
# ---- copy scripts fileset ----
mkdir -p $(CLIENTINSTLOC)
cp -f client/scripts/greenplum_$@_path$(SCRIPT) $(CLIENTINSTLOC)/
# ---- copy license files ----
if [ -d ${BLD_TOP}/../licenses ] ; then \
if [ -a $(CLIENTINSTLOC)/GPDB-LICENSE.txt ] ; then \
rm -f $(CLIENTINSTLOC)/GPDB-LICENSE.txt ; \
fi ; \
if [ -a $(CLIENTINSTLOC)/LICENSE.thirdparty ] ; then \
rm -f $(CLIENTINSTLOC)/LICENSE.thirdparty ; \
fi ; \
cp ${BLD_TOP}/../licenses/GPDB-LICENSE.txt $(CLIENTINSTLOC) ; \
cp ${BLD_TOP}/../licenses/LICENSE.thirdparty $(CLIENTINSTLOC) ; \
else \
echo "ERROR: LICENSE.thirdparty and GPDB-LICENSE.txt; ${BLD_TOP}/../licenses not found" ; \
exit 1; \
fi
# ---- create the installer ----
$(warn MPP_ARCH=$(MPP_ARCH))
# ---- Updating the version in required packages ----
@$(MAKE) set_scripts_version INSTLOC=$(CLIENTINSTLOC)
ifneq "$(findstring win,$(BLD_ARCH))" "win"
cd client/install/src/unix/ && \
$(MAKE) TAR=$(TAR) PRODUCT=Clients PACKAGE=greenplum-clients README=GPClientToolsUnix VERSION=`perl -pe 's, ,-,g' ../../../../VERSION` INSTALL_SRC=$(CLIENTINSTLOC) INSTALL_DIR=../../../..
else
if [ "$(BLD_PACKAGING_PID)" = "" ]; then \
echo "ERROR: BLD_PACKAGING_PID must have a value for Windows packaging operations; check your Makefile"; \
exit 1; \
fi
ssh build@harpy 'if [ -d $(BLD_PACKAGING_PID) ]; then rm -rf $(BLD_PACKAGING_PID); fi'
ssh build@harpy 'mkdir -p $(BLD_PACKAGING_PID)/packaging/src/windows'
scp -r client/install/src/windows/* build@harpy:$(BLD_PACKAGING_PID)/packaging/src/windows/
scp -r $(CLIENTINSTLOC) build@harpy:$(BLD_PACKAGING_PID)/packaging/
ssh build@harpy 'cd $(BLD_PACKAGING_PID)/packaging/src/windows/ && make PACKAGE=greenplum-$@ VERSION=$(VERSION) SRCDIR=../../$(notdir $(CLIENTINSTLOC))'
scp build@harpy:$(BLD_PACKAGING_PID)/packaging/greenplum-$@-$(VERSION)-WinXP-x86_32.msi .
chmod 755 greenplum-$@-$(VERSION)-WinXP-x86_32.msi
ssh build@harpy 'rm -rf $(BLD_PACKAGING_PID)'
endif
endif
loaders :
if [ ! -z "$(LOADERSINSTLOC)" ] && [ "$(LOADERSINSTLOC)" != "/" ]; then rm -rf $(LOADERSINSTLOC); fi
ifeq "$(findstring loaders,$(BLD_TARGETS))" ""
# ---- build and packaging of the Loaders package is currently disabled;
# ---- set BLD_TARGETS="loaders" to enable them.
else
# ---- copy GPDB fileset ----
mkdir -p $(LOADERSINSTLOC_BIN)
(cd $(INSTLOC)/bin/ && $(TAR) cf - $(LOADERS_FILESET_BIN)) | (cd $(LOADERSINSTLOC_BIN)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(LOADERSINSTLOC_BINEXT)
(cd $(GPMGMT)/bin/ext/ && $(TAR) cf - $(LOADERS_FILESET_BINEXT)) | (cd $(LOADERSINSTLOC_BINEXT)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
ifeq "$(findstring win,$(BLD_ARCH))" "win"
# ---- copy pygresql from ext/win32 ----
(cd $(BLD_THIRDPARTY)/win32 && $(TAR) cf - pygresql) | (cd $(LOADERSINSTLOC_BINEXT)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
endif
ifneq "$($(BLD_ARCH)_PYTHON)" ""
mkdir -p $(LOADERSINSTLOC_EXT)/python
(cd $($(BLD_ARCH)_PYTHON) && $(TAR) cf - $(BLD_PYTHON_FILESET)) | (cd $(LOADERSINSTLOC_EXT)/python/ && $(TAR) xpf -)$(check_pipe_for_errors)
endif
mkdir -p $(LOADERSINSTLOC_LIB)
ifneq "$(LOADERS_FILESET_LIB)" ""
(cd $(INSTLOC)/lib/ && $(TAR) cf - $(LOADERS_FILESET_LIB)) | (cd $(LOADERSINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
endif
ifneq "$(LOADERS_FILESET_LIB_PERZL)" ""
# include libraries from www.perzl.org needed by the pware Python-2.6.1 build
mkdir -p $(LOADERSINSTLOC_LIB_PWARE)
($(TAR) cf - -C $(LOADERS_FILESET_LIB_PERZL_LOC) $(LOADERS_FILESET_LIB_PERZL)) | ($(TAR) xvpf - -C $(LOADERSINSTLOC_LIB_PWARE))$(check_pipe_for_errors)
endif
ifneq "$(LOADERS_FILESET_LIB_PWARE)" ""
# include libraries from pware needed by the pware Python-2.6.1 build
mkdir -p $(LOADERSINSTLOC_LIB_PWARE)
($(TAR) cf - -C $($(BLD_ARCH)_PYTHON)/lib $(LOADERS_FILESET_LIB_PWARE)) | ($(TAR) xvpf - -C $(LOADERSINSTLOC_LIB_PWARE))$(check_pipe_for_errors)
endif
#ifneq "$(findstring $(BLD_ARCH),aix5_ppc_32 aix5_ppc_64)" ""
# (cd /opt/freeware/lib/ && $(TAR) cf - libbz2.a libz.a) | (cd $(LOADERSINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
#endif
ifneq "$(findstring $(BLD_ARCH),sol8_sparc_32 sol9_sparc_32 sol10_sparc_32)" ""
(cd /usr/local/lib/ && $(TAR) cf - libiconv.so* libexpat.so*) | (cd $(LOADERSINSTLOC_LIB)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
mkdir -p $(LOADERSINSTLOC_OPENSOURCE)
(cd $(BLD_TOP)/opensource/ && $(TAR) cf - libiconv-* expat-*) | (cd $(LOADERSINSTLOC_OPENSOURCE)/ && $(TAR) xvpf -)$(check_pipe_for_errors)
endif
# ---- copy scripts fileset ----
mkdir -p $(LOADERSINSTLOC)
cp -f client/scripts/greenplum_$@_path$(SCRIPT) $(LOADERSINSTLOC)/
# ---- copy license files ----
if [ -d ${BLD_TOP}/../licenses ] ; then \
if [ -a $(LOADERSINSTLOC)/GPDB-LICENSE.txt ] ; then \
rm -f $(LOADERSINSTLOC)/GPDB-LICENSE.txt ; \
fi ; \
if [ -a $(LOADERSINSTLOC)/LICENSE.thirdparty ] ; then \
rm -f $(LOADERSINSTLOC)/LICENSE.thirdparty ; \
fi ; \
cp ${BLD_TOP}/../licenses/GPDB-LICENSE.txt $(LOADERSINSTLOC) ; \
cp ${BLD_TOP}/../licenses/LICENSE.thirdparty $(LOADERSINSTLOC) ; \
else \
echo "ERROR LICENSE.thirdparty and GPDB-LICENSE.txt; ${BLD_TOP}/../licenses not found" ; \
exit 1; \
fi
# ---- create the installer ----
# ---- updating the version in required packages ----
@$(MAKE) set_scripts_version INSTLOC=$(LOADERSINSTLOC)
ifneq "$(findstring win,$(BLD_ARCH))" "win"
cd client/install/src/unix/ && \
$(MAKE) TAR=$(TAR) PRODUCT=Loaders PACKAGE=greenplum-loaders README=GPLoadToolsUnix VERSION=`perl -pe 's, ,-,g' ../../../../VERSION` INSTALL_SRC=$(LOADERSINSTLOC) INSTALL_DIR=../../../..
else
if [ "$(BLD_PACKAGING_PID)" = "" ]; then \
echo "ERROR: BLD_PACKAGING_PID must have a value for Windows packaging operations; check your Makefile"; \
exit 1; \
fi
ssh build@harpy 'if [ -d $(BLD_PACKAGING_PID) ]; then rm -rf $(BLD_PACKAGING_PID); fi'
ssh build@harpy 'mkdir -p $(BLD_PACKAGING_PID)/packaging/src/windows'
scp -r client/install/src/windows/* build@harpy:$(BLD_PACKAGING_PID)/packaging/src/windows/
scp -r $(LOADERSINSTLOC) build@harpy:$(BLD_PACKAGING_PID)/packaging/
ssh build@harpy 'cd $(BLD_PACKAGING_PID)/packaging/src/windows/ && make PACKAGE=greenplum-$@ VERSION=$(VERSION) SRCDIR=../../$(notdir $(LOADERSINSTLOC))'
scp build@harpy:$(BLD_PACKAGING_PID)/packaging/greenplum-$@-$(VERSION)-WinXP-x86_32.msi .
chmod 755 greenplum-$@-$(VERSION)-WinXP-x86_32.msi
ssh build@harpy 'rm -rf $(BLD_PACKAGING_PID)'
endif
endif
pwx :
# ---- build and packaging of the PWX package has been moved to //drivers/pwx/<branch>
#---------------------------------------------------------------------
# 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/diskqual.ksh \
bin/generate_load_tpch.pl \
bin/gpscp \
bin/gpssh \
bin/gpcheckperf \
bin/run_operator_tests.pl \
$(NULL)
PVK_FILESET = \
$(CHECKTOOLS_SCRIPTS) \
bin/lib/gplib.py \
bin/lib/pxssh.py \
bin/lib/pexpect.py \
bin/lib/gpsys.py \
bin/lib/multidd \
bin/lib/netperf \
bin/lib/netserver \
bin/lib/stream \
$(NULL)
pvk : INSTCFLAGS=$(OPTFLAGS)
pvk : INSTLOC=$(DISTPATH)
pvk : gccVersionCheck version GPROOTDEP
cd $(GPMGMT)/bin && $(MAKE) netperf 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/gpbitmapreindex \
bin/gpcheck \
bin/gpcheckperf \
bin/gpcrondump.py \
bin/gpdbrestore \
bin/gpdeletesystem \
bin/gpexpand \
bin/gpextract \
bin/gpfilespace \
bin/gpinitstandby \
bin/gpinitsystem \
bin/gpload.py \
bin/gplogfilter \
bin/gpmigrator \
bin/gpmigrator_mirror \
bin/gpmovemirrors \
bin/gprebuildsystem \
bin/gprecoverseg \
bin/gpscp \
bin/gpsizecalc \
bin/gpskew \
bin/gpssh \
bin/gpssh-exkeys \
bin/gpstart \
bin/gpstate \
bin/gpstop \
bin/gpsys1 \
bin/lib/gpcheckcat \
sbin/gpaddconfig.py \
sbin/gpchangeuserpassword \
sbin/gpcheck_hostdump \
sbin/gpcleansegmentdir.py \
sbin/gpfixuserlimts \
sbin/gpgetstatususingtransition.py \
sbin/gprepairmirrorseg.py \
sbin/gpsegstart.py \
sbin/gpsegstop.py \
sbin/gpsegtoprimaryormirror.py \
sbin/gpsetdbid.py \
sbin/gpsuspend.py \
sbin/gpupgrademirror.py \
lib/python/gppylib/programs/clsAddMirrors.py \
lib/python/gppylib/programs/clsHostCacheLookup.py \
lib/python/gppylib/programs/clsInjectFault.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/programs/verify.py \
lib/python/gppylib/mainUtils.py \
$(NULL)
set_scripts_version :
@for file in $(SET_VERSION_SCRIPTS); do \
if [ -f $(INSTLOC)/$${file} ]; then \
perl putversion $(INSTLOC)/$${file} ; \
fi ; \
done
#---------------------------------------------------------------------
# Internal functions
#---------------------------------------------------------------------
groupSession:
@cd $(GPMGMT)/bin && $(MAKE)
mkgpcc:
@cd $(GPCC) && $(MAKE) OPT="$(INSTCFLAGS)"
# In artifactory, we only have R for osx106_x86, rhel5_x86_64
plr:
ifneq "$(findstring $(BLD_ARCH),osx106_x86 rhel5_x86_64)" ""
@echo "Building plr project and creating tarball."
@cd $(PLR) && $(MAKE) R_HOME=$(R_HOME)
(cd $(PLR); \
rm -rf tmpdir; \
mkdir -p tmpdir/share/postgresql/contrib tmpdir/lib/postgresql \
tmpdir/R-2.13.0-1; \
cp plr.so tmpdir/lib/postgresql; \
cp plr.sql tmpdir/share/postgresql/contrib; \
tar -cf - -C $(R_HOME) . | tar -xpf - -C tmpdir/R-2.13.0-1; \
cp plr_install.sh tmpdir; \
tar -zcf $(BLD_TOP)/plr.tgz -C tmpdir .)
else
@echo "INFO: plr is not built automatically on this platform"
endif
mkpgbench:
@cd $(BUILDDIR)/contrib/pgbench && $(MAKE) install
#mkgpperfmon:
# @cd $(GPPERFMON) && $(MAKE) BUILDDIR=$(BUILDDIR)
# cp -p gpperfmon/src/gpmon/gpmmon gpperfmon/src/gpmon/gpsmon $(INSTLOC)/bin
# cp -p gpperfmon/src/gpmon/gpmon_catqrynow.py $(INSTLOC)/sbin
# cp -p gpperfmon/src/gpmon/gpperfmon_install $(INSTLOC)/bin
# mkdir -p $(INSTLOC)/lib/gpperfmon
# cp -p gpperfmon/src/gpmon/gpperfmon3.sql $(INSTLOC)/lib/gpperfmon
# cp -p gpperfmon/src/gpmon/gpperfmon4.sql $(INSTLOC)/lib/gpperfmon
# cp -p gpperfmon/src/gpmon/gpperfmon41.sql $(INSTLOC)/lib/gpperfmon
# cp -p gpperfmon/src/gpmon/gpperfmon42.sql $(INSTLOC)/lib/gpperfmon
# cp -p gpperfmon/src/gpmon/gpperfmonC.sql $(INSTLOC)/lib/gpperfmon
mkplatform:
@cd $(PLATFORM) && $(MAKE)
cp -p platform/gpnetbench/gpnetbenchServer $(INSTLOC)/bin/lib
cp -p platform/gpnetbench/gpnetbenchClient $(INSTLOC)/bin/lib
mkdir -p $(INSTLOC)/etc
cp -p platform/gpcheck/gpcheck.cnf $(INSTLOC)/etc/
copydocs :
@if [ ! -d $($INSTLOC)/docs ] ; then mkdir -p $(INSTLOC)/docs; fi
@if [ ! -d $(GPDOCDIR) ] ; then \
echo "Error Copying Documentation: $(GPDOCDIR) is not present"; \
else echo "Copying Documentation" ; \
if [ -d $(INSTLOC)/doc/postgresql/contrib ] ; then \
mkdir -p $(INSTLOC)/docs/contrib ; \
echo "Copying postgresql contrib documentation" ; \
cp -r $(INSTLOC)/doc/postgresql/contrib/* $(INSTLOC)/docs/contrib ; \
fi ; \
echo "Copying $(BLD_TOP)/languages/PLJAVA/PLJAVA_README" ; \
cp -p $(BLD_TOP)/languages/PLJAVA/PLJAVA_README $(INSTLOC)/share/postgresql/pljava ; \
fi
@if [ -d $(INSTLOC)/doc ] ; then \
echo "Removing $(INSTLOC)/doc" ; \
rm -rf $(INSTLOC)/doc ; \
fi
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)
ifeq "$(findstring $(BLD_ARCH),$(GPPKG_PLATFORMS))" ""
@echo "Removing gppkg from distribution"
rm -f $(INSTLOC)/bin/gppkg
endif
cp -rp $(GPMGMT)/sbin/* $(INSTLOC)/sbin/.
cp -rp $(GPCC)/build/bin $(INSTLOC)
cp $(GPPGDIR)/src/test/regress/*.pl $(INSTLOC)/bin
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/gpmapreduce ]; then \
# mkdir -p $(INSTLOC)/demo; \
# $(TAR) -C $(GPMGMT)/demo -czf $(INSTLOC)/demo/gpmapreduce.tar.gz gpmapreduce; \
# 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/CVS
rm -rf $(INSTLOC)/doc/CVS
rm -rf $(INSTLOC)/bin/ext
rm -rf $(INSTLOC)/bin/pythonSrc
rm -rf $(INSTLOC)/bin/Makefile
rm -rf $(INSTLOC)/bin/lib/CVS
rm -rf $(INSTLOC)/bin/lib/.p4ignore
rm -rf $(INSTLOC)/bin/src
rm -f $(INSTLOC)/bin/gpchecksubnetcfg
echo "`date` -- INFO: Removing $(INSTLOC)/bin/gpexpandsystem"
rm -f $(INSTLOC)/bin/gpexpandsystem
rm -rf $(INSTLOC)/bin/gppylib
find $(INSTLOC)/lib/python/gppylib -name test -type d | xargs rm -rf
BLD_LDD=ldd
osx104_x86_LDD=otool -L
ifneq "$($(BLD_ARCH)_LDD)" ""
BLD_LDD=$($(BLD_ARCH)_LDD)
endif
BLD_LDD_FILTER=|awk '{print $$3}' | sort -u | perl -p -i -e 's,^(.*\.so.*),\1\*,'
osx104_x86_LDD_FILTER=|awk '{print $$1}' | perl -p -i -e 's,^(.*)\.dylib,\1\*\.dylib,'
ifneq "$($(BLD_ARCH)_LDD_FILTER)" ""
BLD_LDD_FILTER=$($(BLD_ARCH)_LDD_FILTER)
endif
libcopy=(cd $(1) && $(TAR) cf - $(2)) | (cd $(3) && $(TAR) xvf -)$(check_pipe_for_errors)
.PHONY: copy-rsa-libs
copy-rsa-libs:
# Copy rsa-bsafe libs
if [ -f $(BLD_THIRDPARTY_LIB_DIR)/libcryptocme.sig ]; then \
cp -fp $(BLD_THIRDPARTY_LIB_DIR)/libcryptocme.s* $(INSTLOC)/lib/; \
cp -fp $(BLD_THIRDPARTY_LIB_DIR)/libccme_* $(INSTLOC)/lib/; \
fi
# Copy rsa lockbox libs - supported only on rhel
ifeq "$(BLD_ARCH)" "rhel5_x86_64"
cp -fpr $(BLD_THIRDPARTY_LIB_DIR)/rsa_csp $(INSTLOC)/lib/;
endif
copylibs : thirdparty-dist copy-rsa-libs
if [ `uname -s` = 'SunOS' ]; then cp `ldd $(INSTLOC)/bin/psql | grep gcc | head -1 | awk '{print $$3}'` $(INSTLOC)/lib; fi
if [ `uname -s` = 'Darwin' ] ; then \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/ ; \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/ ; \
for lib in `otool -L $(INSTLOC)/bin/psql | egrep 'libssl|libcrypto|libcom_err|libkrb5|curl|readline|numa' | awk '{print $$1}'`; do \
if [ x"`dirname $$lib`" = x"$(INSTLOC)/lib" ]; then continue; fi; \
if [ -f $(INSTLOC)/lib/`basename $$lib` -a ! -w $(INSTLOC)/lib/`basename $$lib` ]; then chmod u+w $(INSTLOC)/lib/`basename $$lib`; fi; \
if [ -f $(BLD_THIRDPARTY_LIB_DIR)/`basename $$lib` ]; then \
echo "cp -p $(BLD_THIRDPARTY_LIB_DIR)/`basename $$lib` $(INSTLOC)/lib/" ; \
cp -p $(BLD_THIRDPARTY_LIB_DIR)/`basename $$lib` $(INSTLOC)/lib/ ; \
else \
echo "cp -p $$lib $(INSTLOC)/lib/" ; \
cp -p $$lib $(INSTLOC)/lib/ ; \
fi ; \
done ; \
fi
if [ `uname -s` != 'Darwin' -a `uname -s` != 'AIX' ] ; then \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/ ; \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/ ; \
for lib in `ldd $(INSTLOC)/bin/psql | egrep 'libssl|libcrypto|libcom_err|curl|readline|numa' | awk '{print $$3}' | sort -u`; do \
if [ x"`dirname $$lib`" = x"$(INSTLOC)/lib" ]; then continue; fi; \
if [ -f $(INSTLOC)/lib/`basename $$lib` -a ! -w $(INSTLOC)/lib/`basename $$lib` ]; then chmod u+w $(INSTLOC)/lib/`basename $$lib`; fi; \
echo "cp -p $$lib $(INSTLOC)/lib" ; \
cp -p $$lib $(INSTLOC)/lib ; \
done ; \
fi
if [ `uname -s` = 'AIX' ] ; then \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/ ; \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/ ; \
for lib in `ldd $(INSTLOC)/bin/psql | egrep 'libssl|libcrypto|libcom_err|curl|readline|numa' | awk -F\( '{print $$1}' | sort -u`; do \
if [ x"`dirname $$lib`" = x"$(INSTLOC)/lib" ]; then continue; fi; \
if [ -f $(INSTLOC)/lib/`basename $$lib` -a ! -w $(INSTLOC)/lib/`basename $$lib` ]; then chmod u+w $(INSTLOC)/lib/`basename $$lib`; fi; \
echo "cp -p $$lib $(INSTLOC)/lib" ; \
cp -p $$lib $(INSTLOC)/lib ; \
done ; \
for lib in `ldd $(INSTLOC)/bin/gpfdist | egrep 'libbz2|libz' | awk -F\( '{print $$1}' | sort -u`; do \
if [ x"`dirname $$lib`" = x"$(INSTLOC)/lib" ]; then continue; fi; \
if [ -f $(INSTLOC)/lib/`basename $$lib` -a ! -w $(INSTLOC)/lib/`basename $$lib` ]; then chmod u+w $(INSTLOC)/lib/`basename $$lib`; fi; \
echo "cp -p $$lib $(INSTLOC)/lib" ; \
cp -p $$lib $(INSTLOC)/lib ; \
done ; \
fi
if [ `uname -s` != 'AIX' -a `uname -s` != 'Darwin' ] ; then \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libmadlib.so $(INSTLOC)/lib/postgresql/ ; \
echo "cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/" ; \
cp $(BLD_THIRDPARTY_LIB_DIR)/libbm.so $(INSTLOC)/lib/postgresql/ ; \
lib_wildcards=`$(BLD_LDD) $(INSTLOC)/bin/lib/gpcheckdb | egrep 'libstdc\+\+' $(BLD_LDD_FILTER)` export lib_wildcards; \
if [ -z "$${lib_wildcards}" ]; then exit 0; fi; \
lib_list=`ls $${lib_wildcards}` export lib_list; \
for lib in $${lib_list}; do \
echo -n "Copying $$lib to $(subst $(CURDIR)/,,$(INSTLOC)/lib)..."; \
if [ x"`dirname $$lib`" = x"$(INSTLOC)/lib" ]; then echo "already there."; continue; fi; \
if [ -f $(INSTLOC)/lib/`basename $$lib` -a ! -w $(INSTLOC)/lib/`basename $$lib` ]; then chmod u+w $(INSTLOC)/lib/`basename $$lib`; fi; \
(cd `dirname $$lib` && $(TAR) cf - `basename $$lib`) | (cd $(INSTLOC)/lib/ && $(TAR) xpf -)$(check_pipe_for_errors); \
echo "done."; \
done; \
fi
# Create the python directory to flag to build scripts that python has been handled
mkdir -p $(INSTLOC)/ext/python
@if [ ! -z "$(BLD_PYTHON)" ]; then \
echo "Copying python, $(BLD_PYTHON_FILESET), from $(BLD_PYTHON) into $(INSTLOC)/ext/python..."; \
(cd $(BLD_PYTHON) && $(TAR) cf - $(BLD_PYTHON_FILESET)) | (cd $(INSTLOC)/ext/python/ && $(TAR) xpf -); \
echo "...DONE"; \
else \
echo "INFO: Python not found on this platform, $(BLD_ARCH), not copying it into the GPDB package."; \
fi
mkdir -p $(INSTLOC)/etc
mkdir -p $(INSTLOC)/include
# Copy libhdfs3
cp -rp $(BLD_THIRDPARTY_INCLUDE_DIR)/hdfs $(INSTLOC)/include/
# Copy kerberos binary
cp -rp $(BLD_THIRDPARTY_BIN_DIR)/kinit $(INSTLOC)/bin/
cp -rp $(BLD_THIRDPARTY_BIN_DIR)/kpasswd $(INSTLOC)/bin/
cp -rp $(BLD_THIRDPARTY_BIN_DIR)/kdestroy $(INSTLOC)/bin/
cp -rp $(BLD_THIRDPARTY_BIN_DIR)/klist $(INSTLOC)/bin/
ifeq "$(findstring $(BLD_ARCH),aix5_ppc_32 aix5_ppc_64 win32 win64)" ""
# Copy curl header file
cp -rp $(BLD_THIRDPARTY_INCLUDE_DIR)/curl $(INSTLOC)/include/
# Copy in openssl files needed by gpperfmon
endif
ifeq "$(findstring $(BLD_ARCH),aix5_ppc_32 win32 win64)" ""
ifneq "$(BLD_ARCH)" "osx104_x86"
cp -rp $(BLD_THIRDPARTY_BIN_DIR)/openssl $(INSTLOC)/bin/
cp -rp $(BLD_THIRDPARTY_INCLUDE_DIR)/openssl $(INSTLOC)/include/
cp -rp $(BLD_THIRDPARTY_DIR)/ssl/openssl.cnf $(INSTLOC)/etc/
else
cp -rp /usr/bin/openssl $(INSTLOC)/bin/
cp -rp /usr/include/openssl $(INSTLOC)/include/
cp -rp /System/Library/OpenSSL/openssl.cnf $(INSTLOC)/etc/
endif
endif
# Copy glider stack trace capture tool
-cp -rp $(BLD_THIRDPARTY_BIN_DIR)/glider $(INSTLOC)/sbin/
ifneq "$(BLD_GPDB_BUILDSET)" "partial"
# Copy GP Optimizer libraries
echo "Copying Orca libraries";
for b in libnaucrates libgpdbcost libgpopt; do \
rm -f $(INSTLOC)/lib/$$b.$(LDSFX); \
echo "Copying $$b"; \
cp $(OPTIMIZER)/$$b/$(OBJDIR_DEFAULT)/$$b.$(LDSFX) $(INSTLOC)/lib ; \
done
rm -f $(INSTLOC)/lib/libgpos.$(LDSFX);
cp $(LIBGPOS_LIBDIR)/libgpos.$(LDSFX) $(INSTLOC)/lib;
rm -f $(INSTLOC)/lib/libxerces-c-3.1.$(LDSFX);
cp $(XERCES_LIBDIR)/libxerces-c-3.1.$(LDSFX) $(INSTLOC)/lib;
# Copy DXL translators library
echo "Copy DXL translators library";
cp $(BLD_TOP)/cdb-pg/src/backend/gpopt/libdxltranslators.$(LDSFX) $(INSTLOC)/lib;
cd $(LIBSTDC++_LIBDIR); tar cvf - * | (cd $(INSTLOC)/lib; tar xfp -)
# Create GP Optimizer UDFs library
echo "Create GP Optimizer UDFs library";
rm -f $(INSTLOC)/lib/libgpoptudf.$(LDSFX);
g++ $(GPOPT_UDF_FLAGS) -L$(INSTLOC)/lib -lgpos -lnaucrates -lgpdbcost -lgpopt -o $(INSTLOC)/lib/libgpoptudf.$(LDSFX) ./cdb-pg/src/backend/gpopt/utils/funcs.o ;
endif
greenplum_path:
mkdir -p $(INSTLOC)
unset LIBPATH; \
releng/generate-greenplum-path.sh $(INSTLOC) > $(INSTLOC)/greenplum_path.sh
goh:
mkdir -p $(INSTLOC)/etc
cp -rp releng/goh/etc/* $(INSTLOC)/etc/
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
##
## Create qautils tarball. This file contains the utils required to
## support cdbfast runs.
##
qautils-tarball:
@$(TAR) -zcf releng/qautils-$(MPP_ARCH).tar.gz -C $(INSTLOC) $(shell cat releng/QAUTILS_FILES.txt)
#---------------------------------------------------------------------
# Cleanup
#---------------------------------------------------------------------
clean :
# @if [ ! -f $(ISCONFIG) ]; then echo "cdb-pg 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
@if [ -d $(GPCC) ]; then cd $(GPCC); $(MAKE) clean; fi
@if [ -d $(GPPERFMON) ]; then cd $(GPPERFMON); $(MAKE) clean; fi
@if [ -d client/odbc/src/Makefile ]; then cd client/odbc/src; $(MAKE) clean; fi
distclean :
# @if [ ! -f $(ISCONFIG) ]; then echo "cdb-pg 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
@if [ -d $(GPCC) ]; then cd $(GPCC); $(MAKE) clean; fi
@if [ -d $(GPPERFMON) ]; then cd $(GPPERFMON); $(MAKE) clean; fi
@if [ -d client/odbc/src/Makefile ]; then cd client/odbc/src; $(MAKE) clean; fi
@rm -rf $(BLD_TOP)/ext
@rm -f VERSION
@rm -f env.sh
distprep : $(ISCONFIG)
@cd $(BUILDDIR) && $(MAKE) distprep
#---------------------------------------------------------------------
# Regression tests
#---------------------------------------------------------------------
installcheck-good :
@if [ ! -f $(ISCONFIG) ]; then echo "not configured, cannot check"; exit 1; fi
@cd $(BUILDDIR)/src/test/regress && $(MAKE) installcheck-good
installcheck-ha :
@if [ ! -f $(ISCONFIG) ]; then echo "not configured, cannot check"; exit 1; fi
@cd $(BUILDDIR)/src/test/regress && $(MAKE) installcheck-ha
installcheck-parallel :
@if [ ! -f $(ISCONFIG) ]; then echo "not configured, cannot check"; exit 1; fi
@cd $(BUILDDIR)/src/test/regress && $(MAKE) installcheck-parallel
installcheck-olaptest :
@if [ ! -f $(ISCONFIG) ]; then echo "not configured, cannot check"; exit 1; fi
@cd $(BUILDDIR)/src/test/regress && $(MAKE) installcheck-olaptest
installcheck-pxf :
@if [ ! -f $(ISCONFIG) ]; then echo "not configured, cannot check"; exit 1; fi
@cd $(BUILDDIR)/src/test/regress && $(MAKE) installcheck-pxf
#---------------------------------------------------------------------
# More internal functions
#---------------------------------------------------------------------
version :
@if [ ! -f getversion ] ; then echo "getversion is not present, cannot create VERSION file"; exit 1; fi
@echo "Creating VERSION file"
@bash getversion > VERSION
gccVersionCheck :
@echo "Checking GCC version" ; \
$(BLD_CC) --version > /dev/null 2>&1 ; \
if [ $$? -ne 0 ] ; then \
echo "Error running $(BLD_CC) --version" ; \
$(BLD_CC) --version ; \
exit 1 ; \
fi
@$(BLD_CC) --version | head -n 1 | cut -d' ' -f3 | egrep '[0-3]\.[0-4]\.[0-1]' > /dev/null 2>&1 ; \
if [ $$? -eq 0 ] ; then \
echo "Error: GPDB must be compiled with GCC 3.4.2 or later." ; \
echo "Current GCC version:" ; \
$(BLD_CC) --version ; \
exit 1 ; \
fi
pygres: GPROOTDEP
#
# PyGreSQL-3.8.1 is no longer being built. It was replaced by PyGreSQL-4.0 in the gpMgmt/bin directory but
# not removed from the build and both have been being delivered. This finally brought down the OSX builds
# and, so, this 'pygres' target in the top-level Makefile has now been disabled. It has not been removed
# because the current build script will still try to build it. This is part of the logic that needs to be
# moved into here, the Makefiles, so that developers have complete control over and visibility into the
# contents of our product packages.
#
#rm -rf PyGreSQL-3.8.1
#cvs co ThirdPartyTools/src/PyGreSQL-3.8.1 > pygres-3.8.1-co.log 2>&1
#(cd ThirdPartyTools/src/PyGreSQL-3.8.1 && \
#python setup.py build --build-lib=libs && \
#if test -d $(DISTPATH)/lib ; then \
# cp -p libs/* $(DISTPATH)/lib ; \
#else \
# cp -p libs/* $(DEVPATH)/lib ; \
#fi)
# comment this out, for now, until we know if it affects more than just the authlibs target
#sol9_sparc_64_LD_LIBRARY_PATH=/usr/local/lib/sparcv9
#sol8_sparc_64_LD_LIBRARY_PATH=/usr/local/lib/sparcv9
#BLD_LD_LIBRARY_PATH:=$($(BLD_ARCH)_LD_LIBRARY_PATH):$(LD_LIBRARY_PATH)
#export LD_LIBRARY_PATH=$(BLD_LD_LIBRARY_PATH)
# comment this out, for now, until we know if it affects more than just the authlibs target
## put the default gcc in front of the /releng/bin/gcc to get 32-bit support
## DO NOT do this for 3.2.0.x releases (and maybe not for 3.2.x.x releases)
## where BLD_ARCH equals rhel5_x86_64
#ifeq "$(BLD_ARCH)" "rhel5_x86_32"
#tmpPATH=$(subst /releng/bin:,/usr/bin:/releng/bin:,$(PATH))
#export PATH:=$(tmpPATH)
#endif
authlibs:
@echo "# authlibs are now provided in the ext/ directory on this platform" > authlib_libpath_setup.sh
## ----------------------------------------------------------------------
ifeq "$(BLD_ARCH)" "rhel6_x86_64"
GPPKG_SOURCES = \
cdb-pg/src/pl/plperl \
$(NULL)
else
GPPKG_SOURCES = \
cdb-pg/contrib/pgcrypto \
cdb-pg/src/pl/pljava \
cdb-pg/src/pl/plr \
$(NULL)
#cdb-pg/contrib/postgis \
#cdb-pg/src/pl/plperl \
#cdb-pg/src/bin/pg_dump/cdb/ddboost \
#$(NULL)
endif
## ----------------------------------------------------------------------
gppkg:
ifeq "$(findstring gppkg,$(BLD_TARGETS))" ""
# ---- build and packaging of gppkgs are currently disabled
# ---- set BLD_TARGETS="gppkg" to enable them.
else
ifeq "$(findstring $(BLD_ARCH),$(GPPKG_PLATFORMS))" ""
@echo ""
@echo "The gppkg build and packaging processes are not supported"
@echo "on this platform: $(BLD_ARCH)"
@echo ""
else
for source in $(GPPKG_SOURCES); do \
$(MAKE) -C $${source}/package INSTLOC=$(INSTLOC); \
cp $${source}/package/*.gppkg $(GPPKGINSTLOC); \
done
# Delete pljava.so file from lib/postgresql if pljava gppkg is emabled
rm $(INSTLOC)/lib/postgresql/pljava.so
rm $(INSTLOC)/lib/postgresql/pljava.jar
endif
endif
INSTALLCHECK_GPPKG_SOURCES = \
cdb-pg/contrib/pgcrypto \
cdb-pg/contrib/postgis \
cdb-pg/src/pl/plperl \
cdb-pg/src/bin/pg_dump/cdb/ddboost \
$(NULL)
installcheck-gppkg:
touch installcheck-gppkg.log
ifeq "$(findstring gppkg,$(BLD_TARGETS))" ""
# ---- build and packaging of gppkgs are currently disabled
# ---- set BLD_TARGETS="gppkg" to enable them.
else
ifeq "$(findstring $(BLD_ARCH),$(GPPKG_PLATFORMS))" ""
@echo ""
@echo "The gppkg build and packaging processes are not supported"
@echo "on this platform: $(BLD_ARCH)"
@echo ""
else
for source in $(INSTALLCHECK_GPPKG_SOURCES); do \
$(MAKE) -C $${source}/package install; \
done
source $$GPHOME/greenplum_path.sh && gpstop -a && gpstart -a
for source in $(INSTALLCHECK_GPPKG_SOURCES); do \
source $$GPHOME/greenplum_path.sh && $(MAKE) -C $${source} installcheck >> installcheck-gppkg.log; \
done
endif
endif
## ----------------------------------------------------------------------
## Target to install GPDB udfs. Currently, this only works on Mac OSX
## and Linux
## ----------------------------------------------------------------------
create_orca_installer:
rm -rf $(BLD_TOP)/orca_tmp
mkdir -p $(BLD_TOP)/orca_tmp
for b in libnaucrates libgpdbcost libgpopt; do \
cp $(OPTIMIZER)/$$b/$(OBJDIR_DEFAULT)/$$b.$(LDSFX) $(BLD_TOP)/orca_tmp; \
done
cp $(LIBGPOS_LIBDIR)/libgpos.$(LDSFX) $(BLD_TOP)/orca_tmp
cp $(XERCES_LIBDIR)/libxerces-c-3.1.$(LDSFX) $(BLD_TOP)/orca_tmp
tar zcvf $(BLD_TOP)/orca.tgz -C $(BLD_TOP)/orca_tmp .
sed \
-e "s|%%BUILD_NUMBER%%|$${BUILD_NUMBER:=99999}|g" \
-e "s|%%PULSE_BUILD_TIMESTAMP%%|$${PULSE_BUILD_TIMESTAMP:=n/a}|g" \
-e "s|%%GPDB_VER%%|$(VERSION)|g" \
-e "s|%%OPTIMIZER_VER%%|$(OPTIMIZER_VER)|g" \
-e "s|%%LIBGPOS_VER%%|$(LIBGPOS_VER)|g" \
-e "s|%%XERCES_VER%%|$(XERCES_VER)|g" \
$(BLD_TOP)/releng/bin/orca_installer_hdr.sh > $(BLD_TOP)/releng/bin/orca_installer_hdr.sh.out
cat $(BLD_TOP)/releng/bin/orca_installer_hdr.sh.out $(BLD_TOP)/orca.tgz > $(BLD_TOP)/gpdb-orca-$(MPP_ARCH).sh
chmod a+x $(BLD_TOP)/gpdb-orca-$(MPP_ARCH).sh
rm -rf $(BLD_TOP)/orca_tmp
## ----------------------------------------------------------------------
.PHONY : unittest-check
unittest-check:
$(MAKE) -C cdb-pg/src/backend unittest-check
# run unittests of the hawq-hadoop project
$(MAKE) -C cdb-pg/contrib/hawq-hadoop unittest-check