make/MacBundles.gmk
author ihse
Wed, 06 May 2015 10:47:21 +0200
changeset 30094 bc3b5dbd8931
parent 27560 adc258b13e2c
child 33926 3a19edba4808
child 31125 9c321d13b2be
child 31310 481585782338
permissions -rw-r--r--
8078058: Clean up mac bundles logic Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
#
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
     2
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     4
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    10
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    15
# accompanied this code).
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    16
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    20
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    23
# questions.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    24
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    25
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    26
include $(SPEC)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    27
include MakeBase.gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    28
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    29
default: bundles
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    30
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    31
# Only macosx has bundles defined.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    32
ifeq ($(OPENJDK_TARGET_OS), macosx)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    33
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    34
  bundles: jre-bundle jdk-bundle
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    35
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    36
  # JDK_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC.
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    37
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    38
  MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    39
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    40
  BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    41
  BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    42
  BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    43
  BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    44
  BUNDLE_VERSION := $(JDK_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    45
  ifeq ($(COMPANY_NAME), N/A)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    46
    BUNDLE_VENDOR := UNDEFINED
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    47
  else
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    48
    BUNDLE_VENDOR := $(COMPANY_NAME)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    49
  endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    50
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    51
  JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    52
  JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    53
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    54
  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    55
  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    56
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
  # Copy empty directories (jre/lib/applet).
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    58
  $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    59
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    61
	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    62
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    63
  $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    65
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    66
	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    68
  $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    69
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    70
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    71
	$(RM) $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    72
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    73
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    74
  $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    75
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    76
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    77
	$(RM) $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    78
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    79
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    80
  $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    81
      SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    82
      OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    83
      REPLACEMENTS := \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    84
          @@ID@@ => $(BUNDLE_ID).jdk ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    85
          @@NAME@@ => $(BUNDLE_NAME) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    86
          @@INFO@@ => $(BUNDLE_INFO) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    87
          @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    88
          @@VERSION@@ => $(BUNDLE_VERSION) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    89
          @@VENDOR@@ => $(BUNDLE_VENDOR) , \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    90
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    91
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    92
  $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    93
      SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    94
      OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    95
      REPLACEMENTS := \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    96
          @@ID@@ => $(BUNDLE_ID).jre ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    97
          @@NAME@@ => $(BUNDLE_NAME) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    98
          @@INFO@@ => $(BUNDLE_INFO) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
    99
          @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   100
          @@VERSION@@ => $(BUNDLE_VERSION) ; \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   101
          @@VENDOR@@ => $(BUNDLE_VENDOR) , \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   102
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   103
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   104
  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   105
      $(BUILD_JDK_PLIST)
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   106
	$(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   107
30094
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   108
  jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   109
      $(BUILD_JRE_PLIST)
bc3b5dbd8931 8078058: Clean up mac bundles logic
ihse
parents: 27560
diff changeset
   110
	$(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   111
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   112
else # Not macosx
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   113
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   114
  bundles:
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   115
	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   116
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   117
endif # macosx
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   118
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   119
.PHONY: jdk-bundle jre-bundle bundles