| # Set the shell |
| SHELL=/bin/bash |
| |
| # Determine the default target architecture on this machine, if override not set |
| ifeq "$(BLD_ARCH)" "" |
| export BLD_ARCH:=$(shell $(BLD_TOP)/releng/set_bld_arch.sh) |
| endif |
| |
| # include thirdparty infrastructure which depends on WHERE_THE... |
| BLD_WHERE_THE_LIBRARY_THINGS_ARE=LD_LIBRARY_PATH |
| include $(BLD_TOP)/Makefile.thirdparty |
| |
| # get current working directory with symlinks maintained |
| HERE:=$(shell pwd -L) |
| |
| # override MPP_ARCH values on BLD_ARCH's not native to the build server (e.g., 32-bit builds on 64-bit OSes) |
| ifneq "$($(BLD_ARCH)_MPP_ARCH)" "" |
| export MPP_ARCH=$($(BLD_ARCH)_MPP_ARCH) |
| endif |
| |
| |
| ifneq "$($(BLD_ARCH)_CXX)" "" |
| export CXX=$($(BLD_ARCH)_CXX) |
| endif |
| |
| export BLD_PATH_FIXED=true |
| export BLD_LD_LIBRARY_PATH_FIXED=true |
| |
| ## |
| ## Control if PATH and LD_LIBRARY_PATH|DYLD_LIBRARY_PATH values are displayed. |
| ## |
| |
| ifeq "$(ENABLE_MAKE_WARNING)" "true" |
| $(warning PATH=$(PATH)) |
| $(warning $(BLD_WHERE_THE_LIBRARY_THINGS_ARE)=$($(BLD_WHERE_THE_LIBRARY_THINGS_ARE))) |
| endif |
| |
| # disable our gcc wrapper |
| export NO_M64=1 |
| |
| # 32-bit/64-bit compiler/linker flag settings |
| rhel6_x86_64_BLD_CFLAGS=-m64 -gdwarf-2 -gstrict-dwarf |
| rhel7_x86_64_BLD_CFLAGS=-m64 |
| BLD_CFLAGS=$($(BLD_ARCH)_BLD_CFLAGS) |
| BLD_LDFLAGS=$($(BLD_ARCH)_BLD_LDFLAGS) |
| BLD_BITS:=$(strip $(findstring 32,$(BLD_ARCH)) $(findstring 64,$(BLD_ARCH))) |
| |
| ifeq "$(BLD_ARCH)" "" |
| $(error Unable to determine value for BLD_ARCH! You may set this on the command line.) |
| endif |
| |
| ifeq "$(BLD_BITS)" "" |
| $(error Unable to determine value for BLD_BITS! You may set this on the command line.) |
| endif |
| |
| GREP=grep |
| TAR=tar |
| AWK=awk |
| |
| # Functions for use in this and including makefiles |
| |
| # function: check_pipe_for_errors |
| # purpose: detect cases where a member of a pipe sequence fails; make normally only checks the last command in the pipe |
| ifeq "$(origin check_pipe_for_errors)" "undefined" |
| check_pipe_for_errors=; if [ x`echo $${PIPESTATUS[*]} | sed -e s,0,,g | sed -e s,\ ,,g` != x ]; then echo "`date` -- ERROR: failure detected in piped operation"; exit 1; fi |
| endif |