2014-12-03 22:20:21 +08:00
|
|
|
#
|
2015-05-06 16:47:21 +08:00
|
|
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
2014-12-03 22:20:21 +08:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
2015-06-18 23:00:44 +08:00
|
|
|
include TextFileProcessing.gmk
|
2014-12-03 22:20:21 +08:00
|
|
|
|
|
|
|
default: bundles
|
|
|
|
|
|
|
|
# Only macosx has bundles defined.
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
|
|
|
|
bundles: jre-bundle jdk-bundle
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
# JDK_MACOSX_CONTENTS_DIR and JRE_MACOSX_CONTENTS_DIR are defined in SPEC.
|
2014-12-03 22:20:21 +08:00
|
|
|
|
|
|
|
MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle
|
|
|
|
|
2015-06-11 06:21:56 +08:00
|
|
|
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
|
|
|
|
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
|
|
|
|
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
|
|
|
|
BUNDLE_PLATFORM_VERSION := $(VERSION_MAJOR).$(VERSION_MINOR)
|
|
|
|
BUNDLE_VERSION := $(VERSION_NUMBER)
|
2014-12-03 22:20:21 +08:00
|
|
|
ifeq ($(COMPANY_NAME), N/A)
|
|
|
|
BUNDLE_VENDOR := UNDEFINED
|
|
|
|
else
|
|
|
|
BUNDLE_VENDOR := $(COMPANY_NAME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
|
|
|
|
JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_CONTENTS_DIR)/Home/,$(JDK_FILE_LIST))
|
|
|
|
JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_CONTENTS_DIR)/Home/,$(JRE_FILE_LIST))
|
2014-12-03 22:20:21 +08:00
|
|
|
|
|
|
|
# Copy empty directories (jre/lib/applet).
|
2016-05-04 21:29:01 +08:00
|
|
|
$(JDK_MACOSX_CONTENTS_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
|
2016-01-16 20:01:43 +08:00
|
|
|
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
|
2014-12-03 22:20:21 +08:00
|
|
|
$(MKDIR) -p $(@D)
|
|
|
|
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
$(JRE_MACOSX_CONTENTS_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
|
2016-01-16 20:01:43 +08:00
|
|
|
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
|
2014-12-03 22:20:21 +08:00
|
|
|
$(MKDIR) -p $(@D)
|
|
|
|
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
$(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
|
2016-01-16 20:01:43 +08:00
|
|
|
$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
|
2014-12-03 22:20:21 +08:00
|
|
|
$(MKDIR) -p $(@D)
|
|
|
|
$(RM) $@
|
|
|
|
$(LN) -s ../Home/lib/jli/libjli.dylib $@
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
$(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
|
2016-01-16 20:01:43 +08:00
|
|
|
$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
|
2014-12-03 22:20:21 +08:00
|
|
|
$(MKDIR) -p $(@D)
|
|
|
|
$(RM) $@
|
|
|
|
$(LN) -s ../Home/lib/jli/libjli.dylib $@
|
|
|
|
|
2015-05-06 16:47:21 +08:00
|
|
|
$(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
|
|
|
|
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
|
2016-05-04 21:29:01 +08:00
|
|
|
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
|
2015-05-06 16:47:21 +08:00
|
|
|
REPLACEMENTS := \
|
|
|
|
@@ID@@ => $(BUNDLE_ID).jdk ; \
|
|
|
|
@@NAME@@ => $(BUNDLE_NAME) ; \
|
|
|
|
@@INFO@@ => $(BUNDLE_INFO) ; \
|
|
|
|
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
|
|
|
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
|
|
|
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
|
|
|
|
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
|
2016-05-04 21:29:01 +08:00
|
|
|
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
|
2015-05-06 16:47:21 +08:00
|
|
|
REPLACEMENTS := \
|
|
|
|
@@ID@@ => $(BUNDLE_ID).jre ; \
|
|
|
|
@@NAME@@ => $(BUNDLE_NAME) ; \
|
|
|
|
@@INFO@@ => $(BUNDLE_INFO) ; \
|
|
|
|
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
|
|
|
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
|
|
|
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
|
|
|
))
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
|
2015-05-06 16:47:21 +08:00
|
|
|
$(BUILD_JDK_PLIST)
|
2016-05-04 21:29:01 +08:00
|
|
|
$(SETFILE) -a B $(dir $(JDK_MACOSX_CONTENTS_DIR))
|
2015-05-06 16:47:21 +08:00
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \
|
2015-05-06 16:47:21 +08:00
|
|
|
$(BUILD_JRE_PLIST)
|
2016-05-04 21:29:01 +08:00
|
|
|
$(SETFILE) -a B $(dir $(JRE_MACOSX_CONTENTS_DIR))
|
2014-12-03 22:20:21 +08:00
|
|
|
|
|
|
|
else # Not macosx
|
|
|
|
|
|
|
|
bundles:
|
|
|
|
$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
|
|
|
|
|
|
|
|
endif # macosx
|
|
|
|
|
|
|
|
.PHONY: jdk-bundle jre-bundle bundles
|