32 # Only macosx has bundles defined. |
32 # Only macosx has bundles defined. |
33 ifeq ($(OPENJDK_TARGET_OS), macosx) |
33 ifeq ($(OPENJDK_TARGET_OS), macosx) |
34 |
34 |
35 bundles: jre-bundle jdk-bundle |
35 bundles: jre-bundle jdk-bundle |
36 |
36 |
37 # JDK_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC. |
37 # JDK_MACOSX_CONTENTS_DIR and JRE_MACOSX_CONTENTS_DIR are defined in SPEC. |
38 |
38 |
39 MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle |
39 MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle |
40 |
40 |
41 BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT) |
41 BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT) |
42 BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT) |
42 BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT) |
50 endif |
50 endif |
51 |
51 |
52 JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR)) |
52 JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR)) |
53 JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR)) |
53 JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR)) |
54 |
54 |
55 JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST)) |
55 JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_CONTENTS_DIR)/Home/,$(JDK_FILE_LIST)) |
56 JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST)) |
56 JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_CONTENTS_DIR)/Home/,$(JRE_FILE_LIST)) |
57 |
57 |
58 # Copy empty directories (jre/lib/applet). |
58 # Copy empty directories (jre/lib/applet). |
59 $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% |
59 $(JDK_MACOSX_CONTENTS_DIR)/Home/%: $(JDK_IMAGE_DIR)/% |
60 $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
60 $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
61 $(MKDIR) -p $(@D) |
61 $(MKDIR) -p $(@D) |
62 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
62 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
63 |
63 |
64 $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% |
64 $(JRE_MACOSX_CONTENTS_DIR)/Home/%: $(JRE_IMAGE_DIR)/% |
65 $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
65 $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
66 $(MKDIR) -p $(@D) |
66 $(MKDIR) -p $(@D) |
67 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
67 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
68 |
68 |
69 $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: |
69 $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib: |
70 $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
70 $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
71 $(MKDIR) -p $(@D) |
71 $(MKDIR) -p $(@D) |
72 $(RM) $@ |
72 $(RM) $@ |
73 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
73 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
74 |
74 |
75 $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: |
75 $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib: |
76 $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
76 $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) |
77 $(MKDIR) -p $(@D) |
77 $(MKDIR) -p $(@D) |
78 $(RM) $@ |
78 $(RM) $@ |
79 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
79 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
80 |
80 |
81 $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \ |
81 $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \ |
82 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \ |
82 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \ |
83 OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \ |
83 OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \ |
84 REPLACEMENTS := \ |
84 REPLACEMENTS := \ |
85 @@ID@@ => $(BUNDLE_ID).jdk ; \ |
85 @@ID@@ => $(BUNDLE_ID).jdk ; \ |
86 @@NAME@@ => $(BUNDLE_NAME) ; \ |
86 @@NAME@@ => $(BUNDLE_NAME) ; \ |
87 @@INFO@@ => $(BUNDLE_INFO) ; \ |
87 @@INFO@@ => $(BUNDLE_INFO) ; \ |
88 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
88 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
90 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
90 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
91 )) |
91 )) |
92 |
92 |
93 $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \ |
93 $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \ |
94 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \ |
94 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \ |
95 OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \ |
95 OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \ |
96 REPLACEMENTS := \ |
96 REPLACEMENTS := \ |
97 @@ID@@ => $(BUNDLE_ID).jre ; \ |
97 @@ID@@ => $(BUNDLE_ID).jre ; \ |
98 @@NAME@@ => $(BUNDLE_NAME) ; \ |
98 @@NAME@@ => $(BUNDLE_NAME) ; \ |
99 @@INFO@@ => $(BUNDLE_INFO) ; \ |
99 @@INFO@@ => $(BUNDLE_INFO) ; \ |
100 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
100 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
101 @@VERSION@@ => $(BUNDLE_VERSION) ; \ |
101 @@VERSION@@ => $(BUNDLE_VERSION) ; \ |
102 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
102 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
103 )) |
103 )) |
104 |
104 |
105 jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ |
105 jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \ |
106 $(BUILD_JDK_PLIST) |
106 $(BUILD_JDK_PLIST) |
107 $(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR)) |
107 $(SETFILE) -a B $(dir $(JDK_MACOSX_CONTENTS_DIR)) |
108 |
108 |
109 jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ |
109 jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib \ |
110 $(BUILD_JRE_PLIST) |
110 $(BUILD_JRE_PLIST) |
111 $(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR)) |
111 $(SETFILE) -a B $(dir $(JRE_MACOSX_CONTENTS_DIR)) |
112 |
112 |
113 else # Not macosx |
113 else # Not macosx |
114 |
114 |
115 bundles: |
115 bundles: |
116 $(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)" |
116 $(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)" |