make/MacBundles.gmk
author chegar
Wed, 03 Dec 2014 14:20:21 +0000
changeset 27560 adc258b13e2c
child 30094 bc3b5dbd8931
permissions -rw-r--r--
8049367: Modular Run-Time Images Reviewed-by: chegar, dfuchs, ihse, joehw, mullan, psandoz, wetmore Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, bradford.wetmore@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, james.laskey@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     2
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
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
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    36
  # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
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
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    40
  # All these OPENJDK checks are needed since there is no coherency between
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    41
  # these values in open and closed. Should probably be fixed.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    42
  ifndef OPENJDK
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    43
    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    44
  else
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    45
    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    46
  endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    47
  BUNDLE_ID_JRE := $(BUNDLE_ID).jre
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    48
  BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    49
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    50
  BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    51
  BUNDLE_NAME_JRE := $(BUNDLE_NAME)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    52
  BUNDLE_NAME_JDK := $(BUNDLE_NAME)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    53
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    54
  ifndef OPENJDK
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    55
    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    56
  else
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    58
  endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    59
  BUNDLE_INFO_JRE := $(BUNDLE_INFO)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
  BUNDLE_INFO_JDK := $(BUNDLE_INFO)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    61
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    62
  BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    63
  BUNDLE_VERSION := $(JDK_VERSION)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
  ifeq ($(COMPANY_NAME), N/A)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    65
    BUNDLE_VENDOR := UNDEFINED
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    66
  else
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
    BUNDLE_VENDOR := $(COMPANY_NAME)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    68
  endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    69
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    70
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    71
  JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    72
  JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    73
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    74
  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    75
  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    76
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    77
  # Copy empty directories (jre/lib/applet).
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    78
  $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    79
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    80
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    81
	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    82
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    83
  $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    84
	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    85
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    86
	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    87
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    88
  $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    89
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    90
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    91
	$(RM) $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    92
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    93
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    94
  $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    95
	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    96
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    97
	$(RM) $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    98
	$(LN) -s ../Home/lib/jli/libjli.dylib $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    99
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   100
  $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   101
	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   102
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   103
	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   104
	    -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   105
	    -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   106
	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   107
	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   108
	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   109
	    < $(MACOSX_PLIST_SRC)/JDK-Info.plist > $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   110
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   111
  $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   112
	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   113
	$(MKDIR) -p $(@D)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   114
	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   115
	    -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   116
	    -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   117
	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   118
	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   119
	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   120
	    < $(MACOSX_PLIST_SRC)/JRE-Info.plist > $@
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   121
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   122
  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   123
      $(JDK_BUNDLE_DIR)/Info.plist
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   124
	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   125
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   126
  jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   127
      $(JRE_BUNDLE_DIR)/Info.plist
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   128
	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   129
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   130
else # Not macosx
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   131
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   132
  bundles:
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   133
	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   134
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   135
endif # macosx
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   136
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   137
.PHONY: jdk-bundle jre-bundle bundles