Makefile revision 814
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# CDDL HEADER START
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# The contents of this file are subject to the terms of the
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Common Development and Distribution License (the "License").
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# You may not use this file except in compliance with the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# or http://www.opensolaris.org/os/licensing.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# See the License for the specific language governing permissions
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# and limitations under the License.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# When distributing Covered Code, include this CDDL HEADER in each
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
f8f37672a57524560fbdde52484e6ae3de1c3354Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# we really need to use studio so we don't like that
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# parfait is g++ in disguise
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_PROJECT_URL= http://stdcxx.apache.org/
bac2ed6ec3fbb5420e6ce69dd1218745d4e02b1eMark AndrewsCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_PROJECT_URL= http://stdcxx.apache.org/
ed178efa9ab8f813538fce4ff603b81ded9f1799Mark AndrewsCOMPONENT_ARCHIVE_HASH= sha1:38efa30958222b2733f22098b3db09161d2e6c8c
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCOMPONENT_ARCHIVE_URL= http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE)
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsISA_PATCH_DIR_32 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH)
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsISA_PATCH_DIR_64 = $(WS_TOP)/components/stdcxx/isa_patches/$(MACH64)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH).patch \
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH).patch \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH).patch \
26a77b80bb7ee886c6fa704348d5e80a011d8811Mark Andrews $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH).patch \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH).patch \
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH).patch \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH).patch \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH).patch
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(ISA_PATCH_DIR)/1034-sunpro.config.$(MACH64).patch \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(ISA_PATCH_DIR)/1035-GNUmakefile.tst.$(MACH64).patch \
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews $(ISA_PATCH_DIR)/1036-GNUmakefile.rwt.$(MACH64).patch \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ISA_PATCH_DIR)/1037-GNUmakefile.lib.$(MACH64).patch \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(ISA_PATCH_DIR)/1038-GNUmakefile.ph.$(MACH64).patch \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(ISA_PATCH_DIR)/1039-GNUmakefile.exm.$(MACH64).patch \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(ISA_PATCH_DIR)/1040-GNUmakefile.cfg.$(MACH64).patch \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(ISA_PATCH_DIR)/1041-GNUmakefile.bin.$(MACH64).patch
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonTOPDIR = $(COMPONENT_DIR)/$(COMPONENT_SRC)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Please see the README file in this directory for a detailed explanation
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews# about these flags, what they do, and why we need them.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark AndrewsFLAGS_sparc = -m32 -xarch=sparcvis -xmemalign=8i
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark AndrewsFLAGS_sparcv9 = -m64 -xarch=sparcvis -xmemalign=16i
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCFLAGS_sparc += -Qoption cg -xregs=no%appl -xbuiltin=%none -xO4 $(PICFLAG)
c25080dc50542213058c240226c9f342186e6285Mark AndrewsCFLAGS_i386 = -Xc -features=extinl -xregs=no%frameptr
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCFLAGS_64 = $(FLAGS_$(MACH64)) $(CFLAGS_$(MACH))
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCXXFLAGS_i386 = -xregs=no%frameptr -xO3 -xbuiltin=%none $(PICFLAG)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCFLAGS_GENERIC += -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark AndrewsCFLAGS_GENERIC += -D_XPG6 -D_XOPEN_SOURCE=600 -D_POSIX_PTHREAD_SEMANTICS
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCFLAGS_GENERIC += -D_POSIX_C_SOURCE=200112L -D__XOPEN_OR_POSIX
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCFLAGS_GENERIC += -D_STRICT_STDC -D_STRICT_STDC__ -D_STDC_C99 -D_ISOC99_SOURCE
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCXXFLAGS_GENERIC = -library=Cstd -library=Crun -norunpath
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCXXFLAGS_GENERIC += -Qoption ccfe ++boolflag:sunwcch=false
c25080dc50542213058c240226c9f342186e6285Mark AndrewsCXXFLAGS_GENERIC += -Qoption ccfe +d2,-xgeninl=system
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsCXXFLAGS_GENERIC += -features=except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
c25080dc50542213058c240226c9f342186e6285Mark AndrewsCXXFLAGS_GENERIC += -D_POSIX_PTHREAD_SEMANTICS -s
c25080dc50542213058c240226c9f342186e6285Mark AndrewsCXXFLAGS = $(CXXFLAGS_$(BITS)) $(CXXFLAGS_$(MACH)) $(CXXFLAGS_GENERIC)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# -mt will automatically pass -lthread unless we pass -lpthread
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark Andrews# on link line. -lthread causes regressions. see man CC(1) and -mt.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# -lumem must be passed before -lc.
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# We cannot have -B direct
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonLD_OPTIONS = -M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.noexdata
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsLD_OPTIONS += -lpthread -lumem -lm -lc -s -z ignore
7c40ffd67bd1e73907f83a79a6ff8c635f4a4a74Mark Andrews# If I name it NLSPATH, gmake insists on getting its value from the
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# running environment. Also, it all has to be on one line. += prepends
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# a whitespace.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsBUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsCONFIGURE_ENV += LD="$(CXX) $(CXXFLAGS) $(LDFLAGS)"
5752b9e296f14034f103149f18188770c2cc5239Mark AndrewsCONFIGURE_OPTIONS += -builddir=$(LOCAL_BUILDDIR)
e076d0c88be69de7c190ab924d095e69d2e11f7aAndreas GustafssonCOMPONENT_BUILD_ENV += NLSPATH="$(BUILD_NLSPATH)"
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-32
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark AndrewsPKG_PROTO_DIRS += $(COMPONENT_DIR)/$(COMPONENT_SRC)-64
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ( if test -f $(TOPDIR)/.unpacked ; then \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington list='$(ISA_PATCHES)' ; for f in $$list ; do \
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews else $(UNPACK) $(UNPACK_ARGS) $(COMPONENT_ARCHIVE) ; \
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews list1='$(ISA_PATCHES)' ; for f in $$list1 ; do \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington list2='$(PATCHES)' ; for f in $$list2 ; do \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(GPATCH) $(GPATCH_FLAGS) <$(COMPONENT_DIR)/$$f ; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington find ./$(COMPONENT_SRC) -type f -name "*.~1~" \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington -exec chmod 0644 {} \; > /dev/null 2>&1 )
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(CP) -p $(COMPONENT_DIR)/Solaris/fix_nls_symlinks.sh . ; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(GCP) -rpd $(COMPONENT_SRC) $(COMPONENT_SRC)-$(BITS) ; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtoninstall: $(BUILD_DIR_32)/.built $(BUILD_DIR_64)/.built
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(CP) $(COMPONENT_DIR)/Solaris/install.sh $(COMPONENT_DIR)/
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington test -d $(BUILD_DIR_32) || echo "$(BUILD_DIR_32) does not exist!"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington test -d $(BUILD_DIR_64) || echo "$(BUILD_DIR_64) does not exist!"
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(CP) -p $(COMPONENT_DIR)/Solaris/prep_build_area.sh \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(CHMOD) 0755 $(COMPONENT_DIR)/prep_build_area.sh
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m32 \
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington $(SHELL) $(COMPONENT_DIR)/prep_build_area.sh -m64 \
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(CP) -p $(COMPONENT_DIR)/Solaris/run_tests.sh . ; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(COMPONENT_DIR)/runtests-$(MACH64).out 2>&1 )
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews $(RM) -r $(COMPONENT_SRC) $(COMPONENT_SRC)-32 $(COMPONENT_SRC)-64