phh@3492: # phh@3492: # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. phh@3492: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. phh@3492: # phh@3492: # This code is free software; you can redistribute it and/or modify it phh@3492: # under the terms of the GNU General Public License version 2 only, as phh@3492: # published by the Free Software Foundation. phh@3492: # phh@3492: # This code is distributed in the hope that it will be useful, but WITHOUT phh@3492: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or phh@3492: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License phh@3492: # version 2 for more details (a copy is included in the LICENSE file that phh@3492: # accompanied this code). phh@3492: # phh@3492: # You should have received a copy of the GNU General Public License version phh@3492: # 2 along with this work; if not, write to the Free Software Foundation, phh@3492: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. phh@3492: # phh@3492: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA phh@3492: # or visit www.oracle.com if you need additional information or have any phh@3492: # questions. phh@3492: # phh@3492: # phh@3492: phh@3492: # macosx universal builds phh@3492: universal_product: phh@3492: $(MAKE) MACOSX_UNIVERSAL=true all_product_universal phh@3492: universal_fastdebug: phh@3492: $(MAKE) MACOSX_UNIVERSAL=true all_fastdebug_universal phh@3492: universal_debug: phh@3492: $(MAKE) MACOSX_UNIVERSAL=true all_debug_universal phh@3492: phh@3492: phh@3492: # Universal builds include 1 or more architectures in a single binary phh@3492: all_product_universal: phh@3492: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_PRODUCT_TARGETS) phh@3492: $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS) phh@3492: $(QUIETLY) $(MAKE) EXPORT_SUBDIR= universalize phh@3492: all_fastdebug_universal: phh@3492: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_FASTDEBUG_TARGETS) phh@3492: $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS) phh@3492: $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/fastdebug universalize phh@3492: all_debug_universal: phh@3492: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_DEBUG_TARGETS) phh@3492: $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS) phh@3492: $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/debug universalize phh@3492: phh@3492: phh@3492: # Consolidate architecture builds into a single Universal binary phh@3492: universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST) phh@3492: $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} phh@3492: phh@3492: phh@3492: # Package built libraries in a universal binary phh@3492: $(UNIVERSAL_LIPO_LIST): phh@3492: BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \ phh@3492: if [ -n "$${BUILT_LIPO_FILES}" ]; then \ phh@3492: $(MKDIR) -p $(shell dirname $@); \ phh@3492: lipo -create -output $@ $${BUILT_LIPO_FILES}; \ phh@3492: fi phh@3492: phh@3492: phh@3492: # Copy built non-universal binaries in place phh@3492: $(UNIVERSAL_COPY_LIST): phh@3512: BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \ phh@3512: if [ -n "$${BUILT_COPY_FILES}" ]; then \ phh@3512: for i in $${BUILT_COPY_FILES}; do \ phh@3512: if [ -f $${i} ]; then \ phh@3512: $(MKDIR) -p $(shell dirname $@); \ phh@3512: $(CP) $${i} $@; \ phh@3512: fi; \ phh@3512: done; \ phh@3492: fi phh@3492: phh@3492: phh@3492: # Replace arch specific binaries with universal binaries phh@3492: export_universal: phh@3492: $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} phh@3492: $(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64} phh@3492: $(RM) $(JDK_IMAGE_DIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) phh@3492: ($(CD) $(EXPORT_PATH) && \ phh@3492: $(TAR) -cf - *) | \ phh@3492: ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -) phh@3492: phh@3492: phh@3492: # Overlay universal binaries phh@3492: copy_universal: phh@3492: $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64} phh@3492: $(RM) $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) phh@3492: ($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \ phh@3492: $(TAR) -cf - *) | \ phh@3492: ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -) phh@3492: phh@3492: phh@3492: # Additional processing for universal builds phh@3492: export_product_jdk:: phh@3492: $(MAKE) EXPORT_SUBDIR= export_universal phh@3492: export_optimized_jdk:: phh@3492: $(MAKE) EXPORT_SUBDIR= export_universal phh@3492: export_fastdebug_jdk:: phh@3492: $(MAKE) EXPORT_SUBDIR=/fastdebug export_universal phh@3492: export_debug_jdk:: phh@3492: $(MAKE) EXPORT_SUBDIR=/debug export_universal phh@3492: copy_product_jdk:: phh@3492: $(MAKE) COPY_SUBDIR= copy_universal phh@3492: copy_fastdebug_jdk:: phh@3492: $(MAKE) COPY_SUBDIR=/fastdebug copy_universal phh@3492: copy_debug_jdk:: phh@3492: $(MAKE) COPY_SUBDIR=/debug copy_universal phh@3492: phh@3492: .PHONY: universal_product universal_fastdebug universal_debug \ phh@3492: all_product_universal all_fastdebug_universal all_debug_universal \ phh@3492: universalize export_universal copy_universal