jdk/makefiles/Bundles.gmk
changeset 20547 453837141fac
parent 15145 30368009030a
equal deleted inserted replaced
20546:5e40a295cce2 20547:453837141fac
    29 default: bundles
    29 default: bundles
    30 
    30 
    31 # Only macosx has bundles defined.
    31 # Only macosx has bundles defined.
    32 ifeq ($(OPENJDK_TARGET_OS), macosx)
    32 ifeq ($(OPENJDK_TARGET_OS), macosx)
    33 
    33 
    34 bundles: jre-bundle jdk-bundle
    34   bundles: jre-bundle jdk-bundle
    35 
    35 
    36 # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
    36   # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
    37 
    37 
    38 MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
    38   MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
    39 
    39 
    40 # All these OPENJDK checks are needed since there is no coherency between
    40   # All these OPENJDK checks are needed since there is no coherency between
    41 # these values in open and closed. Should probably be fixed.
    41   # these values in open and closed. Should probably be fixed.
    42 ifndef OPENJDK
    42   ifndef OPENJDK
    43     BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
    43     BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
    44 else
    44   else
    45     BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
    45     BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
    46 endif
    46   endif
    47 BUNDLE_ID_JRE := $(BUNDLE_ID).jre
    47   BUNDLE_ID_JRE := $(BUNDLE_ID).jre
    48 BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
    48   BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
    49 
    49 
    50 BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
    50   BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
    51 BUNDLE_NAME_JRE := $(BUNDLE_NAME)
    51   BUNDLE_NAME_JRE := $(BUNDLE_NAME)
    52 BUNDLE_NAME_JDK := $(BUNDLE_NAME)
    52   BUNDLE_NAME_JDK := $(BUNDLE_NAME)
    53 
    53 
    54 ifndef OPENJDK
    54   ifndef OPENJDK
    55     BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
    55     BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
    56 else
    56   else
    57     BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
    57     BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
    58 endif
    58   endif
    59 BUNDLE_INFO_JRE := $(BUNDLE_INFO)
    59   BUNDLE_INFO_JRE := $(BUNDLE_INFO)
    60 BUNDLE_INFO_JDK := $(BUNDLE_INFO)
    60   BUNDLE_INFO_JDK := $(BUNDLE_INFO)
    61 
    61 
    62 BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
    62   BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
    63 BUNDLE_VERSION := $(JDK_VERSION)
    63   BUNDLE_VERSION := $(JDK_VERSION)
    64 ifeq ($(COMPANY_NAME),N/A)
    64   ifeq ($(COMPANY_NAME), N/A)
    65     BUNDLE_VENDOR := UNDEFINED
    65     BUNDLE_VENDOR := UNDEFINED
    66 else
    66   else
    67     BUNDLE_VENDOR := $(COMPANY_NAME)
    67     BUNDLE_VENDOR := $(COMPANY_NAME)
    68 endif
    68   endif
    69 
    69 
    70 
    70 
    71 JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
    71   JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
    72 JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
    72   JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
    73 
    73 
    74 JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
    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))
    75   JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
    76 
    76 
    77 # The old builds implementation of this did not preserve symlinks so
    77   # The old builds implementation of this did not preserve symlinks so
    78 # make sure they are followed and the contents copied instead.
    78   # make sure they are followed and the contents copied instead.
    79 # To fix this, remove -L
    79   # To fix this, remove -L
    80 # Copy empty directories (jre/lib/applet).
    80   # Copy empty directories (jre/lib/applet).
    81 $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
    81   $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
    82 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    82 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    83 	$(MKDIR) -p $(@D)
    83 	$(MKDIR) -p $(@D)
    84 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
    84 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
    85 
    85 
    86 $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
    86   $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
    87 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    87 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    88 	$(MKDIR) -p $(@D)
    88 	$(MKDIR) -p $(@D)
    89 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
    89 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
    90 
    90 
    91 $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
    91   $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
    92 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    92 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    93 	$(MKDIR) -p $(@D)
    93 	$(MKDIR) -p $(@D)
    94 	$(RM) $@
    94 	$(RM) $@
    95 	$(LN) -s ../Home/jre/lib/jli/libjli.dylib $@
    95 	$(LN) -s ../Home/jre/lib/jli/libjli.dylib $@
    96 
    96 
    97 $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
    97   $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
    98 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    98 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    99 	$(MKDIR) -p $(@D)
    99 	$(MKDIR) -p $(@D)
   100 	$(RM) $@
   100 	$(RM) $@
   101 	$(LN) -s ../Home/lib/jli/libjli.dylib $@
   101 	$(LN) -s ../Home/lib/jli/libjli.dylib $@
   102 
   102 
   103 $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
   103   $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
   104 	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
   104 	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
   105 	$(MKDIR) -p $(@D)
   105 	$(MKDIR) -p $(@D)
   106 	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
   106 	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
   107 		-e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
   107 	    -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
   108 		-e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
   108 	    -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
   109 		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
   109 	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
   110 		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
   110 	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
   111 		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
   111 	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
   112 		< $(MACOSX_SRC)/bundle/JDK-Info.plist > $@
   112 	    < $(MACOSX_SRC)/bundle/JDK-Info.plist > $@
   113 
   113 
   114 $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
   114   $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
   115 	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
   115 	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
   116 	$(MKDIR) -p $(@D)
   116 	$(MKDIR) -p $(@D)
   117 	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
   117 	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
   118 		-e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
   118 	    -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
   119 		-e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
   119 	    -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
   120 		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
   120 	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
   121 		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
   121 	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
   122 		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
   122 	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
   123 		< $(MACOSX_SRC)/bundle/JRE-Info.plist > $@
   123 	    < $(MACOSX_SRC)/bundle/JRE-Info.plist > $@
   124 
   124 
   125 jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
   125   jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
   126 		$(JDK_BUNDLE_DIR)/Info.plist
   126       $(JDK_BUNDLE_DIR)/Info.plist
   127 	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
   127 	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
   128 
   128 
   129 jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
   129   jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
   130 		$(JRE_BUNDLE_DIR)/Info.plist
   130       $(JRE_BUNDLE_DIR)/Info.plist
   131 	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
   131 	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
   132 
   132 
   133 else # Not macosx
   133 else # Not macosx
   134 
   134 
   135 bundles:
   135   bundles:
   136 	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
   136 	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
   137 
   137 
   138 endif # macosx
   138 endif # macosx
   139 
   139 
   140 .PHONY: jdk-bundle jre-bundle bundles
   140 .PHONY: jdk-bundle jre-bundle bundles