make/bsd/makefiles/universal.gmk

Mon, 06 Feb 2012 14:02:51 -0500

author
phh
date
Mon, 06 Feb 2012 14:02:51 -0500
changeset 3512
64b46f975ab8
parent 3492
481a9443f721
child 3877
74533f63b116
permissions
-rw-r--r--

7142616: MAC: Honor ALT_EXPORT_PATH overrides from JDK control builds
Summary: Fix EXPORT_PATH overrides on Mac OS X and only change default.
Reviewed-by: phh, dcubed
Contributed-by: james.melvin@oracle.com

phh@3492 1 #
phh@3492 2 # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
phh@3492 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
phh@3492 4 #
phh@3492 5 # This code is free software; you can redistribute it and/or modify it
phh@3492 6 # under the terms of the GNU General Public License version 2 only, as
phh@3492 7 # published by the Free Software Foundation.
phh@3492 8 #
phh@3492 9 # This code is distributed in the hope that it will be useful, but WITHOUT
phh@3492 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
phh@3492 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
phh@3492 12 # version 2 for more details (a copy is included in the LICENSE file that
phh@3492 13 # accompanied this code).
phh@3492 14 #
phh@3492 15 # You should have received a copy of the GNU General Public License version
phh@3492 16 # 2 along with this work; if not, write to the Free Software Foundation,
phh@3492 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
phh@3492 18 #
phh@3492 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
phh@3492 20 # or visit www.oracle.com if you need additional information or have any
phh@3492 21 # questions.
phh@3492 22 #
phh@3492 23 #
phh@3492 24
phh@3492 25 # macosx universal builds
phh@3492 26 universal_product:
phh@3492 27 $(MAKE) MACOSX_UNIVERSAL=true all_product_universal
phh@3492 28 universal_fastdebug:
phh@3492 29 $(MAKE) MACOSX_UNIVERSAL=true all_fastdebug_universal
phh@3492 30 universal_debug:
phh@3492 31 $(MAKE) MACOSX_UNIVERSAL=true all_debug_universal
phh@3492 32
phh@3492 33
phh@3492 34 # Universal builds include 1 or more architectures in a single binary
phh@3492 35 all_product_universal:
phh@3492 36 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_PRODUCT_TARGETS)
phh@3492 37 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS)
phh@3492 38 $(QUIETLY) $(MAKE) EXPORT_SUBDIR= universalize
phh@3492 39 all_fastdebug_universal:
phh@3492 40 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_FASTDEBUG_TARGETS)
phh@3492 41 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS)
phh@3492 42 $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/fastdebug universalize
phh@3492 43 all_debug_universal:
phh@3492 44 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_DEBUG_TARGETS)
phh@3492 45 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS)
phh@3492 46 $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/debug universalize
phh@3492 47
phh@3492 48
phh@3492 49 # Consolidate architecture builds into a single Universal binary
phh@3492 50 universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST)
phh@3492 51 $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64}
phh@3492 52
phh@3492 53
phh@3492 54 # Package built libraries in a universal binary
phh@3492 55 $(UNIVERSAL_LIPO_LIST):
phh@3492 56 BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \
phh@3492 57 if [ -n "$${BUILT_LIPO_FILES}" ]; then \
phh@3492 58 $(MKDIR) -p $(shell dirname $@); \
phh@3492 59 lipo -create -output $@ $${BUILT_LIPO_FILES}; \
phh@3492 60 fi
phh@3492 61
phh@3492 62
phh@3492 63 # Copy built non-universal binaries in place
phh@3492 64 $(UNIVERSAL_COPY_LIST):
phh@3512 65 BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \
phh@3512 66 if [ -n "$${BUILT_COPY_FILES}" ]; then \
phh@3512 67 for i in $${BUILT_COPY_FILES}; do \
phh@3512 68 if [ -f $${i} ]; then \
phh@3512 69 $(MKDIR) -p $(shell dirname $@); \
phh@3512 70 $(CP) $${i} $@; \
phh@3512 71 fi; \
phh@3512 72 done; \
phh@3492 73 fi
phh@3492 74
phh@3492 75
phh@3492 76 # Replace arch specific binaries with universal binaries
phh@3492 77 export_universal:
phh@3492 78 $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64}
phh@3492 79 $(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64}
phh@3492 80 $(RM) $(JDK_IMAGE_DIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
phh@3492 81 ($(CD) $(EXPORT_PATH) && \
phh@3492 82 $(TAR) -cf - *) | \
phh@3492 83 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
phh@3492 84
phh@3492 85
phh@3492 86 # Overlay universal binaries
phh@3492 87 copy_universal:
phh@3492 88 $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64}
phh@3492 89 $(RM) $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
phh@3492 90 ($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
phh@3492 91 $(TAR) -cf - *) | \
phh@3492 92 ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
phh@3492 93
phh@3492 94
phh@3492 95 # Additional processing for universal builds
phh@3492 96 export_product_jdk::
phh@3492 97 $(MAKE) EXPORT_SUBDIR= export_universal
phh@3492 98 export_optimized_jdk::
phh@3492 99 $(MAKE) EXPORT_SUBDIR= export_universal
phh@3492 100 export_fastdebug_jdk::
phh@3492 101 $(MAKE) EXPORT_SUBDIR=/fastdebug export_universal
phh@3492 102 export_debug_jdk::
phh@3492 103 $(MAKE) EXPORT_SUBDIR=/debug export_universal
phh@3492 104 copy_product_jdk::
phh@3492 105 $(MAKE) COPY_SUBDIR= copy_universal
phh@3492 106 copy_fastdebug_jdk::
phh@3492 107 $(MAKE) COPY_SUBDIR=/fastdebug copy_universal
phh@3492 108 copy_debug_jdk::
phh@3492 109 $(MAKE) COPY_SUBDIR=/debug copy_universal
phh@3492 110
phh@3492 111 .PHONY: universal_product universal_fastdebug universal_debug \
phh@3492 112 all_product_universal all_fastdebug_universal all_debug_universal \
phh@3492 113 universalize export_universal copy_universal

mercurial