Makefile revision 402
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User# CDDL HEADER START
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License (the "License").
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You may not use this file except in compliance with the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# When distributing Covered Code, include this CDDL HEADER in each
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If applicable, add the following below this CDDL HEADER, with the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fields enclosed by brackets "[]" replaced with your own identifying
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_ARCHIVE_HASH= sha1:38efa30958222b2733f22098b3db09161d2e6c8c
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCOMPONENT_ARCHIVE_URL= http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinISA_PATCH_DIR_32 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinISA_PATCH_DIR_64 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH64)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH).patch \
fc74b733bf679e1b3fb1599e32d445dffe325208Tinderbox User $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH).patch
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH64).patch \
fc74b733bf679e1b3fb1599e32d445dffe325208Tinderbox User $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH64).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH64).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH64).patch \
fc74b733bf679e1b3fb1599e32d445dffe325208Tinderbox User $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH64).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH64).patch \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH64).patch \
fc74b733bf679e1b3fb1599e32d445dffe325208Tinderbox User $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH64).patch
fc74b733bf679e1b3fb1599e32d445dffe325208Tinderbox User# Please see the README file in this directory for a detailed explanation
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# about these flags, what they do, and why we need them.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinFLAGS_sparcv9 = -m64 -xarch=sparcvis -xmemalign=16i
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic UpdaterCFLAGS_sparc = -Xc -features=extinl -xvis=yes
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCFLAGS_sparc += -xregs=no%appl -xbuiltin=%none -xO4 $(PICFLAG)
a1ad6695ed6f988406cf155aa26376f84f73bcb9Automatic UpdaterCFLAGS_i386 = -Xc -features=extinl -xregs=no%frameptr
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic UpdaterCFLAGS_i386 += -xO3 -xbuiltin=%none $(PICFLAG)
2895f101b5585a19015ac2c2c1e1812ac467fa12Automatic UpdaterCFLAGS_32 = $(FLAGS_$(MACH)) $(CFLAGS_$(MACH))
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCFLAGS_64 = $(FLAGS_$(MACH64)) $(CFLAGS_$(MACH))
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCXXFLAGS_i386 = -xregs=no%frameptr -xO3 -xbuiltin=%none $(PICFLAG)
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCFLAGS_GENERIC += -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS_GENERIC += -D_XPG6 -D_XOPEN_SOURCE=600 -D_POSIX_PTHREAD_SEMANTICS
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCFLAGS_GENERIC += -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCFLAGS_GENERIC += -D_STRICT_STDC -D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCXXFLAGS_GENERIC = -library=Cstd -library=Crun -norunpath
3e80f25d33be14eaa4aca8b487d68808fa42a797Tinderbox UserCXXFLAGS_GENERIC += -Qoption ccfe ++boolflag:sunwcch=false
7208386cd37a2092c70eddf80cf29519b16c4c80Mark AndrewsCXXFLAGS_GENERIC += -Qoption ccfe +d2,-xgeninl=system
507151045be68c671ffd4e2f37e17cdfa0376fc4Automatic UpdaterCXXFLAGS_GENERIC += -features=except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCXXFLAGS_GENERIC += -D_POSIX_PTHREAD_SEMANTICS -s
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsCXXFLAGS = $(CXXFLAGS_$(BITS)) $(CXXFLAGS_$(MACH)) $(CXXFLAGS_GENERIC)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# -mt will automatically pass -lthread unless we pass -lpthread
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# on link line. -lthread causes regressions. see man CC(1) and -mt.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# -lumem must be passed before -lc.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# We cannot have -B direct
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinLD_OPTIONS = -M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.noexdata
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinLD_OPTIONS += -lpthread -lumem -lm -lc -s -z ignore
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If I name it NLSPATH, gmake insists on getting its value from the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# running environment. Also, it all has to be on one line. += prepends
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# a whitespace.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinBUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinCONFIGURE_ENV += LD="$(CXX) $(CXXFLAGS) $(LDFLAGS)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMPONENT_BUILD_ENV += NLSPATH="$(BUILD_NLSPATH)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-32
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein list1='$(ISA_PATCHES)' ; for f in $$list1 ; do \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater $(GPATCH) $(GPATCH_FLAGS) <$(COMPONENT_DIR)/$$f ; \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater find ./$(COMPONENT_SRC) -type f -name "*.~1~" \
afb33f777af856f8c3382604a7a8ffdfe2b512c5Automatic Updater -exec chmod 0644 {} \; > /dev/null 2>&1 )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(CP) -p $(COMPONENT_DIR)/Solaris/fix_nls_symlinks.sh . ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(GCP) -rpd $(COMPONENT_SRC) $(COMPONENT_SRC)-$(BITS) ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininstall: $(BUILD_DIR_32)/.built $(BUILD_DIR_64)/.built
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(CP) $(COMPONENT_DIR)/Solaris/install.sh $(COMPONENT_DIR)/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein test -d $(BUILD_DIR_32) || echo "$(BUILD_DIR_32) does not exist!"
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews test -d $(BUILD_DIR_64) || echo "$(BUILD_DIR_64) does not exist!"
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(CP) -p $(COMPONENT_DIR)/Solaris/prep_build_area.sh \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(CHMOD) 0755 $(COMPONENT_DIR)/prep_build_area.sh
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m32 \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m64 \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
ceeb18e6907a10547859faa340ecad83bedae90cMark Andrews $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(RM) -r $(COMPONENT_SRC) $(COMPONENT_SRC)-32 $(COMPONENT_SRC)-64