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_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC. |
37 |
37 |
38 MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle |
38 MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle |
39 |
39 |
40 # All these OPENJDK checks are needed since there is no coherency between |
40 BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION) |
41 # these values in open and closed. Should probably be fixed. |
|
42 ifndef OPENJDK |
|
43 BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION) |
|
44 else |
|
45 BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE) |
|
46 endif |
|
47 BUNDLE_ID_JRE := $(BUNDLE_ID).jre |
|
48 BUNDLE_ID_JDK := $(BUNDLE_ID).jdk |
|
49 |
|
50 BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION) |
41 BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION) |
51 BUNDLE_NAME_JRE := $(BUNDLE_NAME) |
42 BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION) |
52 BUNDLE_NAME_JDK := $(BUNDLE_NAME) |
|
53 |
|
54 ifndef OPENJDK |
|
55 BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION) |
|
56 else |
|
57 BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION)) |
|
58 endif |
|
59 BUNDLE_INFO_JRE := $(BUNDLE_INFO) |
|
60 BUNDLE_INFO_JDK := $(BUNDLE_INFO) |
|
61 |
|
62 BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION) |
43 BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION) |
63 BUNDLE_VERSION := $(JDK_VERSION) |
44 BUNDLE_VERSION := $(JDK_VERSION) |
64 ifeq ($(COMPANY_NAME), N/A) |
45 ifeq ($(COMPANY_NAME), N/A) |
65 BUNDLE_VENDOR := UNDEFINED |
46 BUNDLE_VENDOR := UNDEFINED |
66 else |
47 else |
67 BUNDLE_VENDOR := $(COMPANY_NAME) |
48 BUNDLE_VENDOR := $(COMPANY_NAME) |
68 endif |
49 endif |
69 |
50 |
70 |
|
71 JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR)) |
51 JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR)) |
72 JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR)) |
52 JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR)) |
73 |
53 |
74 JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST)) |
54 JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST)) |
75 JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST)) |
55 JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST)) |
76 |
56 |
77 # Copy empty directories (jre/lib/applet). |
57 # Copy empty directories (jre/lib/applet). |
78 $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% |
58 $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% |
79 $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
59 $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
80 $(MKDIR) -p $(@D) |
60 $(MKDIR) -p $(@D) |
81 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
61 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
82 |
62 |
83 $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% |
63 $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% |
84 $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
64 $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
85 $(MKDIR) -p $(@D) |
65 $(MKDIR) -p $(@D) |
86 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
66 if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi |
87 |
67 |
88 $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib: |
68 $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: |
89 $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
69 $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
90 $(MKDIR) -p $(@D) |
70 $(MKDIR) -p $(@D) |
91 $(RM) $@ |
71 $(RM) $@ |
92 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
72 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
93 |
73 |
94 $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib: |
74 $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: |
95 $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
75 $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
96 $(MKDIR) -p $(@D) |
76 $(MKDIR) -p $(@D) |
97 $(RM) $@ |
77 $(RM) $@ |
98 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
78 $(LN) -s ../Home/lib/jli/libjli.dylib $@ |
99 |
79 |
100 $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC) |
80 $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \ |
101 $(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
81 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \ |
102 $(MKDIR) -p $(@D) |
82 OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \ |
103 $(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \ |
83 REPLACEMENTS := \ |
104 -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \ |
84 @@ID@@ => $(BUNDLE_ID).jdk ; \ |
105 -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \ |
85 @@NAME@@ => $(BUNDLE_NAME) ; \ |
106 -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \ |
86 @@INFO@@ => $(BUNDLE_INFO) ; \ |
107 -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \ |
87 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
108 -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \ |
88 @@VERSION@@ => $(BUNDLE_VERSION) ; \ |
109 < $(MACOSX_PLIST_SRC)/JDK-Info.plist > $@ |
89 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
|
90 )) |
110 |
91 |
111 $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC) |
92 $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \ |
112 $(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
93 SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \ |
113 $(MKDIR) -p $(@D) |
94 OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \ |
114 $(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \ |
95 REPLACEMENTS := \ |
115 -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \ |
96 @@ID@@ => $(BUNDLE_ID).jre ; \ |
116 -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \ |
97 @@NAME@@ => $(BUNDLE_NAME) ; \ |
117 -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \ |
98 @@INFO@@ => $(BUNDLE_INFO) ; \ |
118 -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \ |
99 @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ |
119 -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \ |
100 @@VERSION@@ => $(BUNDLE_VERSION) ; \ |
120 < $(MACOSX_PLIST_SRC)/JRE-Info.plist > $@ |
101 @@VENDOR@@ => $(BUNDLE_VENDOR) , \ |
|
102 )) |
121 |
103 |
122 jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \ |
104 jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ |
123 $(JDK_BUNDLE_DIR)/Info.plist |
105 $(BUILD_JDK_PLIST) |
124 $(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR)) |
106 $(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR)) |
125 |
107 |
126 jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \ |
108 jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ |
127 $(JRE_BUNDLE_DIR)/Info.plist |
109 $(BUILD_JRE_PLIST) |
128 $(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR)) |
110 $(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR)) |
129 |
111 |
130 else # Not macosx |
112 else # Not macosx |
131 |
113 |
132 bundles: |
114 bundles: |
133 $(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)" |
115 $(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)" |