hotspot/make/bsd/makefiles/universal.gmk
author alanb
Tue, 03 May 2016 09:11:31 +0100
changeset 37827 09fa0c82a5f7
parent 31365 dc7a49d816b8
permissions -rw-r--r--
8154956: Module system implementation refresh (4/2016) Reviewed-by: alanb, mchung, chegar, redestad Contributed-by: alan.bateman@oracle.com, erik.joelsson@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
#
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
     2
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
11629
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.
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    22
#
11629
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
26577
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    28
universal_optimized:
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    29
	$(MAKE) MACOSX_UNIVERSAL=true all_optimized_universal
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    30
universal_fastdebug:
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    31
	$(MAKE) MACOSX_UNIVERSAL=true all_fastdebug_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    32
universal_debug:
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    33
	$(MAKE) MACOSX_UNIVERSAL=true all_debug_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    34
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    35
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    36
# 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
    37
all_product_universal:
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    38
#	$(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
    39
	$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS)
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    40
	$(QUIETLY) $(MAKE) BUILD_FLAVOR=product EXPORT_SUBDIR= universalize
26577
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    41
all_optimized_universal:
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    42
#	$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_OPTIMIZED_TARGETS)
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    43
	$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_OPTIMIZED_TARGETS)
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
    44
	$(QUIETLY) $(MAKE) BUILD_FLAVOR=optimized EXPORT_SUBDIR=/optimized universalize
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    45
all_fastdebug_universal:
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    46
#	$(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
    47
	$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS)
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    48
	$(QUIETLY) $(MAKE) BUILD_FLAVOR=fastdebug EXPORT_SUBDIR=/fastdebug universalize
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    49
all_debug_universal:
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    50
#	$(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
    51
	$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS)
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    52
	$(QUIETLY) $(MAKE) BUILD_FLAVOR=debug EXPORT_SUBDIR=/debug universalize
11629
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
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    55
# Consolidate architecture builds into a single Universal binary
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    56
universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST)
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    57
	$(RM) -r $(EXPORT_PATH)/lib/{i386,amd64}
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    58
31365
dc7a49d816b8 8087195: Support building hotspot with devkits on Macosx
erikj
parents: 30113
diff changeset
    59
LIPO ?= lipo
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    60
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    61
# Package built libraries in a universal binary
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    62
$(UNIVERSAL_LIPO_LIST):
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    63
	BUILT_LIPO_FILES="`find $(EXPORT_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_LIB_DIR)/,,$@) 2>/dev/null`" || test $$? = "1"; \
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    64
	if [ -n "$${BUILT_LIPO_FILES}" ]; then \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    65
	  $(MKDIR) -p $(shell dirname $@); \
31365
dc7a49d816b8 8087195: Support building hotspot with devkits on Macosx
erikj
parents: 30113
diff changeset
    66
	  $(LIPO) -create -output $@ $${BUILT_LIPO_FILES}; \
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    67
	fi
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    68
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    69
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    70
# Copy built non-universal binaries in place
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    71
# - copies directories; including empty dirs
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    72
# - copies files, symlinks, other non-directory files
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    73
$(UNIVERSAL_COPY_LIST):
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    74
	BUILT_COPY_FILES="`find $(EXPORT_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_LIB_DIR)/,,$@) -prune 2>/dev/null`" || test $$? = "1"; \
11649
04e30cc559a9 7142616: MAC: Honor ALT_EXPORT_PATH overrides from JDK control builds
phh
parents: 11629
diff changeset
    75
	if [ -n "$${BUILT_COPY_FILES}" ]; then \
04e30cc559a9 7142616: MAC: Honor ALT_EXPORT_PATH overrides from JDK control builds
phh
parents: 11629
diff changeset
    76
	  for i in $${BUILT_COPY_FILES}; do \
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    77
	    $(MKDIR) -p $(shell dirname $@); \
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 13099
diff changeset
    78
	    $(CP) -R $${i} $@; \
11649
04e30cc559a9 7142616: MAC: Honor ALT_EXPORT_PATH overrides from JDK control builds
phh
parents: 11629
diff changeset
    79
	  done; \
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    80
	fi
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
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    83
# Replace arch specific binaries with universal binaries
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    84
# Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
24836
53a8d1882787 8038132: jprt bundles have libjsig.dylib in different place on OSX
rdurbin
parents: 20686
diff changeset
    85
# That symbolic link belongs to the 'jdk' build.
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    86
export_universal:
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    87
	$(RM) -r $(EXPORT_PATH)/lib/{i386,amd64}
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    88
	$(RM) -r $(JDK_IMAGE_DIR)/lib/{i386,amd64}
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    89
	($(CD) $(EXPORT_PATH) && \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    90
	  $(TAR) -cf - *) | \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    91
	  ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    92
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    93
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    94
# Overlay universal binaries
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    95
# Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
24836
53a8d1882787 8038132: jprt bundles have libjsig.dylib in different place on OSX
rdurbin
parents: 20686
diff changeset
    96
# That symbolic link belongs to the 'jdk' build.
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    97
copy_universal:
30113
3f6beb804b02 8075725: Remove /jre subdir in hotspot dist dir
erikj
parents: 28613
diff changeset
    98
	$(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/lib/{i386,amd64}
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
    99
	($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   100
	  $(TAR) -cf - *) | \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   101
	  ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   102
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   103
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   104
# Additional processing for universal builds
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   105
export_product_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   106
	$(MAKE) EXPORT_SUBDIR=           export_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   107
export_optimized_jdk::
26577
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
   108
	$(MAKE) EXPORT_SUBDIR=/optimized export_universal
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   109
export_fastdebug_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   110
	$(MAKE) EXPORT_SUBDIR=/fastdebug export_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   111
export_debug_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   112
	$(MAKE) EXPORT_SUBDIR=/debug     export_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   113
copy_product_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   114
	$(MAKE) COPY_SUBDIR=             copy_universal
26577
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
   115
copy_optimized_jdk::
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
   116
	$(MAKE) COPY_SUBDIR=/optimized   copy_universal
11629
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   117
copy_fastdebug_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   118
	$(MAKE) COPY_SUBDIR=/fastdebug   copy_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   119
copy_debug_jdk::
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   120
	$(MAKE) COPY_SUBDIR=/debug       copy_universal
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   121
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   122
.PHONY:	universal_product universal_fastdebug universal_debug \
72a73185bdc7 7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
phh
parents:
diff changeset
   123
	all_product_universal all_fastdebug_universal all_debug_universal \
26577
84fbba16cb3b 8057643: Unable to build --with-debug-level=optimized on OSX
kvn
parents: 24836
diff changeset
   124
	universal_optimized all_optimized_universal \
13099
64752e56d721 7178667: ALT_EXPORT_PATH does not export server jvm on macosx
sla
parents: 11649
diff changeset
   125
	universalize export_universal copy_universal \
64752e56d721 7178667: ALT_EXPORT_PATH does not export server jvm on macosx
sla
parents: 11649
diff changeset
   126
	$(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST)