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