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