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