Makefile revision 402
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# CDDL HEADER START
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# The contents of this file are subject to the terms of the
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Common Development and Distribution License (the "License").
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# You may not use this file except in compliance with the License.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# See the License for the specific language governing permissions
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# and limitations under the License.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# When distributing Covered Code, include this CDDL HEADER in each
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# If applicable, add the following below this CDDL HEADER, with the
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# fields enclosed by brackets "[]" replaced with your own identifying
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# information: Portions Copyright [yyyy] [name of copyright owner]
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# CDDL HEADER END
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCOMPONENT_PROJECT_URL= http://stdcxx.apache.org/
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCOMPONENT_ARCHIVE_HASH= sha1:38efa30958222b2733f22098b3db09161d2e6c8c
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCOMPONENT_ARCHIVE_URL= http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontISA_PATCH_DIR_32 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontISA_PATCH_DIR_64 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH64)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH).patch
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH64).patch \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH64).patch
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# Please see the README file in this directory for a detailed explanation
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# about these flags, what they do, and why we need them.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontFLAGS_sparc = -m32 -xarch=sparcvis -xmemalign=8i
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontFLAGS_sparcv9 = -m64 -xarch=sparcvis -xmemalign=16i
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_sparc += -xregs=no%appl -xbuiltin=%none -xO4 $(PICFLAG)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_i386 = -Xc -features=extinl -xregs=no%frameptr
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_i386 += -xO3 -xbuiltin=%none $(PICFLAG)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_32 = $(FLAGS_$(MACH)) $(CFLAGS_$(MACH))
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_64 = $(FLAGS_$(MACH64)) $(CFLAGS_$(MACH))
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_sparc = -xvis=yes -xregs=no%appl -xO4
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_i386 = -xregs=no%frameptr -xO3 -xbuiltin=%none $(PICFLAG)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_GENERIC += -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_GENERIC += -D_XPG6 -D_XOPEN_SOURCE=600 -D_POSIX_PTHREAD_SEMANTICS
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_GENERIC += -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCFLAGS_GENERIC += -D_STRICT_STDC -D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC = -library=Cstd -library=Crun -norunpath
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += -Qoption ccfe ++boolflag:sunwcch=false
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += -Qoption ccfe +d2,-xgeninl=system
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += -Qoption ccfe -expand=10000
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += -features=except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += -D_POSIX_PTHREAD_SEMANTICS -s
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS_GENERIC += +w2 -errtags -erroff=hidef
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCXXFLAGS = $(CXXFLAGS_$(BITS)) $(CXXFLAGS_$(MACH)) $(CXXFLAGS_GENERIC)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# -mt will automatically pass -lthread unless we pass -lpthread
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# on link line. -lthread causes regressions. see man CC(1) and -mt.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# -lumem must be passed before -lc.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontLDFLAGS = -lpthread -lumem -lm -lc -s -z ignore
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# We cannot have -B direct
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontLD_OPTIONS = -M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.noexdata
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontLD_OPTIONS += -lpthread -lumem -lm -lc -s -z ignore
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# If I name it NLSPATH, gmake insists on getting its value from the
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# running environment. Also, it all has to be on one line. += prepends
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont# a whitespace.
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontBUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCONFIGURE_ENV += LD="$(CXX) $(CXXFLAGS) $(LDFLAGS)"
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCONFIGURE_OPTIONS += -builddir=$(LOCAL_BUILDDIR)
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontCOMPONENT_BUILD_ENV += NLSPATH="$(BUILD_NLSPATH)"
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-32
7768b049c0b39662baca604ec32b32c6480f8dc6Francis DupontPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-64
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont list='$(ISA_PATCHES)' ; for f in $$list ; do \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont list1='$(ISA_PATCHES)' ; for f in $$list1 ; do \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(GPATCH) $(GPATCH_FLAGS) <$(COMPONENT_DIR)/$$f ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont find ./$(COMPONENT_SRC) -type f -name "*.~1~" \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont -exec chmod 0644 {} \; > /dev/null 2>&1 )
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CP) -p $(COMPONENT_DIR)/Solaris/fix_nls_symlinks.sh . ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(GCP) -rpd $(COMPONENT_SRC) $(COMPONENT_SRC)-$(BITS) ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupontinstall: $(BUILD_DIR_32)/.built $(BUILD_DIR_64)/.built
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CP) $(COMPONENT_DIR)/Solaris/install.sh $(COMPONENT_DIR)/
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont test -d $(BUILD_DIR_32) || echo "$(BUILD_DIR_32) does not exist!"
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont test -d $(BUILD_DIR_64) || echo "$(BUILD_DIR_64) does not exist!"
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CP) -p $(COMPONENT_DIR)/Solaris/prep_build_area.sh \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CHMOD) 0755 $(COMPONENT_DIR)/prep_build_area.sh
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m32 \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m64 \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(COMPONENT_DIR)/runtests-$(MACH64).out 2>&1 )
7768b049c0b39662baca604ec32b32c6480f8dc6Francis Dupont $(RM) -r $(COMPONENT_SRC) $(COMPONENT_SRC)-32 $(COMPONENT_SRC)-64