author | mchung |
Mon, 18 Jan 2010 15:23:14 -0800 | |
changeset 4681 | 7d382dfe6e55 |
parent 4665 | d14dc3d9e1fa |
child 5381 | d6d64a42ff51 |
permissions | -rw-r--r-- |
4524 | 1 |
# |
2 |
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
# |
|
25 |
||
26 |
JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image |
|
27 |
JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image |
|
28 |
||
29 |
# |
|
30 |
# modules Target to build jdk and jre module image |
|
31 |
# |
|
32 |
# There is one jar file per module containing classes only. |
|
33 |
# All module jars are currently placed under jre/lib directory. |
|
34 |
# |
|
35 |
# Open issues that need further investigation: |
|
36 |
# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
37 |
# module. META-INF/services file is not installed. |
4524 | 38 |
# 2. Signed jars |
39 |
# For JDK build, signed jars are copied to the build. |
|
40 |
# All jars in the module image are unsigned. |
|
41 |
||
42 |
MODULE_IMAGEBINDIR = bin |
|
43 |
||
44 |
# |
|
45 |
# Targets. |
|
46 |
# |
|
47 |
INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre |
|
48 |
INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk |
|
49 |
ifeq ($(PLATFORM), solaris) |
|
50 |
ifeq ($(ARCH_DATA_MODEL), 64) |
|
51 |
INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64 |
|
52 |
INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64 |
|
53 |
endif |
|
54 |
endif |
|
55 |
||
56 |
modules modules-clobber \ |
|
57 |
initial-module-image-jre initial-module-image-jdk \ |
|
58 |
initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \ |
|
59 |
trim-module-image-jre trim-module-image-jdk \ |
|
60 |
process-module-image-jre process-module-image-jdk :: |
|
61 |
@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." |
|
62 |
||
63 |
# Order is important here, trim jre after jdk image is created |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
64 |
modules:: gen-modules \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
65 |
sanity-module-images post-sanity-module-images \ |
4524 | 66 |
$(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \ |
67 |
trim-module-image-jre trim-module-image-jdk \ |
|
68 |
process-module-image-jre process-module-image-jdk |
|
69 |
||
70 |
# Don't use these |
|
71 |
module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre |
|
72 |
module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk |
|
73 |
||
74 |
# |
|
75 |
# Paths to these files we need |
|
76 |
JDK_MODULE_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) |
|
77 |
JDK_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%64) |
|
78 |
JDK_MODULE_DOCFILES = $(OTHER_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) |
|
79 |
||
80 |
JRE_MODULE_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) |
|
81 |
JRE_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%64) |
|
82 |
JRE_MODULE_DOCFILES = $(OTHER_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) |
|
83 |
JRE_MODULE_DOCFILES += $(JRE_NAMECHANGE_DOCLIST:%=$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX)) |
|
84 |
||
85 |
###### RULES |
|
86 |
||
87 |
# JDK files |
|
88 |
$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/% |
|
89 |
$(process-doc-file) |
|
90 |
# Removes LICENSE_VERSION or not |
|
91 |
ifdef LICENSE_VERSION |
|
92 |
$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) |
|
93 |
$(process-doc-file) |
|
94 |
$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) |
|
95 |
$(process-doc-file) |
|
96 |
else |
|
97 |
$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/% |
|
98 |
$(process-doc-file) |
|
99 |
endif |
|
100 |
||
101 |
# JRE files |
|
102 |
$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/% |
|
103 |
$(process-doc-file) |
|
104 |
# Add $(TEXT_SUFFIX) suffix |
|
105 |
ifdef TEXT_SUFFIX |
|
106 |
$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX): $(SHARE_JRE_DOC_SRC)/% |
|
107 |
$(process-doc-file) |
|
108 |
endif |
|
109 |
# Removes LICENSE_VERSION or not |
|
110 |
ifdef LICENSE_VERSION |
|
111 |
$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) |
|
112 |
$(process-doc-file) |
|
113 |
$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) |
|
114 |
$(process-doc-file) |
|
115 |
else |
|
116 |
$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/% |
|
117 |
$(process-doc-file) |
|
118 |
endif |
|
119 |
||
120 |
###################################################### |
|
121 |
# JRE Image |
|
122 |
###################################################### |
|
123 |
||
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
124 |
MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
125 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
126 |
# Modules in the jre/lib/security directory |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
127 |
POLICY_MODULES = US_export_policy local_policy |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
128 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
129 |
# Modules in the modules/ext directory |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
130 |
EXT_MODULES = localedata security-sunec security-sunjce |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
131 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
132 |
# Build PKCS#11 on all platforms except 64-bit Windows. |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
133 |
PKCS11 = security-sunpkcs11 |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
134 |
ifeq ($(ARCH_DATA_MODEL), 64) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
135 |
ifeq ($(PLATFORM), windows) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
136 |
PKCS11 = |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
137 |
endif |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
138 |
endif |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
139 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
140 |
EXT_MODULES += $(PKCS11) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
141 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
142 |
# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform. |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
143 |
ifeq ($(PLATFORM), windows) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
144 |
ifneq ($(ARCH_DATA_MODEL), 64) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
145 |
EXT_MODULES += security-sunmscapi |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
146 |
endif |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
147 |
endif |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
148 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
149 |
# Modules for JDK only |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
150 |
JDK_MODULES = tools |
4524 | 151 |
|
152 |
gen-modules: |
|
153 |
$(CD) modules; $(MAKE) all |
|
154 |
||
155 |
initial-module-image-jre-setup: |
|
156 |
$(RM) -r $(JRE_MODULE_IMAGE_DIR) |
|
157 |
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR) |
|
158 |
||
159 |
# 64-bit solaris jre image contains only the 64-bit add-on files. |
|
160 |
initial-module-image-jre-sol64:: initial-module-image-jre-setup \ |
|
161 |
$(JRE_MODULE_LICENSES) $(JRE_MODULE_64_LICENSES) |
|
162 |
@# Use tar instead of cp to preserve the symbolic links |
|
163 |
for dir in bin lib ; do \ |
|
164 |
( $(CD) $(OUTPUTDIR) && \ |
|
165 |
$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \ |
|
166 |
($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ |
|
167 |
done |
|
168 |
@# Remove some files from the jre area |
|
169 |
for t in $(NOTJRETOOLS) ; do \ |
|
170 |
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ |
|
171 |
done |
|
172 |
$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'` |
|
173 |
$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'` |
|
174 |
||
175 |
# Construct an initial jre image (initial jdk jre) no trimming or stripping |
|
176 |
initial-module-image-jre:: initial-module-image-jre-setup \ |
|
177 |
$(JRE_LICENSES) $(JRE_MODULE_DOCFILES) \ |
|
178 |
$(BUILDMETAINDEX_JARFILE) |
|
179 |
@# Copy in bin directory |
|
180 |
$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) |
|
181 |
@# CTE plugin security change require new empty directory lib/applet |
|
182 |
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet |
|
183 |
@# Copy files but not .jar in lib directory |
|
184 |
$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) |
|
185 |
@# |
|
186 |
@# copy modules to jre/lib |
|
187 |
@# |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
188 |
for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \ |
4681
7d382dfe6e55
6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents:
4665
diff
changeset
|
189 |
$(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \ |
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
190 |
done |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
191 |
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
192 |
for m in $(EXT_MODULES) ; do \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
193 |
$(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
194 |
done |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
195 |
for m in $(POLICY_MODULES) ; do \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
196 |
$(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
197 |
done |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
198 |
@# Remove jdk modules |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
199 |
for m in $(JDK_MODULES) ; do \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
200 |
$(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
201 |
done |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
202 |
|
4524 | 203 |
@# Make sure all directories are read/execute for everyone |
204 |
$(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d` |
|
205 |
@# Remove some files from the jre area |
|
206 |
for t in $(NOTJRETOOLS) ; do \ |
|
207 |
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ |
|
208 |
done |
|
209 |
@# Remove orb.idl and ir.idl from jre |
|
210 |
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \; |
|
211 |
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \; |
|
212 |
@# Generate meta-index to make boot and extension class loaders lazier |
|
213 |
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ |
|
214 |
$(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ |
|
215 |
-o meta-index *.jar |
|
216 |
@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup) |
|
217 |
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \ |
|
218 |
$(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ |
|
219 |
-o meta-index *.jar |
|
220 |
@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup) |
|
221 |
ifeq ($(PLATFORM), windows) |
|
222 |
@# Remove certain *.lib files |
|
223 |
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ |
|
224 |
$(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \ |
|
225 |
hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX) |
|
226 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
227 |
@# The Java Kernel JRE image ships with a special VM. It is not included |
|
228 |
@# in the full JRE image, so remove it. Also, is it only for 32-bit windows. |
|
229 |
$(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel |
|
230 |
endif |
|
231 |
endif # Windows |
|
232 |
ifneq ($(PLATFORM), windows) |
|
233 |
$(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES)) |
|
234 |
endif # !windows |
|
235 |
||
236 |
# Trim out any extra files not for the jre shipment but wanted in the jdk jre. |
|
237 |
# (Note the jdk WILL want the jre image before this trimming) |
|
238 |
# Removes server VM on Windows 32bit. |
|
239 |
# Remove certain shared libraries that should not be in the jre image |
|
240 |
# but should be in the jdk jre image. |
|
241 |
trim-module-image-jre:: |
|
242 |
ifeq ($(PLATFORM), windows) |
|
243 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
244 |
$(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server |
|
245 |
endif |
|
246 |
ifdef NOTJRE_SHARED_LIBS |
|
247 |
for l in $(NOTJRE_SHARED_LIBS) ; do \ |
|
248 |
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \ |
|
249 |
done ; |
|
250 |
endif |
|
251 |
else # PLATFORM |
|
252 |
ifdef NOTJRE_SHARED_LIBS |
|
253 |
for l in $(NOTJRE_SHARED_LIBS) ; do \ |
|
254 |
$(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \ |
|
255 |
done ; |
|
256 |
endif |
|
257 |
endif # PLATFORM |
|
258 |
||
259 |
# Get list of all Elf files in the jre |
|
260 |
JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list |
|
261 |
$(JRE_MODULE_ELF_LIST): |
|
262 |
@$(prep-target) |
|
263 |
ifneq ($(PLATFORM), windows) |
|
264 |
$(RM) $@ |
|
265 |
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@ |
|
266 |
$(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \ |
|
267 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ |
|
268 |
endif |
|
269 |
||
270 |
# Post process the image (strips and mcs on Elf files we are shipping) |
|
271 |
# (Note the jdk WILL want the jre image before this processing) |
|
272 |
process-module-image-jre:: $(JRE_MODULE_ELF_LIST) |
|
273 |
ifneq ($(POST_STRIP_PROCESS), ) |
|
274 |
for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ |
|
275 |
$(CHMOD) u+w $${f}; \ |
|
276 |
$(ECHO) $(POST_STRIP_PROCESS) $${f}; \ |
|
277 |
$(POST_STRIP_PROCESS) $${f}; \ |
|
278 |
$(CHMOD) go-w $${f}; \ |
|
279 |
done |
|
280 |
endif |
|
281 |
ifneq ($(POST_MCS_PROCESS), ) |
|
282 |
for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ |
|
283 |
$(CHMOD) u+w $${f}; \ |
|
284 |
$(ECHO) $(POST_MCS_PROCESS) $${f}; \ |
|
285 |
$(POST_MCS_PROCESS) $${f}; \ |
|
286 |
$(CHMOD) go-w $${f}; \ |
|
287 |
done |
|
288 |
endif |
|
289 |
$(RM) $(JRE_MODULE_ELF_LIST) |
|
290 |
||
291 |
###################################################### |
|
292 |
# JDK Image |
|
293 |
###################################################### |
|
294 |
# Note: cpio ($(CPIO)) sometimes leaves directories without rx access. |
|
295 |
||
296 |
initial-module-image-jdk-setup: |
|
297 |
$(RM) -r $(JDK_MODULE_IMAGE_DIR) |
|
298 |
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre |
|
299 |
($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \ |
|
300 |
| $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre ) |
|
301 |
$(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man |
|
302 |
$(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d` |
|
303 |
||
304 |
initial-module-image-jdk64-bindemos: |
|
305 |
for dir in bin demo ; do \ |
|
306 |
( $(CD) $(OUTPUTDIR) && \ |
|
307 |
$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \ |
|
308 |
($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ |
|
309 |
done |
|
310 |
||
311 |
# Solaris 64 bit image is special |
|
312 |
initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \ |
|
313 |
initial-module-image-jdk64-bindemos \ |
|
314 |
$(JDK_MODULE_LICENSES) $(JDK_MODULARLIZED_64_LICENSES) |
|
315 |
||
316 |
# DB files to add |
|
317 |
ifeq ($(OPENJDK),true) |
|
318 |
||
319 |
initial-module-image-jdk-db: |
|
320 |
||
321 |
else |
|
322 |
||
323 |
# Create the list of db *.zip files to bundle with jdk |
|
324 |
ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db) |
|
325 |
DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null) |
|
326 |
||
327 |
initial-module-image-jdk-db: $(DB_ZIP_LIST) |
|
328 |
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db |
|
329 |
for d in $(DB_ZIP_LIST); do \ |
|
330 |
($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \ |
|
331 |
done |
|
332 |
||
333 |
endif |
|
334 |
||
335 |
# Standard jdk image |
|
336 |
initial-module-image-jdk:: initial-module-image-jdk-setup \ |
|
337 |
initial-module-image-jdk-db \ |
|
338 |
$(JDK_MODULE_LICENSES) $(JDK_MODULE_DOCFILES) |
|
339 |
$(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib |
|
340 |
@# |
|
341 |
@# copy jdk modules to jdk/lib |
|
342 |
@# |
|
343 |
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
344 |
for m in $(JDK_MODULES) ; do \ |
4681
7d382dfe6e55
6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents:
4665
diff
changeset
|
345 |
$(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \ |
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4524
diff
changeset
|
346 |
done |
4524 | 347 |
ifeq ($(PLATFORM), windows) |
348 |
@# |
|
349 |
@# lib/ |
|
350 |
@# |
|
351 |
$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib |
|
352 |
$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib |
|
353 |
@# |
|
354 |
@# bin/ |
|
355 |
@# |
|
356 |
@# copy all EXE files and only certain DLL files from BINDIR |
|
357 |
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin |
|
358 |
$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin |
|
359 |
$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin |
|
360 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
361 |
ifeq ($(COMPILER_VERSION), VS2003) |
|
362 |
$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin |
|
363 |
endif |
|
364 |
endif |
|
365 |
else # PLATFORM |
|
366 |
@# |
|
367 |
@# bin/ |
|
368 |
@# |
|
369 |
($(CD) $(BINDIR)/.. && $(TAR) cf - \ |
|
370 |
`$(FIND) bin \( -type f -o -type l \) -print `) | \ |
|
371 |
($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) |
|
372 |
endif # PLATFORM |
|
373 |
@# |
|
374 |
@# lib/ct.sym |
|
375 |
@# |
|
376 |
$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym |
|
377 |
$(JAVAC_CMD) -XDprocess.packages -proc:only \ |
|
378 |
-processor com.sun.tools.javac.sym.CreateSymbols \ |
|
379 |
-Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \ |
|
380 |
-Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \ |
|
381 |
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) |
|
382 |
$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \ |
|
383 |
-C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS) |
|
384 |
@$(java-vm-cleanup) |
|
385 |
$(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym |
|
386 |
@# |
|
387 |
@# CORBA supported orb.idl and ir.idl should be copied to lib |
|
388 |
@# |
|
389 |
$(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl |
|
390 |
$(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl |
|
391 |
ifeq ($(PLATFORM), linux) |
|
392 |
@# |
|
393 |
@# on Linux copy jexec from jre/lib to /lib |
|
394 |
@# |
|
395 |
$(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec |
|
396 |
endif # PLATFORM |
|
397 |
@# |
|
398 |
@# demo, include |
|
399 |
@# |
|
400 |
$(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR) |
|
401 |
$(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR) |
|
402 |
$(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR) |
|
403 |
@# |
|
404 |
@# Swing BeanInfo generation |
|
405 |
@# |
|
406 |
$(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans |
|
407 |
ifneq ($(PLATFORM), windows) |
|
408 |
$(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES)) |
|
409 |
endif # !windows |
|
410 |
||
411 |
# Trim out files we don't want to ship |
|
412 |
trim-module-image-jdk:: |
|
413 |
@# Remove tools that should not be part of SDK. |
|
414 |
for t in $(NOTJDKTOOLS); do \ |
|
415 |
$(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX) \ |
|
416 |
$(JDK_MODULE_IMAGE_DIR)/bin/*/native_threads/$${t}$(EXE_SUFFIX); \ |
|
417 |
done |
|
418 |
||
419 |
# Get list of Elf files in the jdk |
|
420 |
JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list |
|
421 |
$(JDK_MODULE_ELF_LIST): |
|
422 |
@$(prep-target) |
|
423 |
ifneq ($(PLATFORM), windows) |
|
424 |
$(RM) $@ |
|
425 |
$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@ |
|
426 |
$(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \ |
|
427 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ |
|
428 |
file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \ |
|
429 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ |
|
430 |
endif |
|
431 |
||
432 |
# Post process the image (strips and mcs on files we are shipping) |
|
433 |
process-module-image-jdk:: $(JDK_MODULE_ELF_LIST) |
|
434 |
ifneq ($(POST_STRIP_PROCESS), ) |
|
435 |
for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \ |
|
436 |
$(CHMOD) u+w $${f}; \ |
|
437 |
$(ECHO) $(POST_STRIP_PROCESS) $${f}; \ |
|
438 |
$(POST_STRIP_PROCESS) $${f}; \ |
|
439 |
$(CHMOD) go-w $${f}; \ |
|
440 |
done |
|
441 |
endif |
|
442 |
ifneq ($(POST_MCS_PROCESS), ) |
|
443 |
for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \ |
|
444 |
$(CHMOD) u+w $${f}; \ |
|
445 |
$(ECHO) $(POST_MCS_PROCESS) $${f}; \ |
|
446 |
$(POST_MCS_PROCESS) $${f}; \ |
|
447 |
$(CHMOD) go-w $${f}; \ |
|
448 |
done |
|
449 |
endif |
|
450 |
$(RM) $(JDK_MODULE_ELF_LIST) |
|
451 |
||
452 |
###################################################### |
|
453 |
# clobber |
|
454 |
###################################################### |
|
455 |
modules-clobber:: |
|
456 |
$(RM) -r $(JDK_MODULE_IMAGE_DIR) |
|
457 |
$(RM) -r $(JRE_MODULE_IMAGE_DIR) |
|
458 |
||
459 |
# |
|
460 |
# TODO - nop for now |
|
461 |
sanity-module-images post-sanity-module-images: |
|
462 |
||
463 |
modules modules-clobber:: |
|
464 |
@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..." |
|
465 |
@$(java-vm-cleanup) |
|
466 |
||
467 |
.PHONY: modules module-image-jre module-image-jdk \ |
|
468 |
initial-module-image-jre initial-module-image-jdk \ |
|
469 |
initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \ |
|
470 |
initial-module-image-jdk-setup \ |
|
471 |
initial-module-image-jdk-db \ |
|
472 |
initial-module-image-jdk64-bindemos \ |
|
473 |
initial-module-image-jre-setup \ |
|
474 |
trim-module-image-jre trim-module-image-jdk \ |
|
475 |
process-module-image-jre process-module-image-jdk \ |
|
476 |
install-previous-jre install-previous-jdk \ |
|
477 |
modules-clobber |
|
478 |
||
479 |
# Force rule |
|
480 |
FRC: |
|
481 |