27560
|
1 |
#
|
|
2 |
# Copyright (c) 2014, Oracle and/or its affiliates. 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. Oracle designates this
|
|
8 |
# particular file as subject to the "Classpath" exception as provided
|
|
9 |
# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
# or visit www.oracle.com if you need additional information or have any
|
|
23 |
# questions.
|
|
24 |
#
|
|
25 |
|
|
26 |
default: all
|
|
27 |
|
|
28 |
include $(SPEC)
|
|
29 |
include MakeBase.gmk
|
|
30 |
|
|
31 |
TOOL_TARGETS :=
|
28356
|
32 |
JDK_TARGETS :=
|
27560
|
33 |
JRE_TARGETS :=
|
|
34 |
|
|
35 |
# Hook to include the corresponding custom file, if present.
|
|
36 |
$(eval $(call IncludeCustomExtension, , Images-pre.gmk))
|
|
37 |
|
|
38 |
############################################################################
|
|
39 |
|
|
40 |
MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
|
|
41 |
jdk.security.auth jdk.security.jgss jdk.runtime
|
|
42 |
|
|
43 |
# providers
|
|
44 |
PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.localedata \
|
|
45 |
jdk.naming.dns jdk.naming.rmi jdk.scripting.nashorn jdk.zipfs
|
|
46 |
|
|
47 |
# tools
|
|
48 |
TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev jdk.javadoc jdk.jcmd jdk.jconsole \
|
|
49 |
jdk.hotspot.agent jdk.hprof.agent jdk.jdi jdk.jdwp.agent jdk.rmic \
|
|
50 |
jdk.xml.bind jdk.xml.ws
|
|
51 |
|
|
52 |
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
53 |
PROVIDER_MODULES += jdk.crypto.mscapi
|
|
54 |
endif
|
|
55 |
|
|
56 |
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
57 |
PROVIDER_MODULES += jdk.crypto.ucrypto
|
|
58 |
endif
|
|
59 |
|
|
60 |
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
61 |
MAIN_MODULES += jdk.deploy.osx
|
|
62 |
endif
|
|
63 |
|
|
64 |
JRE_MODULES := $(MAIN_MODULES) $(PROVIDER_MODULES)
|
|
65 |
JDK_MODULES := $(JRE_MODULES) $(TOOLS_MODULES)
|
|
66 |
|
|
67 |
# compact3 builds have additional modules
|
|
68 |
JDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \
|
|
69 |
jdk.naming.rmi jdk.sctp jdk.security.auth
|
|
70 |
|
|
71 |
# Replacing double-comma with a single comma is to workaround the issue
|
28356
|
72 |
# with some version of make on windows that doesn't substitute spaces
|
27560
|
73 |
# with one comma properly as with make 4.0
|
|
74 |
define SubstComma
|
|
75 |
$(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1)))
|
|
76 |
endef
|
|
77 |
JRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES))
|
|
78 |
JDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES))
|
|
79 |
|
|
80 |
################################################################################
|
|
81 |
|
|
82 |
JRE_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jre-sorted-modules
|
|
83 |
JDK_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jdk-sorted-modules
|
|
84 |
JRE_COMPACT1_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact1-sorted-modules
|
|
85 |
JRE_COMPACT2_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact2-sorted-modules
|
|
86 |
JRE_COMPACT3_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact3-sorted-modules
|
|
87 |
|
|
88 |
|
|
89 |
MODULES_CMDS := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped
|
|
90 |
MODULES_LIBS := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped
|
|
91 |
MODULES_CONF := $(SUPPORT_OUTPUTDIR)/modules_conf
|
|
92 |
|
|
93 |
JIMAGE_TOOL := $(JAVA_SMALL) \
|
|
94 |
-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
|
|
95 |
-cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.module.ImageBuilder \
|
|
96 |
--cmds $(MODULES_CMDS) \
|
|
97 |
--libs $(MODULES_LIBS) \
|
|
98 |
--configs $(MODULES_CONF) \
|
|
99 |
--classes $(JDK_OUTPUTDIR)/modules \
|
|
100 |
--endian $(OPENJDK_TARGET_CPU_ENDIAN) \
|
|
101 |
#
|
|
102 |
|
|
103 |
MODULES_XML += $(SRC_ROOT)/modules.xml
|
|
104 |
DEPENDENCIES := $(call CacheFind, \
|
|
105 |
$(SUPPORT_OUTPUTDIR)/modules_cmds \
|
|
106 |
$(SUPPORT_OUTPUTDIR)/modules_libs) \
|
|
107 |
$(wildcard $(JDK_OUTPUTDIR)/modules/*/_*) \
|
|
108 |
$(MODULES_XML)
|
|
109 |
#
|
|
110 |
|
|
111 |
# Use this file inside the image as target for make rule
|
|
112 |
JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
|
|
113 |
|
|
114 |
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES)
|
|
115 |
$(ECHO) Creating jdk jimage
|
|
116 |
$(RM) -r $(JDK_IMAGE_DIR) $(JDK_SORTED_MODULES)
|
|
117 |
$(JIMAGE_TOOL) --mods $(JDK_MODULES_LIST) --output $(JDK_IMAGE_DIR) \
|
|
118 |
$(MODULES_XML) > $(JDK_SORTED_MODULES)
|
|
119 |
$(TOUCH) $@
|
|
120 |
|
|
121 |
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES)
|
|
122 |
$(ECHO) Creating jre jimage
|
|
123 |
$(RM) -r $(JRE_IMAGE_DIR) $(JRE_SORTED_MODULES)
|
|
124 |
$(JIMAGE_TOOL) --mods $(JRE_MODULES_LIST) --output $(JRE_IMAGE_DIR) \
|
|
125 |
$(MODULES_XML) > $(JRE_SORTED_MODULES)
|
|
126 |
$(TOUCH) $@
|
|
127 |
|
|
128 |
JRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1
|
|
129 |
JRE_COMPACT2_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact2
|
|
130 |
JRE_COMPACT3_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact3
|
|
131 |
|
|
132 |
COMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
|
|
133 |
|
|
134 |
$(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES)
|
|
135 |
$(ECHO) Creating jre compact1 jimage
|
|
136 |
$(RM) -r $(JRE_COMPACT1_IMAGE_DIR) $(JRE_COMPACT1_SORTED_MODULES)
|
|
137 |
$(JIMAGE_TOOL) \
|
|
138 |
--mods $(call SubstComma, java.compact1 $(COMPACT_EXTRA_MODULES)) \
|
|
139 |
--output $(JRE_COMPACT1_IMAGE_DIR) \
|
|
140 |
$(MODULES_XML) > $(JRE_COMPACT1_SORTED_MODULES)
|
|
141 |
$(TOUCH) $@
|
|
142 |
|
|
143 |
$(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES)
|
|
144 |
$(ECHO) Creating jre compact2 jimage
|
|
145 |
$(RM) -r $(JRE_COMPACT2_IMAGE_DIR) $(JRE_COMPACT2_SORTED_MODULES)
|
|
146 |
$(JIMAGE_TOOL) \
|
|
147 |
--mods $(call SubstComma, java.compact2 $(COMPACT_EXTRA_MODULES)) \
|
|
148 |
--output $(JRE_COMPACT2_IMAGE_DIR) \
|
|
149 |
$(MODULES_XML) > $(JRE_COMPACT2_SORTED_MODULES)
|
|
150 |
$(TOUCH) $@
|
|
151 |
|
|
152 |
$(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES)
|
|
153 |
$(ECHO) Creating jre compact3 jimage
|
|
154 |
$(RM) -r $(JRE_COMPACT3_IMAGE_DIR) $(JRE_COMPACT3_SORTED_MODULES)
|
|
155 |
$(JIMAGE_TOOL) \
|
|
156 |
--mods $(call SubstComma, $(JDK_COMPACT3_MODULES) $(COMPACT_EXTRA_MODULES)) \
|
|
157 |
--output $(JRE_COMPACT3_IMAGE_DIR) \
|
|
158 |
$(MODULES_XML) > $(JRE_COMPACT3_SORTED_MODULES)
|
|
159 |
$(TOUCH) $@
|
|
160 |
|
|
161 |
TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
|
|
162 |
TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
|
|
163 |
TOOL_JRE_COMPACT1_TARGETS := $(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
|
|
164 |
TOOL_JRE_COMPACT2_TARGETS := $(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
|
|
165 |
TOOL_JRE_COMPACT3_TARGETS := $(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
|
|
166 |
|
|
167 |
################################################################################
|
|
168 |
# /man dir
|
|
169 |
#
|
|
170 |
# All variables in this section are assigned with simple =, without :, to enable
|
|
171 |
# more selective overriding from the custom version of this file.
|
|
172 |
#
|
|
173 |
# Avoid evaluating this whole section on windows for speed and stability
|
|
174 |
ifneq ($(OPENJDK_TARGET_OS), windows)
|
|
175 |
JRE_MAN_PAGES += \
|
|
176 |
java.1 \
|
|
177 |
jjs.1 \
|
|
178 |
keytool.1 \
|
|
179 |
orbd.1 \
|
|
180 |
pack200.1 \
|
|
181 |
policytool.1 \
|
|
182 |
rmid.1 \
|
|
183 |
rmiregistry.1 \
|
|
184 |
servertool.1 \
|
|
185 |
tnameserv.1 \
|
|
186 |
unpack200.1
|
|
187 |
|
|
188 |
ifndef OPENJDK
|
|
189 |
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
|
190 |
JRE_MAN_PAGES += javaws.1
|
|
191 |
endif
|
|
192 |
endif
|
|
193 |
|
|
194 |
JDK_MAN_PAGES += \
|
|
195 |
$(JRE_MAN_PAGES) \
|
|
196 |
appletviewer.1 \
|
|
197 |
idlj.1 \
|
|
198 |
jar.1 \
|
|
199 |
jarsigner.1 \
|
|
200 |
javac.1 \
|
|
201 |
javadoc.1 \
|
|
202 |
javah.1 \
|
|
203 |
javap.1 \
|
|
204 |
jconsole.1 \
|
|
205 |
jcmd.1 \
|
|
206 |
jdb.1 \
|
|
207 |
jdeps.1 \
|
|
208 |
jhat.1 \
|
|
209 |
jinfo.1 \
|
|
210 |
jmap.1 \
|
|
211 |
jps.1 \
|
|
212 |
jrunscript.1 \
|
|
213 |
jsadebugd.1 \
|
|
214 |
jstack.1 \
|
|
215 |
jstat.1 \
|
|
216 |
jstatd.1 \
|
|
217 |
native2ascii.1 \
|
|
218 |
rmic.1 \
|
|
219 |
schemagen.1 \
|
|
220 |
serialver.1 \
|
|
221 |
wsgen.1 \
|
|
222 |
wsimport.1 \
|
|
223 |
xjc.1
|
|
224 |
|
|
225 |
# This variable is potentially overridden in the closed makefile.
|
|
226 |
MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
|
|
227 |
|
|
228 |
ifeq ($(OPENJDK_TARGET_OS), linux)
|
|
229 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
|
|
230 |
MAN1_SUBDIR = man
|
|
231 |
endif
|
|
232 |
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
233 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
|
|
234 |
MAN1_SUBDIR = sun/man/man1
|
|
235 |
endif
|
|
236 |
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
237 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
|
|
238 |
MAN1_SUBDIR = man
|
|
239 |
endif
|
|
240 |
|
|
241 |
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
|
|
242 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
243 |
$(install-file)
|
|
244 |
|
|
245 |
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
|
|
246 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
247 |
$(install-file)
|
|
248 |
|
|
249 |
define install-ja-manpage
|
|
250 |
$(MKDIR) -p $(@D)
|
|
251 |
$(CAT) $< \
|
|
252 |
| $(NATIVE2ASCII) -encoding eucJP \
|
|
253 |
| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
|
|
254 |
| $(NATIVE2ASCII) -reverse -encoding $1 \
|
|
255 |
> $@
|
|
256 |
endef
|
|
257 |
|
|
258 |
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
259 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
260 |
$(call install-ja-manpage, UTF-8)
|
|
261 |
|
|
262 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
263 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
264 |
$(call install-ja-manpage, UTF-8)
|
|
265 |
|
|
266 |
$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
267 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
268 |
$(call install-ja-manpage, PCK)
|
|
269 |
|
|
270 |
$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
271 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
272 |
$(call install-ja-manpage, PCK)
|
|
273 |
|
|
274 |
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
275 |
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
276 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
277 |
$(install-file)
|
|
278 |
|
|
279 |
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
|
280 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
281 |
$(install-file)
|
|
282 |
endif
|
|
283 |
|
|
284 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
|
|
285 |
$(JRE_IMAGE_DIR)/man/ja:
|
|
286 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
287 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
|
288 |
|
|
289 |
$(JDK_IMAGE_DIR)/man/ja:
|
|
290 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
291 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
|
292 |
endif
|
|
293 |
|
|
294 |
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
295 |
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
|
|
296 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
|
|
297 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
|
|
298 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
|
|
299 |
|
|
300 |
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
|
|
301 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
|
|
302 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
|
|
303 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
|
|
304 |
endif
|
|
305 |
|
|
306 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
|
|
307 |
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
|
|
308 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
|
|
309 |
$(JRE_IMAGE_DIR)/man/ja
|
|
310 |
|
|
311 |
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
|
|
312 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
|
|
313 |
$(JDK_IMAGE_DIR)/man/ja
|
|
314 |
endif
|
|
315 |
|
|
316 |
JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
|
|
317 |
JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
|
|
318 |
endif # Windows
|
|
319 |
|
|
320 |
################################################################################
|
|
321 |
# /include dir
|
|
322 |
|
|
323 |
$(eval $(call SetupCopyFiles,COPY_INCLUDES, \
|
|
324 |
SRC := $(JDK_OUTPUTDIR)/include, \
|
|
325 |
DEST := $(JDK_IMAGE_DIR)/include, \
|
|
326 |
FILES := $(call CacheFind,$(JDK_OUTPUTDIR)/include)))
|
|
327 |
|
|
328 |
JDK_TARGETS += $(COPY_INCLUDES)
|
|
329 |
|
|
330 |
################################################################################
|
|
331 |
# doc files
|
|
332 |
|
|
333 |
JRE_DOC_FILES ?= LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
|
|
334 |
JDK_DOC_FILES ?= LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
|
|
335 |
JRE_DOC_LOCATION ?= $(JDK_TOPDIR)
|
|
336 |
JDK_DOC_LOCATION ?= $(JDK_TOPDIR)
|
|
337 |
|
|
338 |
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
|
|
339 |
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))
|
|
340 |
|
|
341 |
# Processing license files from source area to image area
|
|
342 |
# These are modified to have the platform specific EOL chars.
|
|
343 |
define process-doc-file
|
|
344 |
$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
345 |
$(MKDIR) -p $(@D)
|
|
346 |
$(RM) $@
|
|
347 |
LC_ALL=C $(SED) 's/$$//g' $< > $@
|
|
348 |
$(CHMOD) 444 $@
|
|
349 |
endef
|
|
350 |
|
|
351 |
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
|
|
352 |
$(process-doc-file)
|
|
353 |
|
|
354 |
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
|
|
355 |
$(process-doc-file)
|
|
356 |
|
|
357 |
JRE_TARGETS += $(JRE_DOC_TARGETS)
|
|
358 |
JDK_TARGETS += $(JDK_DOC_TARGETS)
|
|
359 |
|
|
360 |
################################################################################
|
|
361 |
# Release file
|
|
362 |
|
|
363 |
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
|
|
364 |
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
|
|
365 |
JRE_COMPACT1_INFO_FILE := $(JRE_COMPACT1_IMAGE_DIR)/release
|
|
366 |
JRE_COMPACT2_INFO_FILE := $(JRE_COMPACT2_IMAGE_DIR)/release
|
|
367 |
JRE_COMPACT3_INFO_FILE := $(JRE_COMPACT3_IMAGE_DIR)/release
|
|
368 |
|
|
369 |
# Common way to emit a line into the release or info file
|
|
370 |
define info-file-item # name value
|
|
371 |
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
|
|
372 |
endef
|
|
373 |
|
|
374 |
# Param 1 - The file containing the MODULES list
|
|
375 |
define create-info-file
|
|
376 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
377 |
$(MKDIR) -p $(@D)
|
|
378 |
$(RM) $@
|
|
379 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
|
|
380 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
|
|
381 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
|
|
382 |
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
|
|
383 |
$(if $(JDK_ARCH_ABI_PROP_NAME), \
|
|
384 |
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
|
|
385 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)")
|
|
386 |
$(call info-file-item, "MODULES", "`$(CAT) $1`")
|
|
387 |
endef
|
|
388 |
|
|
389 |
ALL_SOURCE_TIPS = $(shell \
|
|
390 |
if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
|
|
391 |
$(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
|
|
392 |
fi)
|
|
393 |
|
|
394 |
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(SUPPORT_OUTPUTDIR)/source_tips
|
|
395 |
$(call create-info-file, $(JRE_SORTED_MODULES))
|
|
396 |
|
|
397 |
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(SUPPORT_OUTPUTDIR)/source_tips
|
|
398 |
$(call create-info-file, $(JDK_SORTED_MODULES))
|
|
399 |
|
|
400 |
$(JRE_COMPACT1_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(SUPPORT_OUTPUTDIR)/source_tips
|
|
401 |
$(call create-info-file, $(JRE_COMPACT1_SORTED_MODULES))
|
|
402 |
$(call info-file-item, "JAVA_PROFILE", "compact1")
|
|
403 |
|
|
404 |
$(JRE_COMPACT2_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(SUPPORT_OUTPUTDIR)/source_tips
|
|
405 |
$(call create-info-file, $(JRE_COMPACT2_SORTED_MODULES))
|
|
406 |
$(call info-file-item, "JAVA_PROFILE", "compact2")
|
|
407 |
|
|
408 |
$(JRE_COMPACT3_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(SUPPORT_OUTPUTDIR)/source_tips
|
|
409 |
$(call create-info-file, $(JRE_COMPACT3_SORTED_MODULES))
|
|
410 |
$(call info-file-item, "JAVA_PROFILE", "compact3")
|
|
411 |
|
|
412 |
JRE_TARGETS += $(JRE_INFO_FILE)
|
|
413 |
JDK_TARGETS += $(JDK_INFO_FILE)
|
|
414 |
JRE_COMPACT1_TARGETS += $(JRE_COMPACT1_INFO_FILE)
|
|
415 |
JRE_COMPACT2_TARGETS += $(JRE_COMPACT2_INFO_FILE)
|
|
416 |
JRE_COMPACT3_TARGETS += $(JRE_COMPACT3_INFO_FILE)
|
|
417 |
|
|
418 |
################################################################################
|
|
419 |
# src.zip
|
|
420 |
|
|
421 |
$(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
|
|
422 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
|
423 |
$(install-file)
|
|
424 |
|
|
425 |
JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
|
|
426 |
|
|
427 |
################################################################################
|
|
428 |
# /demo dir
|
|
429 |
|
|
430 |
# The db demo contains an empty dir that needs to be copied. The other
|
|
431 |
# directories will always trigger the rule for recompile since
|
|
432 |
# _the.list_of_packages files are touched.
|
|
433 |
ifneq ($(findstring images, $(MAKECMDGOALS)), )
|
|
434 |
$(JDK_IMAGE_DIR)/demo/%: $(SUPPORT_OUTPUTDIR)/demo/image/%
|
|
435 |
if [ ! -d "$@" ]; then \
|
|
436 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
|
|
437 |
$(MKDIR) -p $(@D); \
|
|
438 |
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
|
|
439 |
fi
|
|
440 |
|
|
441 |
# Find all files including directories
|
|
442 |
JDK_DEMO_TARGETS := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demo/image), \
|
|
443 |
$(patsubst $(SUPPORT_OUTPUTDIR)/demo/image/%, $(JDK_IMAGE_DIR)/demo/%, \
|
|
444 |
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demo/image \
|
|
445 |
! \( -name "_the*" -o -name "javac_state" \) )))
|
|
446 |
|
|
447 |
JDK_TARGETS += $(JDK_DEMO_TARGETS)
|
|
448 |
endif
|
|
449 |
|
|
450 |
################################################################################
|
|
451 |
# /sample dir
|
|
452 |
|
|
453 |
$(eval $(call SetupCopyFiles,COPY_SAMPLES, \
|
|
454 |
SRC := $(SUPPORT_OUTPUTDIR)/sample, \
|
|
455 |
DEST := $(JDK_IMAGE_DIR)/sample, \
|
|
456 |
FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/sample), \
|
|
457 |
$(call CacheFind,$(SUPPORT_OUTPUTDIR)/sample))))
|
|
458 |
|
|
459 |
JDK_TARGETS += $(COPY_SAMPLES)
|
|
460 |
|
|
461 |
################################################################################
|
|
462 |
# jrt-fs.jar
|
|
463 |
|
|
464 |
$(eval $(call SetupCopyFiles,COPY_JRTFS_JAR, \
|
|
465 |
SRC := $(SUPPORT_OUTPUTDIR), \
|
|
466 |
DEST := $(JDK_IMAGE_DIR), \
|
|
467 |
FILES := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar))
|
|
468 |
|
|
469 |
JDK_TARGETS += $(COPY_JRTFS_JAR)
|
|
470 |
|
|
471 |
################################################################################
|
|
472 |
|
|
473 |
# Include custom post hook here to make it possible to augment the target lists
|
|
474 |
# before actual target prerequisites are declared.
|
|
475 |
$(eval $(call IncludeCustomExtension, , Images-post.gmk))
|
|
476 |
|
|
477 |
################################################################################
|
|
478 |
|
|
479 |
$(JRE_TARGETS): $(TOOL_JRE_TARGETS)
|
|
480 |
$(JDK_TARGETS): $(TOOL_JDK_TARGETS)
|
|
481 |
|
|
482 |
jimages: $(TOOL_JRE_TARGETS) $(TOOL_JDK_TARGETS) $(JRE_TARGETS) $(JDK_TARGETS)
|
|
483 |
|
|
484 |
|
|
485 |
$(JRE_COMPACT1_TARGETS): $(TOOL_JRE_COMPACT1_TARGETS)
|
|
486 |
$(JRE_COMPACT2_TARGETS): $(TOOL_JRE_COMPACT2_TARGETS)
|
|
487 |
$(JRE_COMPACT3_TARGETS): $(TOOL_JRE_COMPACT3_TARGETS)
|
|
488 |
|
|
489 |
profiles: $(TOOL_JRE_COMPACT1_TARGETS) \
|
|
490 |
$(TOOL_JRE_COMPACT2_TARGETS) \
|
|
491 |
$(TOOL_JRE_COMPACT3_TARGETS) \
|
|
492 |
$(JRE_COMPACT1_TARGETS) \
|
|
493 |
$(JRE_COMPACT2_TARGETS) \
|
|
494 |
$(JRE_COMPACT3_TARGETS)
|
|
495 |
|
|
496 |
.PHONY: default all jimages profiles
|