author | cl |
Thu, 31 Oct 2013 12:36:25 -0700 | |
changeset 21217 | 18e2f75d9321 |
parent 20551 | 8518304d2097 |
child 22332 | fba4c66089bb |
permissions | -rw-r--r-- |
15681 | 1 |
# |
2 |
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
include ProfileNames.gmk |
|
27 |
||
28 |
# This defines the include lists for each profile, categorized as lib, bin |
|
29 |
# and other. We can use these to define the file lists for each profile |
|
30 |
# directly, rather than constructing a set of files to exclude from the |
|
31 |
# set of all files. But initially we will stick with generating exclude lists |
|
32 |
# as that is how the main build process already works. |
|
33 |
||
34 |
include profile-includes.txt |
|
35 |
||
36 |
############################################################################### |
|
37 |
# Per profile Jar lists |
|
38 |
# |
|
39 |
# These are the jar files to be built. In some builds these have to be |
|
40 |
# imported (signed jars) rather than built. |
|
41 |
# |
|
42 |
# The incoming lists, eg PROFILE_1_JRE_JARS_FILES, are the jars to be |
|
20547 | 43 |
# included in this profile. They have the jar name relative to the lib |
44 |
# directory. We have to turn these into targets by adding the |
|
15681 | 45 |
# $(IMAGES_OUTPUTDIR)/lib prefix |
46 |
# |
|
47 |
# Note that some jars may be optional depending on the type of build (jdk vs. |
|
48 |
# openjdk) and the platform. |
|
49 |
# |
|
50 |
# WARNING: incoming lists are currently validated for linux only! |
|
51 |
############################################################################### |
|
52 |
||
53 |
# These are jar files for which the contents vary depending on the profile |
|
54 |
CUSTOM_JARS := rt.jar resources.jar |
|
55 |
# This is used in Images.gmk |
|
56 |
CUSTOM_PROFILE_JARS := $(addprefix $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/, $(CUSTOM_JARS)) |
|
57 |
||
58 |
# These are the common jar files built for and included with this profile |
|
59 |
# Filter out the custom jars and turn them into targets. |
|
60 |
||
20547 | 61 |
PROFILE_1_JARS := \ |
15681 | 62 |
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(filter-out $(CUSTOM_JARS), $(PROFILE_1_JRE_JAR_FILES))) |
63 |
||
64 |
PROFILE_2_JARS := \ |
|
65 |
$(if $(PROFILE_2_JRE_JAR_FILES), $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_2_JRE_JAR_FILES))) \ |
|
66 |
$(PROFILE_1_JARS) |
|
67 |
||
68 |
PROFILE_3_JARS := \ |
|
69 |
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_3_JRE_JAR_FILES)) \ |
|
70 |
$(PROFILE_2_JARS) |
|
71 |
||
19570
e1c7cdf2f15a
8023460: OPENJDK build fails due to missing jfr.jar
dholmes
parents:
16637
diff
changeset
|
72 |
ifneq ($(ENABLE_JFR), true) |
20547 | 73 |
FULL_JRE_JAR_FILES := $(filter-out jfr.jar, $(FULL_JRE_JAR_FILES)) |
19570
e1c7cdf2f15a
8023460: OPENJDK build fails due to missing jfr.jar
dholmes
parents:
16637
diff
changeset
|
74 |
endif |
e1c7cdf2f15a
8023460: OPENJDK build fails due to missing jfr.jar
dholmes
parents:
16637
diff
changeset
|
75 |
|
16478 | 76 |
FULL_JRE_JARS := \ |
77 |
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(FULL_JRE_JAR_FILES)) \ |
|
15681 | 78 |
$(PROFILE_3_JARS) |
79 |
||
80 |
# The full set of "jar" files needed for a complete JDK (ct.sym and src.zip |
|
81 |
# are also included.) |
|
82 |
# Note we need to add back the regular form of all the custom profile jars e.g. |
|
16487
f3fecb3d79af
8009426: "profiles" target fails due to nashorn if "images" is not built first
dholmes
parents:
16478
diff
changeset
|
83 |
# rt.jar and resources.jar that we filtered out above |
15681 | 84 |
|
16478 | 85 |
ALL_JARS := $(FULL_JRE_JARS) \ |
20547 | 86 |
$(IMAGES_OUTPUTDIR)/lib/rt.jar \ |
87 |
$(IMAGES_OUTPUTDIR)/lib/resources.jar \ |
|
88 |
$(IMAGES_OUTPUTDIR)/lib/jconsole.jar \ |
|
89 |
$(IMAGES_OUTPUTDIR)/lib/dt.jar \ |
|
90 |
$(IMAGES_OUTPUTDIR)/lib/tools.jar \ |
|
91 |
$(IMAGES_OUTPUTDIR)/lib/ct.sym \ |
|
92 |
$(IMAGES_OUTPUTDIR)/src.zip |
|
16637
32419853ec8d
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16487
diff
changeset
|
93 |
|
20547 | 94 |
ifeq ($(INCLUDE_SA), true) |
95 |
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar |
|
16637
32419853ec8d
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16487
diff
changeset
|
96 |
endif |
15681 | 97 |
|
20547 | 98 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
99 |
ifndef OPENJDK |
|
100 |
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar |
|
101 |
endif |
|
15681 | 102 |
endif |
103 |
||
20547 | 104 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
105 |
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar |
|
106 |
endif |
|
15681 | 107 |
|
20547 | 108 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
109 |
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/JObjC.jar |
|
15681 | 110 |
endif |
111 |
||
112 |
ifeq ($(PROFILE), profile_1) |
|
20547 | 113 |
PROFILE_JARS := $(PROFILE_1_JARS) |
15681 | 114 |
else ifeq ($(PROFILE), profile_2) |
20547 | 115 |
PROFILE_JARS := $(PROFILE_2_JARS) |
15681 | 116 |
else ifeq ($(PROFILE), profile_3) |
20547 | 117 |
PROFILE_JARS := $(PROFILE_3_JARS) |
15681 | 118 |
endif |
20547 | 119 |
ifneq ($(PROFILE), ) |
120 |
JARS := $(CUSTOM_PROFILE_JARS) $(PROFILE_JARS) |
|
15681 | 121 |
else |
20547 | 122 |
JARS := $(ALL_JARS) |
15681 | 123 |
endif |
124 |
||
125 |
############################################################################### |
|
126 |
# JRE contents |
|
127 |
############################################################################### |
|
128 |
||
129 |
||
130 |
# we don't need to do anything if not building a profile |
|
20547 | 131 |
ifneq ($(PROFILE), ) |
15681 | 132 |
|
133 |
||
134 |
# Need all files to generate the exclude lists |
|
135 |
NEW_ALL_BIN_LIST := $(patsubst $(JDK_OUTPUTDIR)/bin/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/bin \( -type f -o -type l \) ! -name "sjavac")) |
|
136 |
||
137 |
ALL_JRE_BIN_FILES := \ |
|
20547 | 138 |
$(PROFILE_1_JRE_BIN_FILES) \ |
139 |
$(PROFILE_2_JRE_BIN_FILES) \ |
|
140 |
$(PROFILE_3_JRE_BIN_FILES) \ |
|
141 |
$(FULL_JRE_BIN_FILES) |
|
15681 | 142 |
|
143 |
NOT_JRE_BIN_FILES := $(filter-out $(ALL_JRE_BIN_FILES), $(NEW_ALL_BIN_LIST)) |
|
144 |
||
145 |
# Additional exclusions for profile JRE |
|
146 |
ifeq ($(PROFILE), profile_1) |
|
20547 | 147 |
NOT_JRE_BIN_FILES += \ |
148 |
$(PROFILE_2_JRE_BIN_FILES) \ |
|
149 |
$(PROFILE_3_JRE_BIN_FILES) \ |
|
150 |
$(FULL_JRE_BIN_FILES) |
|
15681 | 151 |
endif |
152 |
||
153 |
ifeq ($(PROFILE), profile_2) |
|
20547 | 154 |
NOT_JRE_BIN_FILES += \ |
155 |
$(PROFILE_3_JRE_BIN_FILES) \ |
|
156 |
$(FULL_JRE_BIN_FILES) |
|
15681 | 157 |
endif |
158 |
||
159 |
ifeq ($(PROFILE), profile_3) |
|
20547 | 160 |
NOT_JRE_BIN_FILES += \ |
161 |
$(FULL_JRE_BIN_FILES) |
|
15681 | 162 |
endif |
163 |
||
164 |
NOT_JRE_BIN_FILES := $(addprefix $(JDK_OUTPUTDIR)/bin/, $(NOT_JRE_BIN_FILES)) |
|
165 |
||
166 |
# Need all files to generate the exclude lists |
|
167 |
NEW_ALL_LIB_LIST := $(patsubst $(JDK_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) )) |
|
168 |
NEW_ALL_LIB_LIST += $(patsubst $(IMAGES_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) )) |
|
169 |
||
170 |
ALL_JRE_LIB_FILES := \ |
|
20547 | 171 |
$(PROFILE_1_JRE_LIB_FILES) \ |
172 |
$(PROFILE_2_JRE_LIB_FILES) \ |
|
173 |
$(PROFILE_3_JRE_LIB_FILES) \ |
|
174 |
$(FULL_JRE_LIB_FILES) |
|
15681 | 175 |
|
176 |
NOT_JRE_LIB_FILES := $(filter-out $(ALL_JRE_LIB_FILES), $(NEW_ALL_LIB_LIST)) |
|
177 |
||
178 |
# Although these are NOT JRE lib files we have to filter them from the list |
|
179 |
# (ie cause them to be added them back in here) because the logic in |
|
180 |
# Images.gmk expects them to be there and handles them differently. |
|
181 |
# If we don't, they end up in the wrong place in the JDK image. |
|
182 |
# This needs fixing. |
|
183 |
NOT_JRE_LIB_FILES := $(filter-out $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(SALIB_NAME), $(NOT_JRE_LIB_FILES)) |
|
184 |
||
185 |
# Additional exclusions for profile JREs |
|
186 |
ifeq ($(PROFILE), profile_1) |
|
20547 | 187 |
NOT_JRE_LIB_FILES += \ |
188 |
$(PROFILE_2_JRE_LIB_FILES) \ |
|
189 |
$(PROFILE_3_JRE_LIB_FILES) \ |
|
190 |
$(FULL_JRE_LIB_FILES) |
|
15681 | 191 |
endif |
192 |
||
193 |
ifeq ($(PROFILE), profile_2) |
|
20547 | 194 |
NOT_JRE_LIB_FILES += \ |
195 |
$(PROFILE_3_JRE_LIB_FILES) \ |
|
196 |
$(FULL_JRE_LIB_FILES) |
|
15681 | 197 |
endif |
198 |
||
199 |
ifeq ($(PROFILE), profile_3) |
|
20547 | 200 |
NOT_JRE_LIB_FILES += \ |
201 |
$(FULL_JRE_LIB_FILES) |
|
15681 | 202 |
endif |
203 |
||
204 |
# Exclude the custom jar files as these will be added back via a special rule |
|
205 |
NOT_JRE_LIB_FILES += $(CUSTOM_JARS) |
|
206 |
||
207 |
############################################################################### |
|
208 |
# Customization of rt.jar file contents |
|
20547 | 209 |
# These are expressed as exclusions from everything found in the |
15681 | 210 |
# JDK_OUTPUTDIR/classes directory |
211 |
############################################################################### |
|
212 |
||
213 |
# The main set of excluded types/packages (ie everything not destined to be |
|
214 |
# part of rt.jar or resources.jar is captured in the CreateJars.gmk RT_JAR_EXCLUDES |
|
215 |
# variable. We add to that for the per-profile exclusion lists |
|
216 |
||
217 |
# For each profile we have four variables: |
|
218 |
# |
|
219 |
# - PROFILE_n_RTJAR_INCLUDE_PACKAGES |
|
220 |
# |
|
221 |
# This is a package prefix indicating that all classes in that package |
|
222 |
# and conditionally its subpackages are included in rt.jar for this profile. |
|
223 |
# The subpackages will be included as long as they do not appear in the |
|
224 |
# include list of a higher profile |
|
225 |
# |
|
226 |
# - PROFILE_n_RTJAR_INCLUDE_TYPES |
|
227 |
# |
|
228 |
# These are specific types that must be included within a package. |
|
229 |
# There are two cases: |
|
20547 | 230 |
# - individual types in a package that is otherwise excluded at this |
231 |
# profile level. The only arises if there are split packages. |
|
15681 | 232 |
# |
233 |
# - A higher-level package is included in a high profile where a subpackage |
|
234 |
# is included in a lower profile. Including the package in the high profile |
|
235 |
# would exclude it and all subpackages from the lower profile, so instead |
|
236 |
# the classes in the package are listed for that higher profile (as *.class) |
|
237 |
# |
|
238 |
# These types are explicitly added back into the rt.jar content lists. |
|
239 |
# |
|
240 |
# - PROFILE_n_RTJAR_EXCLUDE_TYPES |
|
241 |
# |
|
242 |
# These are specific types that must be excluded even though most of the |
|
243 |
# containing package is include. Again this occurs with split packges. |
|
244 |
# |
|
245 |
# So the exclude list for each profile consists of the include lists |
|
20547 | 246 |
# for all profiles above it, together with any explicitly excluded types. |
15681 | 247 |
# This is then combined with the overall RT_JAR_EXCLUDES list (which covers |
248 |
# things that go into other jar files). |
|
249 |
# |
|
250 |
# We also have to define the types to be explicitly included. This |
|
251 |
# accumulates up the profiles ie profile 3 has to include the types |
|
252 |
# that profiles 1 and 2 had to include. This is unnecessary if, for example, |
|
253 |
# profile 3 includes the entire package, but it is harmless to add them |
|
254 |
# explicitly, and complex to determine if we still need to include them. |
|
255 |
# |
|
20547 | 256 |
# Need a way to express: |
15681 | 257 |
# for (int i = profile+1; i < 4; i++) |
258 |
# RT_JAR_EXCLUDES += PROFILE_$i_RTJAR_INCLUDE_PACKAGES |
|
259 |
# |
|
260 |
# Do it the long way for now |
|
261 |
# |
|
262 |
# - PROFILE_n_INCLUDE_METAINF_SERVICES |
|
263 |
# |
|
264 |
# These are META-INF/services/ entries found in resources.jar. Together |
|
265 |
# resources.jar and rt.jar hold the contents of the classes directory, (the |
|
20547 | 266 |
# classes in rt.jar and everything else in resources.jar).Hence the |
15681 | 267 |
# include/exclude information for resources.jar is tied to that of rt.jar |
268 |
||
269 |
include profile-rtjar-includes.txt |
|
270 |
||
271 |
# Function to expand foo/*.class into the set of classes |
|
272 |
# NOTE: Classfiles with $ in their name are problematic as that is the |
|
273 |
# meta-character for both make and the shell! Hence the \$$$$ substitution. |
|
274 |
# But note that if you echo these values they will NOT display as expected. |
|
20547 | 275 |
class_list = $(patsubst $(JDK_OUTPUTDIR)/classes/%,%, \ |
276 |
$(foreach i, $(1), $(subst $$,\$$$$, $(wildcard $(JDK_OUTPUTDIR)/classes/$i)))) |
|
15681 | 277 |
|
278 |
ifeq ($(PROFILE), profile_1) |
|
279 |
RT_JAR_EXCLUDES += \ |
|
20547 | 280 |
$(call class_list, $(PROFILE_1_RTJAR_EXCLUDE_TYPES)) \ |
281 |
$(PROFILE_2_RTJAR_INCLUDE_PACKAGES) \ |
|
282 |
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \ |
|
283 |
$(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \ |
|
284 |
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \ |
|
285 |
$(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \ |
|
286 |
$(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES)) |
|
15681 | 287 |
RT_JAR_INCLUDE_TYPES := \ |
20547 | 288 |
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) |
15681 | 289 |
PROFILE_INCLUDE_METAINF_SERVICES := \ |
20547 | 290 |
$(PROFILE_1_INCLUDE_METAINF_SERVICES) |
15681 | 291 |
endif |
292 |
ifeq ($(PROFILE), profile_2) |
|
293 |
RT_JAR_EXCLUDES += \ |
|
20547 | 294 |
$(call class_list, $(PROFILE_2_RTJAR_EXCLUDE_TYPES)) \ |
295 |
$(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \ |
|
296 |
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \ |
|
297 |
$(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \ |
|
298 |
$(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES)) |
|
15681 | 299 |
RT_JAR_INCLUDE_TYPES := \ |
20547 | 300 |
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \ |
301 |
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) |
|
15681 | 302 |
PROFILE_INCLUDE_METAINF_SERVICES := \ |
20547 | 303 |
$(PROFILE_1_INCLUDE_METAINF_SERVICES) \ |
304 |
$(PROFILE_2_INCLUDE_METAINF_SERVICES) |
|
15681 | 305 |
endif |
306 |
ifeq ($(PROFILE), profile_3) |
|
307 |
RT_JAR_EXCLUDES += \ |
|
20547 | 308 |
$(call class_list, $(PROFILE_3_RTJAR_EXCLUDE_TYPES)) \ |
309 |
$(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \ |
|
310 |
$(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES)) |
|
15681 | 311 |
RT_JAR_INCLUDE_TYPES := \ |
20547 | 312 |
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \ |
313 |
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \ |
|
314 |
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) |
|
15681 | 315 |
PROFILE_INCLUDE_METAINF_SERVICES := \ |
20547 | 316 |
$(PROFILE_1_INCLUDE_METAINF_SERVICES) \ |
317 |
$(PROFILE_2_INCLUDE_METAINF_SERVICES) \ |
|
318 |
$(PROFILE_3_INCLUDE_METAINF_SERVICES) |
|
15681 | 319 |
endif |
320 |
||
321 |
# Filter out non-OpenJDK services |
|
322 |
ifdef OPENJDK |
|
20547 | 323 |
EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory |
324 |
PROFILE_INCLUDE_METAINF_SERVICES := $(filter-out $(EXCLUDED_SERVICES), $(PROFILE_INCLUDE_METAINF_SERVICES)) |
|
15681 | 325 |
endif |
326 |
||
327 |
||
328 |
endif # profile |