jdk/makefiles/Bundles.gmk
author darcy
Tue, 08 Jan 2013 16:08:29 -0800
changeset 15012 8fa5871c30c6
parent 14231 a0c23c1c010f
child 15129 38c7422a92ff
permissions -rw-r--r--
8005298: Add FunctionalInterface type to the core libraries Reviewed-by: mduigou
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
# accompanied this code).
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
# questions.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
#
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    25
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    26
include $(SPEC)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
include MakeBase.gmk
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    29
default: bundles
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    30
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    31
# Only macosx has bundles defined.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    32
ifeq ($(OPENJDK_TARGET_OS), macosx)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    33
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    34
bundles: jre-bundle jdk-bundle
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    35
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    36
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    37
JDK_BUNDLE_DIR := $(IMAGES_OUTPUTDIR)/j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    38
JRE_BUNDLE_DIR := $(IMAGES_OUTPUTDIR)/j2re-bundle/jre$(JDK_VERSION).jre/Contents
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    39
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    40
MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    41
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    42
# All these OPENJDK checks are needed since there is no coherency between
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    43
# these values in open and closed. Should probably be fixed.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    44
ifndef OPENJDK
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    45
    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    46
else
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    47
    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    48
endif
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    49
BUNDLE_ID_JRE := $(BUNDLE_ID).jre
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    50
BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    51
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    52
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    53
BUNDLE_NAME_JRE := $(BUNDLE_NAME)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    54
BUNDLE_NAME_JDK := $(BUNDLE_NAME)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    55
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    56
ifndef OPENJDK
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    57
    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    58
else
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    59
    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    60
endif
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    61
BUNDLE_INFO_JRE := $(BUNDLE_INFO)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    62
BUNDLE_INFO_JDK := $(BUNDLE_INFO)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    63
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    64
BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    65
BUNDLE_VERSION := $(JDK_VERSION)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    66
ifeq ($(COMPANY_NAME),N/A)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    67
    BUNDLE_VENDOR := UNDEFINED
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    68
else
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    69
    BUNDLE_VENDOR := $(COMPANY_NAME)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    70
endif
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    71
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    72
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    73
JDK_FILE_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/j2sdk-image ! -type d)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    74
JRE_FILE_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/j2re-image ! -type d)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    75
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    76
JDK_TARGET_LIST := $(subst $(IMAGES_OUTPUTDIR)/j2sdk-image,$(JDK_BUNDLE_DIR)/Home,$(JDK_FILE_LIST))
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    77
JRE_TARGET_LIST := $(subst $(IMAGES_OUTPUTDIR)/j2re-image,$(JRE_BUNDLE_DIR)/Home,$(JRE_FILE_LIST))
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    78
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    79
# The old builds implementation of this did not preserve symlinks so
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    80
# make sure they are followed and the contents copied instead.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    81
# To fix this, just replace copy with install-file macro.
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    82
$(JDK_BUNDLE_DIR)/Home/%: $(IMAGES_OUTPUTDIR)/j2sdk-image/%
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    83
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    84
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    85
	$(CP) -f -R -L '$<' '$@'
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    86
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    87
$(JRE_BUNDLE_DIR)/Home/%: $(IMAGES_OUTPUTDIR)/j2re-image/%
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    88
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    89
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    90
	$(CP) -f -R -L '$<' '$@'
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    91
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    92
$(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    93
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    94
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    95
	$(RM) $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    96
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    97
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    98
$(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    99
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   100
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   101
	$(RM) $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   102
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   103
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   104
$(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   105
	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   106
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   107
	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   108
		-e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   109
		-e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   110
		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   111
		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   112
		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   113
		< $(MACOSX_SRC)/bundle/JDK-Info.plist > $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   114
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   115
$(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   116
	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   117
	$(MKDIR) -p $(@D)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   118
	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   119
		-e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   120
		-e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   121
		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   122
		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   123
		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   124
		< $(MACOSX_SRC)/bundle/JRE-Info.plist > $@
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   125
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   126
jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   127
		$(JDK_BUNDLE_DIR)/Info.plist
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   128
	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   129
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   130
jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   131
		$(JRE_BUNDLE_DIR)/Info.plist
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   132
	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   133
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   134
else # Not macosx
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   135
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   136
bundles:
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   137
	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   138
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   139
endif # macosx
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   140
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   141
.PHONY: jdk-bundle jre-bundle bundles