author | dmocek |
Mon, 19 Nov 2012 13:54:12 -0800 | |
changeset 16094 | ac85c7fc438d |
parent 13702 | efd6a05935b2 |
child 14231 | a0c23c1c010f |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
26 |
include $(SPEC) |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
27 |
include MakeBase.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
include JavaCompilation.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
include Setup.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
|
12892 | 31 |
default: images |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
include Tools.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
|
13702 | 35 |
# Note: This double-colon rule is intentional, to support |
36 |
# custom make file integration. |
|
37 |
images:: jre-image jdk-image |
|
38 |
||
39 |
overlay-images: jre-overlay-image jdk-overlay-image |
|
40 |
||
41 |
||
42 |
-include $(CUSTOM_MAKE_DIR)/Images.gmk |
|
43 |
||
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
|
13164 | 45 |
ifeq ($(OPENJDK_TARGET_OS),solaris) |
13702 | 46 |
# On Solaris, if the target is a symlink and exists, cp won't overwrite. |
12892 | 47 |
define install-file |
48 |
$(MKDIR) -p $(@D) |
|
13702 | 49 |
$(RM) '$@' |
13164 | 50 |
$(CP) -f -r -P '$<' '$(@D)' |
51 |
endef |
|
52 |
else ifeq ($(OPENJDK_TARGET_OS),macosx) |
|
53 |
define install-file |
|
54 |
$(MKDIR) -p $(@D) |
|
55 |
$(CP) -fpRP '$<' '$@' |
|
12892 | 56 |
endef |
57 |
else |
|
58 |
define install-file |
|
59 |
$(MKDIR) -p $(@D) |
|
13164 | 60 |
$(CP) -fP '$<' '$@' |
12892 | 61 |
endef |
62 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
63 |
|
13702 | 64 |
# Processing license files from source area to image area |
65 |
# These will be modified to have the platform specific EOL chars. |
|
66 |
define process-doc-file |
|
67 |
$(ECHO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
68 |
$(MKDIR) -p $(@D) |
|
69 |
$(RM) $@ |
|
70 |
$(SED) 's/$$//g' $< > $@ |
|
71 |
$(CHMOD) 444 $@ |
|
72 |
endef |
|
73 |
||
74 |
||
75 |
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image |
|
76 |
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image |
|
77 |
||
78 |
JDK_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-overlay-image |
|
79 |
JRE_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-overlay-image |
|
80 |
||
12892 | 81 |
################################################################################ |
82 |
# |
|
83 |
# JRE and JDK build rules |
|
84 |
# |
|
85 |
################################################################################ |
|
13702 | 86 |
# |
87 |
# Variable prefixes explained: |
|
88 |
# JRE_ refers to files in the j2re-image. |
|
89 |
# JDK_ refers to files in the j2sdk-image outside of the jre subdir. |
|
90 |
# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir. |
|
91 |
# |
|
12892 | 92 |
|
93 |
################################################################################ |
|
94 |
# /bin dir |
|
95 |
||
96 |
$(JRE_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
97 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
98 |
$(install-file) |
|
99 |
||
100 |
$(JDK_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
101 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
102 |
$(install-file) |
|
103 |
||
104 |
$(JDK_IMAGE_DIR)/jre/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
105 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
106 |
$(install-file) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
107 |
|
13702 | 108 |
# Overaly image targets |
109 |
$(JRE_OVERLAY_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
110 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
111 |
$(install-file) |
|
112 |
||
113 |
$(JDK_OVERLAY_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
114 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
115 |
$(install-file) |
|
116 |
||
117 |
$(JDK_OVERLAY_IMAGE_DIR)/jre/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
118 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
119 |
$(install-file) |
|
120 |
||
13164 | 121 |
NOT_JRE_BIN_FILES := \ |
12892 | 122 |
appletviewer$(EXE_SUFFIX) \ |
123 |
extcheck$(EXE_SUFFIX) \ |
|
124 |
idlj$(EXE_SUFFIX) \ |
|
125 |
jar$(EXE_SUFFIX) \ |
|
126 |
jarsigner$(EXE_SUFFIX) \ |
|
127 |
java-rmi.cgi \ |
|
128 |
javac$(EXE_SUFFIX) \ |
|
129 |
javadoc$(EXE_SUFFIX) \ |
|
130 |
javah$(EXE_SUFFIX) \ |
|
131 |
javap$(EXE_SUFFIX) \ |
|
132 |
jcmd$(EXE_SUFFIX) \ |
|
133 |
jdb$(EXE_SUFFIX) \ |
|
134 |
jps$(EXE_SUFFIX) \ |
|
135 |
jrunscript$(EXE_SUFFIX) \ |
|
136 |
jstat$(EXE_SUFFIX) \ |
|
137 |
jstatd$(EXE_SUFFIX) \ |
|
138 |
jstack$(EXE_SUFFIX) \ |
|
139 |
packagebean$(SCRIPT_SUFFIX) \ |
|
140 |
rmic$(EXE_SUFFIX) \ |
|
141 |
serialver$(EXE_SUFFIX) \ |
|
142 |
unregbean$(EXE_SUFFIX) \ |
|
143 |
jconsole$(EXE_SUFFIX) \ |
|
144 |
jinfo$(EXE_SUFFIX) \ |
|
145 |
jmap$(EXE_SUFFIX) \ |
|
146 |
native2ascii$(EXE_SUFFIX) \ |
|
147 |
xjc$(EXE_SUFFIX) \ |
|
148 |
wsgen$(EXE_SUFFIX) \ |
|
149 |
wsimport$(EXE_SUFFIX) \ |
|
150 |
schemagen$(EXE_SUFFIX) \ |
|
151 |
jsadebugd$(EXE_SUFFIX) \ |
|
152 |
jhat$(EXE_SUFFIX) |
|
153 |
||
154 |
WINDOWS_JDK_BIN_FILES = \ |
|
155 |
$(EXE_SUFFIX) \ |
|
13702 | 156 |
$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ |
157 |
$(notdir $(MSVCRNN_DLL)) |
|
158 |
||
159 |
WINDOWS_JDKJRE_BIN_FILES := \ |
|
160 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
161 |
$(SALIB_NAME) |
|
12892 | 162 |
|
163 |
# Find all files in bin dir |
|
164 |
ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) |
|
13164 | 165 |
|
13702 | 166 |
# For unknown reason the debuginfo files for executables are not put into images |
13164 | 167 |
# e.g filter them out |
13702 | 168 |
ifneq ($(OPENJDK_TARGET_OS),windows) |
169 |
ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST)) |
|
170 |
else |
|
171 |
# On windows, the libraries are in the bin dir, only filter out debuginfo files |
|
172 |
# for executables. "java" is both a library and executable. |
|
173 |
ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name "*.exe"))) |
|
174 |
ALL_BIN_DEBUG_FILTER := $(addprefix %,$(patsubst %.exe,%.debuginfo,$(ALL_BIN_EXEC_FILES)) \ |
|
175 |
$(patsubst %.exe,%.diz,$(ALL_BIN_EXEC_FILES))) %.pdb |
|
176 |
ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER),$(ALL_BIN_LIST)) |
|
177 |
endif |
|
13164 | 178 |
|
179 |
ifeq ($(OPENJDK_TARGET_OS),windows) |
|
12892 | 180 |
JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST)) |
181 |
else |
|
182 |
JDK_BIN_LIST := $(ALL_BIN_LIST) |
|
183 |
endif |
|
13702 | 184 |
JDKJRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST)) |
185 |
JRE_BIN_LIST := $(filter-out $(addprefix %,$(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST)) |
|
186 |
||
187 |
ifneq ($(OPENJDK_TARGET_CPU_ISADIR),) |
|
188 |
OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)% |
|
189 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
190 |
|
13702 | 191 |
JRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%, \ |
192 |
$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST))) |
|
193 |
JDK_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%, \ |
|
194 |
$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST))) |
|
195 |
JDKJRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%, \ |
|
196 |
$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST))) |
|
197 |
||
198 |
JRE_OVERLAY_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_OVERLAY_IMAGE_DIR)/%, \ |
|
199 |
$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST))) |
|
200 |
JDK_OVERLAY_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_OVERLAY_IMAGE_DIR)/%, \ |
|
201 |
$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST))) |
|
202 |
JDKJRE_OVERLAY_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_OVERLAY_IMAGE_DIR)/jre/%, \ |
|
203 |
$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST))) |
|
12892 | 204 |
|
205 |
################################################################################ |
|
206 |
# /lib dir |
|
207 |
||
208 |
$(JRE_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
209 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
210 |
$(install-file) |
|
211 |
||
212 |
$(JDK_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
213 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
214 |
$(install-file) |
|
215 |
||
216 |
$(JDK_IMAGE_DIR)/jre/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
217 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
218 |
$(install-file) |
|
219 |
||
13702 | 220 |
# Overlay image targets |
221 |
$(JRE_OVERLAY_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
222 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
223 |
$(install-file) |
|
224 |
||
225 |
$(JDK_OVERLAY_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
226 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
227 |
$(install-file) |
|
228 |
||
229 |
$(JDK_OVERLAY_IMAGE_DIR)/jre/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
230 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
231 |
$(install-file) |
|
232 |
||
233 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
234 |
JDKJRE_LIB_FILES := \ |
|
235 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
12892 | 236 |
$(SALIB_NAME) |
13702 | 237 |
endif |
12892 | 238 |
|
239 |
NOT_JRE_LIB_FILES := \ |
|
240 |
tools.jar \ |
|
241 |
jconsole.jar \ |
|
242 |
sa-jdi.jar \ |
|
243 |
dt.jar \ |
|
244 |
orb.idl \ |
|
245 |
ir.idl \ |
|
246 |
ct.sym |
|
247 |
||
13702 | 248 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
249 |
NOT_JRE_LIB_FILES += jawt.lib jvm.lib |
|
250 |
endif |
|
251 |
||
12892 | 252 |
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES) |
13164 | 253 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
12892 | 254 |
JDK_LIB_FILES += jexec |
255 |
endif |
|
256 |
||
13702 | 257 |
ALL_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) ) |
12892 | 258 |
JRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),$(ALL_LIB_LIST)) |
259 |
JDKJRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_LIB_LIST)) |
|
260 |
JDK_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_LIB_LIST)) |
|
261 |
||
262 |
JRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%,$(JRE_LIB_LIST)) |
|
263 |
JDK_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%,$(JDK_LIB_LIST)) |
|
264 |
JDKJRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%,$(JDKJRE_LIB_LIST)) |
|
265 |
||
13702 | 266 |
JRE_OVERLAY_LIB_TARGETS := $(subst $(JRE_IMAGE_DIR),$(JRE_OVERLAY_IMAGE_DIR),\ |
267 |
$(filter $(JRE_IMAGE_DIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_LIB_TARGETS))) |
|
268 |
JDK_OVERLAY_LIB_TARGETS := $(subst $(JDK_IMAGE_DIR),$(JDK_OVERLAY_IMAGE_DIR),\ |
|
269 |
$(filter $(JDK_IMAGE_DIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_LIB_TARGETS))) |
|
270 |
JDKJRE_OVERLAY_LIB_TARGETS := $(subst $(JDK_IMAGE_DIR),$(JDK_OVERLAY_IMAGE_DIR),\ |
|
271 |
$(filter $(JDK_IMAGE_DIR)/jre/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_LIB_TARGETS))) |
|
272 |
||
12892 | 273 |
# CTE plugin security change require new empty directory lib/applet |
274 |
$(JRE_IMAGE_DIR)/lib/applet: |
|
275 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
276 |
$(MKDIR) -p $@ |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
277 |
|
12892 | 278 |
$(JDK_IMAGE_DIR)/jre/lib/applet: |
279 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
280 |
$(MKDIR) -p $@ |
|
281 |
||
13702 | 282 |
# In the old build, JObjC.jar is not part of the meta-index |
12892 | 283 |
$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS) |
284 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
13702 | 285 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'` |
12892 | 286 |
|
287 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS) |
|
288 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
13702 | 289 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'` |
12892 | 290 |
|
291 |
$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS) |
|
292 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
293 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
294 |
|
13702 | 295 |
$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS) |
12892 | 296 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
297 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
298 |
||
299 |
################################################################################ |
|
300 |
# /man dir |
|
301 |
||
302 |
JRE_MAN_PAGES := \ |
|
303 |
java.1 \ |
|
304 |
keytool.1 \ |
|
305 |
orbd.1 \ |
|
306 |
pack200.1 \ |
|
307 |
policytool.1 \ |
|
308 |
rmid.1 \ |
|
309 |
rmiregistry.1 \ |
|
310 |
servertool.1 \ |
|
311 |
tnameserv.1 \ |
|
312 |
unpack200.1 |
|
313 |
||
314 |
ifndef OPENJDK |
|
315 |
JRE_MAN_PAGES += javaws.1 |
|
316 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
317 |
|
12892 | 318 |
JDK_MAN_PAGES = \ |
319 |
$(JRE_MAN_PAGES) \ |
|
320 |
appletviewer.1 \ |
|
321 |
extcheck.1 \ |
|
322 |
idlj.1 \ |
|
323 |
jar.1 \ |
|
324 |
jarsigner.1 \ |
|
325 |
javac.1 \ |
|
326 |
javadoc.1 \ |
|
327 |
javah.1 \ |
|
328 |
javap.1 \ |
|
329 |
jconsole.1 \ |
|
330 |
jcmd.1 \ |
|
331 |
jdb.1 \ |
|
332 |
jhat.1 \ |
|
333 |
jinfo.1 \ |
|
334 |
jmap.1 \ |
|
335 |
jps.1 \ |
|
336 |
jrunscript.1 \ |
|
337 |
jsadebugd.1 \ |
|
338 |
jstack.1 \ |
|
339 |
jstat.1 \ |
|
340 |
jstatd.1 \ |
|
341 |
native2ascii.1 \ |
|
342 |
rmic.1 \ |
|
343 |
schemagen.1 \ |
|
344 |
serialver.1 \ |
|
345 |
wsgen.1 \ |
|
346 |
wsimport.1 \ |
|
347 |
xjc.1 |
|
348 |
||
13497
2c09fb7cdf7f
7192804: Build should not install jvisualvm man page for OpenJDK
andrew
parents:
13164
diff
changeset
|
349 |
ifndef OPENJDK |
2c09fb7cdf7f
7192804: Build should not install jvisualvm man page for OpenJDK
andrew
parents:
13164
diff
changeset
|
350 |
JDK_MAN_PAGES += jvisualvm.1 |
2c09fb7cdf7f
7192804: Build should not install jvisualvm man page for OpenJDK
andrew
parents:
13164
diff
changeset
|
351 |
endif |
2c09fb7cdf7f
7192804: Build should not install jvisualvm man page for OpenJDK
andrew
parents:
13164
diff
changeset
|
352 |
|
13164 | 353 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
12892 | 354 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc |
355 |
MAN1_SUBDIR:=man |
|
356 |
endif |
|
13164 | 357 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
12892 | 358 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc |
359 |
MAN1_SUBDIR:=sun/man/man1 |
|
360 |
endif |
|
13164 | 361 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
362 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/bsd/doc |
|
363 |
MAN1_SUBDIR:=man |
|
364 |
JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES)) |
|
365 |
JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES)) |
|
366 |
endif |
|
367 |
||
12892 | 368 |
|
369 |
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
|
370 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
371 |
$(install-file) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
372 |
|
12892 | 373 |
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
374 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
375 |
$(install-file) |
|
376 |
||
377 |
$(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
|
378 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
379 |
$(install-file) |
|
380 |
||
381 |
$(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
|
382 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
383 |
$(install-file) |
|
384 |
||
385 |
define install-ja-manpage |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
386 |
$(MKDIR) -p $(@D) |
12892 | 387 |
$(CAT) $< \ |
388 |
| $(NATIVE2ASCII) -encoding eucJP \ |
|
389 |
| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \ |
|
390 |
| $(NATIVE2ASCII) -reverse -encoding $1 \ |
|
391 |
> $@ |
|
392 |
endef |
|
393 |
||
394 |
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
395 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
396 |
$(call install-ja-manpage,UTF-8) |
|
397 |
||
398 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
399 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
400 |
$(call install-ja-manpage,UTF-8) |
|
401 |
||
402 |
$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
403 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
404 |
$(call install-ja-manpage,PCK) |
|
405 |
||
406 |
$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
407 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
408 |
$(call install-ja-manpage,PCK) |
|
409 |
||
13164 | 410 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
12892 | 411 |
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
412 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
413 |
$(install-file) |
|
414 |
||
415 |
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
416 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
417 |
$(install-file) |
|
418 |
endif |
|
419 |
||
420 |
# Old build creates empty man page for this, mimicing behaviour. |
|
421 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja/man1/jcmd.1: |
|
422 |
$(ECHO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
423 |
$(MKDIR) -p $(@D) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
424 |
$(TOUCH) $@ |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
425 |
|
13164 | 426 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
427 |
$(JRE_IMAGE_DIR)/man/ja: |
|
428 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
429 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
430 |
||
431 |
$(JDK_IMAGE_DIR)/man/ja: |
|
432 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
433 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
434 |
endif |
|
435 |
||
436 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
12892 | 437 |
$(JRE_IMAGE_DIR)/man/ja: |
438 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
439 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
440 |
||
441 |
$(JDK_IMAGE_DIR)/man/ja: |
|
442 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
443 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
444 |
endif |
|
445 |
||
13164 | 446 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
12892 | 447 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
448 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
449 |
$(JRE_IMAGE_DIR)/man/ja |
|
450 |
||
451 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
|
452 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
453 |
$(JDK_IMAGE_DIR)/man/ja |
|
454 |
endif |
|
455 |
||
13164 | 456 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
12892 | 457 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
458 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \ |
|
459 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
460 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES)) |
|
461 |
||
462 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
|
463 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \ |
|
464 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
465 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES)) |
|
466 |
endif |
|
467 |
||
13164 | 468 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
469 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
470 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
471 |
$(JRE_IMAGE_DIR)/man/ja |
|
472 |
||
473 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
|
474 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
475 |
$(JDK_IMAGE_DIR)/man/ja |
|
476 |
endif |
|
477 |
||
12892 | 478 |
################################################################################ |
479 |
# /demo dir |
|
480 |
||
481 |
ifndef NO_DEMOS |
|
13702 | 482 |
# FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied. |
12892 | 483 |
|
484 |
# The db demo contains an empty dir that needs to be copied. The other |
|
485 |
# directories will always trigger the rule for recompile since |
|
486 |
# _the.list_of_packages files are touched. |
|
13702 | 487 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/% |
12892 | 488 |
if [ ! -d "$@" ]; then \ |
489 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \ |
|
490 |
$(MKDIR) -p $(@D); \ |
|
491 |
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \ |
|
492 |
fi |
|
493 |
||
494 |
# Find all files including directories |
|
13702 | 495 |
JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%,$(JDK_IMAGE_DIR)/demo/%,\ |
496 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) )) |
|
497 |
||
498 |
||
499 |
||
500 |
# Param 1 is source file |
|
501 |
define CreateOverlayDemoRule |
|
502 |
$1_TARGET:=$$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),\ |
|
503 |
$$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)) |
|
504 |
$$($1_TARGET): $1 |
|
505 |
$(ECHO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)' |
|
506 |
$(MKDIR) -p $$(@D) |
|
507 |
$(RM) $$@ |
|
508 |
$(CP) -f '$$<' '$$@' |
|
509 |
||
510 |
JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET) |
|
511 |
endef |
|
512 |
JDK_OVERLAY_DEMO_SOURCES := $(shell $(FIND) $(JDK_OUTPUTDIR)/demo -name "*$(SHARED_LIBRARY_SUFFIX)") |
|
513 |
$(foreach lib,$(JDK_OVERLAY_DEMO_SOURCES),$(eval $(call CreateOverlayDemoRule,$(lib)))) |
|
12892 | 514 |
|
515 |
endif |
|
516 |
||
517 |
################################################################################ |
|
518 |
# /sample dir |
|
519 |
||
520 |
ifndef NO_SAMPLES |
|
521 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_OUTPUTDIR)/sample/% |
|
522 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
523 |
$(install-file) |
|
524 |
||
525 |
JDK_SAMPLE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/sample/%,$(JDK_IMAGE_DIR)/sample/%,\ |
|
526 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/sample -type f)) |
|
527 |
||
528 |
endif |
|
529 |
||
530 |
################################################################################ |
|
531 |
# /db dir |
|
532 |
||
533 |
ifndef OPENJDK |
|
534 |
$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/% |
|
535 |
$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) |
|
536 |
$(MKDIR) -p $(JDK_IMAGE_DIR)/db |
|
537 |
cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $< -x index.html 2> /dev/null |
|
538 |
$(MKDIR) -p $(@D) |
|
539 |
$(TOUCH) $@ |
|
540 |
||
541 |
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html |
|
542 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
543 |
$(install-file) |
|
13164 | 544 |
$(CHMOD) 644 $(@) |
12892 | 545 |
|
546 |
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\ |
|
547 |
$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \ |
|
548 |
$(JDK_IMAGE_DIR)/db/README-JDK.html |
|
549 |
||
550 |
endif |
|
551 |
||
552 |
################################################################################ |
|
553 |
# /include dir |
|
554 |
||
555 |
$(JDK_IMAGE_DIR)/include/%: $(JDK_OUTPUTDIR)/include/% |
|
556 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
557 |
$(install-file) |
|
558 |
||
559 |
JDK_INCLUDE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/include/%,$(JDK_IMAGE_DIR)/include/%,\ |
|
560 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/include -type f)) |
|
561 |
||
562 |
################################################################################ |
|
563 |
# doc files |
|
564 |
||
565 |
ifdef OPENJDK |
|
566 |
JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
567 |
JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
568 |
JRE_DOC_LOCATION := $(JDK_TOPDIR) |
|
569 |
JDK_DOC_LOCATION := $(JDK_TOPDIR) |
|
570 |
else |
|
571 |
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
572 |
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
13164 | 573 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
12892 | 574 |
JRE_DOC_FILES += README.txt |
575 |
else |
|
576 |
JRE_DOC_FILES += README |
|
577 |
endif |
|
578 |
ifndef NO_DEMOS |
|
579 |
JDK_DOC_FILES += demo/DEMOS_LICENSE |
|
580 |
endif |
|
581 |
ifndef NO_SAMPLES |
|
582 |
JDK_DOC_FILES += sample/SAMPLES_LICENSE |
|
583 |
endif |
|
584 |
JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre |
|
585 |
JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk |
|
586 |
endif |
|
587 |
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES)) |
|
588 |
JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES)) |
|
589 |
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES)) |
|
590 |
||
591 |
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 592 |
$(process-doc-file) |
12892 | 593 |
|
594 |
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 595 |
$(process-doc-file) |
12892 | 596 |
|
597 |
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 598 |
$(process-doc-file) |
12892 | 599 |
|
600 |
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 601 |
$(process-doc-file) |
12892 | 602 |
|
603 |
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 604 |
$(process-doc-file) |
12892 | 605 |
|
606 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 607 |
$(process-doc-file) |
12892 | 608 |
|
609 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 610 |
$(process-doc-file) |
12892 | 611 |
|
612 |
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release |
|
613 |
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release |
|
614 |
||
13702 | 615 |
JRE_OVERLAY_INFO_FILE := $(JRE_OVERLAY_IMAGE_DIR)/release |
616 |
JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release |
|
617 |
||
12892 | 618 |
# Common way to emit a line into the release or info file |
619 |
define info-file-item # name value |
|
620 |
$(PRINTF) '%s="%s"\n' $1 $2 >> $@ |
|
621 |
endef |
|
622 |
||
13702 | 623 |
define create-info-file |
624 |
$(MKDIR) -p $(@D) |
|
625 |
$(RM) $@ |
|
626 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)") |
|
627 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)") |
|
628 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)") |
|
629 |
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)") |
|
630 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)") |
|
631 |
endef |
|
632 |
||
12892 | 633 |
ALL_SOURCE_TIPS = $(shell \ |
634 |
if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \ |
|
635 |
$(CAT) $(OUTPUT_ROOT)/source_tips ; \ |
|
636 |
fi) |
|
637 |
||
638 |
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
639 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
13702 | 640 |
$(call create-info-file) |
12892 | 641 |
|
642 |
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
643 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
13702 | 644 |
$(call create-info-file) |
645 |
||
646 |
$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
647 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
648 |
$(call create-info-file) |
|
649 |
||
650 |
$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
651 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
652 |
$(call create-info-file) |
|
12892 | 653 |
|
654 |
$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip |
|
655 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
656 |
$(install-file) |
|
657 |
||
658 |
################################################################################ |
|
659 |
# Post processing (strip etc) |
|
660 |
||
661 |
ifneq ($(POST_STRIP_CMD),) |
|
13164 | 662 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
13702 | 663 |
EXEC_LIST_BIN:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \ |
12892 | 664 |
-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)") |
665 |
else |
|
666 |
# Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed |
|
13702 | 667 |
EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \ |
12892 | 668 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1) |
13702 | 669 |
# On mac, the old build searches for static libraries for stripping instead of shared. |
670 |
# Not clear if it's intentional. |
|
671 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
672 |
EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX)) |
|
673 |
endif |
|
12892 | 674 |
endif |
13702 | 675 |
|
676 |
# Filter out the overlay specific bin files |
|
677 |
EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
678 |
EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
679 |
||
12892 | 680 |
# Filter out non JRE files and convert to unique touch files to depend on |
13702 | 681 |
JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\ |
682 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
683 |
$(EXEC_LIST))) |
|
13164 | 684 |
|
13702 | 685 |
JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
13164 | 686 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \ |
12892 | 687 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST))) |
688 |
||
13702 | 689 |
JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
13164 | 690 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \ |
691 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST))) |
|
692 |
||
13702 | 693 |
# Do the same for overlay image |
694 |
JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\ |
|
695 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
696 |
$(EXEC_LIST_OVERLAY))) |
|
697 |
||
698 |
JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
|
699 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \ |
|
700 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY))) |
|
701 |
||
702 |
JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
|
703 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \ |
|
704 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY))) |
|
705 |
||
706 |
define mcs-file |
|
707 |
$(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<) |
|
708 |
endef |
|
709 |
||
710 |
define strip-file |
|
711 |
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<) |
|
712 |
$(CHMOD) u+w $< |
|
713 |
$(POST_STRIP_CMD) $< |
|
714 |
$(call mcs-file) |
|
715 |
$(CHMOD) go-w $< |
|
716 |
$(MKDIR) -p $(@D) |
|
717 |
$(TOUCH) $@ |
|
718 |
endef |
|
719 |
||
12892 | 720 |
# Setup a rule for stripping files based on touch files |
13164 | 721 |
$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/% |
13702 | 722 |
$(call strip-file) |
723 |
||
724 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/% |
|
725 |
$(call strip-file) |
|
13164 | 726 |
|
13702 | 727 |
$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/% |
728 |
$(call strip-file) |
|
13164 | 729 |
|
13702 | 730 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/% |
731 |
$(call strip-file) |
|
13164 | 732 |
|
12892 | 733 |
endif |
734 |
||
735 |
################################################################################ |
|
736 |
# Main targets |
|
737 |
||
738 |
jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \ |
|
739 |
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ |
|
13702 | 740 |
$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) |
12892 | 741 |
|
742 |
jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ |
|
743 |
$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \ |
|
744 |
$(JDK_IMAGE_DIR)/jre/lib/applet \ |
|
745 |
$(JDK_DEMO_TARGETS) \ |
|
746 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \ |
|
747 |
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \ |
|
748 |
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \ |
|
749 |
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ |
|
13702 | 750 |
$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ |
13164 | 751 |
$(JDK_IMAGE_DIR)/src.zip |
12892 | 752 |
|
13702 | 753 |
jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ |
754 |
$(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST) |
|
755 |
||
756 |
jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \ |
|
757 |
$(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \ |
|
758 |
$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \ |
|
759 |
$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) |
|
760 |
||
12892 | 761 |
################################################################################ |
762 |
||
763 |
.PHONY: default images jre-image jdk-image |