author | jiangli |
Tue, 26 Jun 2012 19:08:44 -0400 | |
changeset 13282 | 9872915dd78d |
parent 12892 | 3ef14bab6254 |
child 13164 | 72c5d01a857d |
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 |
|
12892 | 35 |
images: jre-image jdk-image |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
36 |
|
12892 | 37 |
ifeq ($(HOST_OS),solaris) |
38 |
define install-file |
|
39 |
$(MKDIR) -p $(@D) |
|
40 |
$(CP) -r -P '$<' '$(@D)' |
|
41 |
endef |
|
42 |
else |
|
43 |
define install-file |
|
44 |
$(MKDIR) -p $(@D) |
|
45 |
$(CP) -P '$<' '$@' |
|
46 |
endef |
|
47 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
48 |
|
12892 | 49 |
################################################################################ |
50 |
# |
|
51 |
# JRE and JDK build rules |
|
52 |
# |
|
53 |
################################################################################ |
|
54 |
||
55 |
################################################################################ |
|
56 |
# /bin dir |
|
57 |
||
58 |
$(JRE_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
59 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
60 |
$(install-file) |
|
61 |
||
62 |
$(JDK_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
63 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
64 |
$(install-file) |
|
65 |
||
66 |
$(JDK_IMAGE_DIR)/jre/bin/%: $(JDK_OUTPUTDIR)/bin/% |
|
67 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
68 |
$(install-file) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
69 |
|
12892 | 70 |
NOT_JRE_BIN_FILES = \ |
71 |
appletviewer$(EXE_SUFFIX) \ |
|
72 |
extcheck$(EXE_SUFFIX) \ |
|
73 |
idlj$(EXE_SUFFIX) \ |
|
74 |
jar$(EXE_SUFFIX) \ |
|
75 |
jarsigner$(EXE_SUFFIX) \ |
|
76 |
java-rmi.cgi \ |
|
77 |
javac$(EXE_SUFFIX) \ |
|
78 |
javadoc$(EXE_SUFFIX) \ |
|
79 |
javah$(EXE_SUFFIX) \ |
|
80 |
javap$(EXE_SUFFIX) \ |
|
81 |
jcmd$(EXE_SUFFIX) \ |
|
82 |
jdb$(EXE_SUFFIX) \ |
|
83 |
jps$(EXE_SUFFIX) \ |
|
84 |
jrunscript$(EXE_SUFFIX) \ |
|
85 |
jstat$(EXE_SUFFIX) \ |
|
86 |
jstatd$(EXE_SUFFIX) \ |
|
87 |
jstack$(EXE_SUFFIX) \ |
|
88 |
packagebean$(SCRIPT_SUFFIX) \ |
|
89 |
rmic$(EXE_SUFFIX) \ |
|
90 |
serialver$(EXE_SUFFIX) \ |
|
91 |
unregbean$(EXE_SUFFIX) \ |
|
92 |
jconsole$(EXE_SUFFIX) \ |
|
93 |
jinfo$(EXE_SUFFIX) \ |
|
94 |
jmap$(EXE_SUFFIX) \ |
|
95 |
native2ascii$(EXE_SUFFIX) \ |
|
96 |
xjc$(EXE_SUFFIX) \ |
|
97 |
wsgen$(EXE_SUFFIX) \ |
|
98 |
wsimport$(EXE_SUFFIX) \ |
|
99 |
schemagen$(EXE_SUFFIX) \ |
|
100 |
jsadebugd$(EXE_SUFFIX) \ |
|
101 |
jhat$(EXE_SUFFIX) |
|
102 |
||
103 |
WINDOWS_JDK_BIN_FILES = \ |
|
104 |
$(EXE_SUFFIX) \ |
|
105 |
$(LIB_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ |
|
106 |
$(MSVCRNN_DLL) |
|
107 |
||
108 |
# Find all files in bin dir |
|
109 |
ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) |
|
110 |
ifeq ($(HOST_OS),windows) |
|
111 |
JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST)) |
|
112 |
else |
|
113 |
JDK_BIN_LIST := $(ALL_BIN_LIST) |
|
114 |
endif |
|
115 |
JRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
116 |
|
12892 | 117 |
JRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%, $(JRE_BIN_LIST)) |
118 |
JDK_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%, $(JDK_BIN_LIST)) |
|
119 |
JDKJRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%, $(JRE_BIN_LIST)) |
|
120 |
||
121 |
################################################################################ |
|
122 |
# /lib dir |
|
123 |
||
124 |
$(JRE_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
125 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
126 |
$(install-file) |
|
127 |
||
128 |
$(JDK_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
129 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
130 |
$(install-file) |
|
131 |
||
132 |
$(JDK_IMAGE_DIR)/jre/lib/%: $(JDK_OUTPUTDIR)/lib/% |
|
133 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
134 |
$(install-file) |
|
135 |
||
136 |
JDKJRE_LIB_FILES := \ |
|
137 |
$(LIB_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
138 |
$(SALIB_NAME) |
|
139 |
||
140 |
NOT_JRE_LIB_FILES := \ |
|
141 |
tools.jar \ |
|
142 |
jconsole.jar \ |
|
143 |
sa-jdi.jar \ |
|
144 |
dt.jar \ |
|
145 |
orb.idl \ |
|
146 |
ir.idl \ |
|
147 |
ct.sym |
|
148 |
||
149 |
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES) |
|
150 |
ifeq ($(HOST_OS), linux) |
|
151 |
JDK_LIB_FILES += jexec |
|
152 |
endif |
|
153 |
||
154 |
ALL_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) ! -name "_the*") |
|
155 |
JRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),$(ALL_LIB_LIST)) |
|
156 |
JDKJRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_LIB_LIST)) |
|
157 |
JDK_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_LIB_LIST)) |
|
158 |
||
159 |
JRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%,$(JRE_LIB_LIST)) |
|
160 |
JDK_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%,$(JDK_LIB_LIST)) |
|
161 |
JDKJRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%,$(JDKJRE_LIB_LIST)) |
|
162 |
||
163 |
# CTE plugin security change require new empty directory lib/applet |
|
164 |
$(JRE_IMAGE_DIR)/lib/applet: |
|
165 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
166 |
$(MKDIR) -p $@ |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
167 |
|
12892 | 168 |
$(JDK_IMAGE_DIR)/jre/lib/applet: |
169 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
170 |
$(MKDIR) -p $@ |
|
171 |
||
172 |
$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS) |
|
173 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
174 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
175 |
||
176 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS) |
|
177 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
178 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
179 |
||
180 |
$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS) |
|
181 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
182 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
183 |
|
12892 | 184 |
$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JRE_LIB_TARGETS) |
185 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
186 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
|
187 |
||
188 |
################################################################################ |
|
189 |
# /man dir |
|
190 |
||
191 |
JRE_MAN_PAGES := \ |
|
192 |
java.1 \ |
|
193 |
keytool.1 \ |
|
194 |
orbd.1 \ |
|
195 |
pack200.1 \ |
|
196 |
policytool.1 \ |
|
197 |
rmid.1 \ |
|
198 |
rmiregistry.1 \ |
|
199 |
servertool.1 \ |
|
200 |
tnameserv.1 \ |
|
201 |
unpack200.1 |
|
202 |
||
203 |
ifndef OPENJDK |
|
204 |
JRE_MAN_PAGES += javaws.1 |
|
205 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
206 |
|
12892 | 207 |
JDK_MAN_PAGES = \ |
208 |
$(JRE_MAN_PAGES) \ |
|
209 |
appletviewer.1 \ |
|
210 |
extcheck.1 \ |
|
211 |
idlj.1 \ |
|
212 |
jar.1 \ |
|
213 |
jarsigner.1 \ |
|
214 |
javac.1 \ |
|
215 |
javadoc.1 \ |
|
216 |
javah.1 \ |
|
217 |
javap.1 \ |
|
218 |
jconsole.1 \ |
|
219 |
jcmd.1 \ |
|
220 |
jdb.1 \ |
|
221 |
jhat.1 \ |
|
222 |
jinfo.1 \ |
|
223 |
jmap.1 \ |
|
224 |
jps.1 \ |
|
225 |
jrunscript.1 \ |
|
226 |
jsadebugd.1 \ |
|
227 |
jstack.1 \ |
|
228 |
jstat.1 \ |
|
229 |
jstatd.1 \ |
|
230 |
jvisualvm.1 \ |
|
231 |
native2ascii.1 \ |
|
232 |
rmic.1 \ |
|
233 |
schemagen.1 \ |
|
234 |
serialver.1 \ |
|
235 |
wsgen.1 \ |
|
236 |
wsimport.1 \ |
|
237 |
xjc.1 |
|
238 |
||
239 |
ifeq ($(HOST_OS), linux) |
|
240 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc |
|
241 |
MAN1_SUBDIR:=man |
|
242 |
endif |
|
243 |
ifeq ($(HOST_OS), solaris) |
|
244 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc |
|
245 |
MAN1_SUBDIR:=sun/man/man1 |
|
246 |
endif |
|
247 |
||
248 |
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
|
249 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
250 |
$(install-file) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
251 |
|
12892 | 252 |
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
253 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
254 |
$(install-file) |
|
255 |
||
256 |
$(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
|
257 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
258 |
$(install-file) |
|
259 |
||
260 |
$(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
|
261 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
262 |
$(install-file) |
|
263 |
||
264 |
define install-ja-manpage |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
265 |
$(MKDIR) -p $(@D) |
12892 | 266 |
$(CAT) $< \ |
267 |
| $(NATIVE2ASCII) -encoding eucJP \ |
|
268 |
| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \ |
|
269 |
| $(NATIVE2ASCII) -reverse -encoding $1 \ |
|
270 |
> $@ |
|
271 |
endef |
|
272 |
||
273 |
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
274 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
275 |
$(call install-ja-manpage,UTF-8) |
|
276 |
||
277 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
278 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
279 |
$(call install-ja-manpage,UTF-8) |
|
280 |
||
281 |
$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
282 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
283 |
$(call install-ja-manpage,PCK) |
|
284 |
||
285 |
$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
286 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
287 |
$(call install-ja-manpage,PCK) |
|
288 |
||
289 |
ifeq ($(HOST_OS), solaris) |
|
290 |
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
291 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
292 |
$(install-file) |
|
293 |
||
294 |
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
295 |
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
296 |
$(install-file) |
|
297 |
endif |
|
298 |
||
299 |
# Old build creates empty man page for this, mimicing behaviour. |
|
300 |
$(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: |
|
301 |
$(ECHO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
302 |
$(MKDIR) -p $(@D) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
303 |
$(TOUCH) $@ |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
304 |
|
12892 | 305 |
ifeq ($(HOST_OS), linux) |
306 |
$(JRE_IMAGE_DIR)/man/ja: |
|
307 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
308 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
309 |
||
310 |
$(JDK_IMAGE_DIR)/man/ja: |
|
311 |
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
312 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
313 |
endif |
|
314 |
||
315 |
ifeq ($(HOST_OS), linux) |
|
316 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
317 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
318 |
$(JRE_IMAGE_DIR)/man/ja |
|
319 |
||
320 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
|
321 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
322 |
$(JDK_IMAGE_DIR)/man/ja |
|
323 |
endif |
|
324 |
||
325 |
ifeq ($(HOST_OS), solaris) |
|
326 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
327 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \ |
|
328 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
329 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES)) |
|
330 |
||
331 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
|
332 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \ |
|
333 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
334 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES)) |
|
335 |
endif |
|
336 |
||
337 |
################################################################################ |
|
338 |
# /demo dir |
|
339 |
||
340 |
ifndef NO_DEMOS |
|
341 |
# FIXME: newdemo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied. |
|
342 |
||
343 |
# The db demo contains an empty dir that needs to be copied. The other |
|
344 |
# directories will always trigger the rule for recompile since |
|
345 |
# _the.list_of_packages files are touched. |
|
346 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/newdemo/% |
|
347 |
if [ ! -d "$@" ]; then \ |
|
348 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \ |
|
349 |
$(MKDIR) -p $(@D); \ |
|
350 |
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \ |
|
351 |
fi |
|
352 |
||
353 |
# Find all files including directories |
|
354 |
JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/newdemo/%,$(JDK_IMAGE_DIR)/demo/%,\ |
|
355 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/newdemo ! -name "_the.*")) |
|
356 |
||
357 |
endif |
|
358 |
||
359 |
################################################################################ |
|
360 |
# /sample dir |
|
361 |
||
362 |
ifndef NO_SAMPLES |
|
363 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_OUTPUTDIR)/sample/% |
|
364 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
365 |
$(install-file) |
|
366 |
||
367 |
JDK_SAMPLE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/sample/%,$(JDK_IMAGE_DIR)/sample/%,\ |
|
368 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/sample -type f)) |
|
369 |
||
370 |
endif |
|
371 |
||
372 |
################################################################################ |
|
373 |
# /db dir |
|
374 |
||
375 |
ifndef OPENJDK |
|
376 |
$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/% |
|
377 |
$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) |
|
378 |
$(MKDIR) -p $(JDK_IMAGE_DIR)/db |
|
379 |
cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $< -x index.html 2> /dev/null |
|
380 |
$(MKDIR) -p $(@D) |
|
381 |
$(TOUCH) $@ |
|
382 |
||
383 |
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html |
|
384 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
385 |
$(install-file) |
|
386 |
||
387 |
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\ |
|
388 |
$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \ |
|
389 |
$(JDK_IMAGE_DIR)/db/README-JDK.html |
|
390 |
||
391 |
endif |
|
392 |
||
393 |
################################################################################ |
|
394 |
# /include dir |
|
395 |
||
396 |
$(JDK_IMAGE_DIR)/include/%: $(JDK_OUTPUTDIR)/include/% |
|
397 |
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
|
398 |
$(install-file) |
|
399 |
||
400 |
JDK_INCLUDE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/include/%,$(JDK_IMAGE_DIR)/include/%,\ |
|
401 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/include -type f)) |
|
402 |
||
403 |
################################################################################ |
|
404 |
# doc files |
|
405 |
||
406 |
ifdef OPENJDK |
|
407 |
JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
408 |
JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
409 |
JRE_DOC_LOCATION := $(JDK_TOPDIR) |
|
410 |
JDK_DOC_LOCATION := $(JDK_TOPDIR) |
|
411 |
else |
|
412 |
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
413 |
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
414 |
ifeq ($(HOST_OS), windows) |
|
415 |
JRE_DOC_FILES += README.txt |
|
416 |
else |
|
417 |
JRE_DOC_FILES += README |
|
418 |
endif |
|
419 |
ifndef NO_DEMOS |
|
420 |
JDK_DOC_FILES += demo/DEMOS_LICENSE |
|
421 |
endif |
|
422 |
ifndef NO_SAMPLES |
|
423 |
JDK_DOC_FILES += sample/SAMPLES_LICENSE |
|
424 |
endif |
|
425 |
JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre |
|
426 |
JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk |
|
427 |
endif |
|
428 |
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES)) |
|
429 |
JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES)) |
|
430 |
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES)) |
|
431 |
||
432 |
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/% |
|
433 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
434 |
$(install-file) |
|
435 |
||
436 |
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/% |
|
437 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
438 |
$(install-file) |
|
439 |
||
440 |
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README |
|
441 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
442 |
$(MKDIR) -p $(@D) |
|
443 |
$(CP) $< $@ |
|
444 |
||
445 |
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README |
|
446 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
447 |
$(MKDIR) -p $(@D) |
|
448 |
$(CP) $< $@ |
|
449 |
||
450 |
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/% |
|
451 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
452 |
$(install-file) |
|
453 |
||
454 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/% |
|
455 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
456 |
$(install-file) |
|
457 |
||
458 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/% |
|
459 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
460 |
$(install-file) |
|
461 |
||
462 |
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release |
|
463 |
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release |
|
464 |
||
465 |
# Common way to emit a line into the release or info file |
|
466 |
define info-file-item # name value |
|
467 |
$(PRINTF) '%s="%s"\n' $1 $2 >> $@ |
|
468 |
endef |
|
469 |
||
470 |
ALL_SOURCE_TIPS = $(shell \ |
|
471 |
if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \ |
|
472 |
$(CAT) $(OUTPUT_ROOT)/source_tips ; \ |
|
473 |
fi) |
|
474 |
||
475 |
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
476 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
477 |
$(MKDIR) -p $(@D) |
|
478 |
$(RM) $@ |
|
479 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)") |
|
480 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)") |
|
481 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)") |
|
482 |
$(call info-file-item, "OS_ARCH", "$(ARCH)") |
|
483 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)") |
|
484 |
||
485 |
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
486 |
$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
487 |
$(MKDIR) -p $(@D) |
|
488 |
$(RM) $@ |
|
489 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)") |
|
490 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)") |
|
491 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)") |
|
492 |
$(call info-file-item, "OS_ARCH", "$(ARCH)") |
|
493 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)") |
|
494 |
||
495 |
$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip |
|
496 |
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
497 |
$(install-file) |
|
498 |
||
499 |
################################################################################ |
|
500 |
# Post processing (strip etc) |
|
501 |
||
502 |
ifneq ($(POST_STRIP_CMD),) |
|
503 |
ifeq ($(HOST_OS), windows) |
|
504 |
EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \ |
|
505 |
-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)") |
|
506 |
else |
|
507 |
# Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed |
|
508 |
EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX) && \ |
|
509 |
$(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \ |
|
510 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1) |
|
511 |
endif |
|
512 |
# Filter out non JRE files and convert to unique touch files to depend on |
|
513 |
JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip/%.stripped,\ |
|
514 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST))) |
|
515 |
||
516 |
# Setup a rule for stripping files based on touch files |
|
517 |
$(IMAGES_OUTPUTDIR)/_strip/%.stripped: $(JRE_IMAGE_DIR)/% |
|
518 |
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<) |
|
519 |
$(CHMOD) u+w $< |
|
520 |
$(POST_STRIP_CMD) $< |
|
521 |
$(CHMOD) go-w $< |
|
522 |
$(MKDIR) -p $(@D) |
|
523 |
$(TOUCH) $@ |
|
524 |
endif |
|
525 |
||
526 |
################################################################################ |
|
527 |
# Main targets |
|
528 |
||
529 |
jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \ |
|
530 |
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ |
|
531 |
$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_EXEC_TOUCH_LIST) |
|
532 |
||
533 |
jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ |
|
534 |
$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \ |
|
535 |
$(JDK_IMAGE_DIR)/jre/lib/applet \ |
|
536 |
$(JDK_DEMO_TARGETS) \ |
|
537 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \ |
|
538 |
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \ |
|
539 |
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \ |
|
540 |
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ |
|
541 |
$(JDK_INFO_FILE) $(JDK_IMAGE_DIR)/src.zip |
|
542 |
||
543 |
################################################################################ |
|
544 |
||
545 |
.PHONY: default images jre-image jdk-image |