author | vlivanov |
Wed, 10 Sep 2014 19:19:46 +0400 | |
changeset 26464 | 65b37da18e06 |
parent 25854 | 98ce0879ab4c |
child 25883 | 1aedb364117b |
permissions | -rw-r--r-- |
14111 | 1 |
# |
22714
a752920c4317
8034191: Move relevant parts of build system to new closed repo
ihse
parents:
22031
diff
changeset
|
2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
14111 | 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 |
||
25854 | 26 |
################################################################################ |
27 |
# This is the main makefile containing most actual top level targets. It needs |
|
28 |
# to be called with a SPEC file defined. |
|
29 |
||
30 |
# Declare default target |
|
31 |
default: |
|
14111 | 32 |
|
33 |
# Now load the spec |
|
34 |
include $(SPEC) |
|
35 |
||
25854 | 36 |
include $(SRC_ROOT)/make/MakeHelpers.gmk |
37 |
||
20363 | 38 |
# Load the vital tools for all the makefiles. |
21759 | 39 |
include $(SRC_ROOT)/make/common/MakeBase.gmk |
14111 | 40 |
|
25854 | 41 |
# Load common profile names definitions |
42 |
include $(JDK_TOPDIR)/make/ProfileNames.gmk |
|
43 |
||
44 |
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all |
|
45 |
# valid top level targets. It's used to declare them all as PHONY and to |
|
46 |
# generate the -only targets. |
|
47 |
ALL_TARGETS := |
|
48 |
||
22714
a752920c4317
8034191: Move relevant parts of build system to new closed repo
ihse
parents:
22031
diff
changeset
|
49 |
# Hook to include the corresponding custom file, if present. |
a752920c4317
8034191: Move relevant parts of build system to new closed repo
ihse
parents:
22031
diff
changeset
|
50 |
$(eval $(call IncludeCustomExtension, , Main.gmk)) |
14111 | 51 |
|
25854 | 52 |
# All modules for the current target platform. |
53 |
# Manually add jdk.hotspot.agent for now. |
|
54 |
ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent |
|
55 |
||
56 |
################################################################################ |
|
57 |
################################################################################ |
|
58 |
# |
|
59 |
# Recipes for all targets. Only recipes, dependencies are declared later. |
|
60 |
# |
|
61 |
################################################################################ |
|
62 |
||
63 |
################################################################################ |
|
64 |
# Interim/build tools targets, compiling tools used during the build |
|
65 |
||
66 |
interim-langtools: |
|
67 |
+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk) |
|
68 |
||
69 |
interim-corba: |
|
70 |
+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk) |
|
71 |
||
72 |
interim-rmic: |
|
73 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk) |
|
74 |
||
75 |
build-tools-jdk: |
|
76 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools) |
|
77 |
||
78 |
ALL_TARGETS += interim-langtools interim-corba build-tools-jdk |
|
79 |
||
80 |
################################################################################ |
|
81 |
# Special targets for certain modules |
|
82 |
||
83 |
import-hotspot: |
|
84 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk) |
|
14111 | 85 |
|
25854 | 86 |
unpack-sec: |
87 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk) |
|
88 |
||
89 |
policy-jars: |
|
90 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk) |
|
91 |
||
92 |
ALL_TARGETS += import-hotspot unpack-sec policy-jars |
|
14111 | 93 |
|
25854 | 94 |
################################################################################ |
95 |
# Gensrc targets, generating source before java compilation can be done |
|
96 |
JDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc) |
|
97 |
LANGTOOLS_GENSRC_MODULES := jdk.compiler.tools |
|
98 |
CORBA_GENSRC_MODULES := java.corba |
|
99 |
GENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \ |
|
100 |
$(CORBA_GENSRC_MODULES) |
|
101 |
JDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES)) |
|
102 |
LANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES)) |
|
103 |
CORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES)) |
|
104 |
GENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES)) |
|
14111 | 105 |
|
25854 | 106 |
jdk.compiler.tools-gensrc: |
107 |
+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk) |
|
108 |
||
109 |
java.corba-gensrc: |
|
110 |
+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk) |
|
14111 | 111 |
|
25854 | 112 |
# Declare recipes for all jdk <module>-gensrc targets |
113 |
$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
114 |
$m, gensrc, gensrc, Gensrc))) |
|
15053
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
115 |
|
25854 | 116 |
ALL_TARGETS += $(GENSRC_TARGETS) |
117 |
||
118 |
################################################################################ |
|
119 |
# Generate data targets |
|
120 |
GENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata) |
|
121 |
GENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES)) |
|
14111 | 122 |
|
25854 | 123 |
# Declare recipes for all <module>-gendata targets |
124 |
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
125 |
$m, gendata, gendata, Gendata))) |
|
126 |
||
127 |
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m))) |
|
128 |
||
129 |
ALL_TARGETS += $(GENDATA_TARGETS) |
|
130 |
||
131 |
################################################################################ |
|
132 |
# Copy files targets |
|
133 |
COPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy) |
|
134 |
COPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES)) |
|
135 |
||
136 |
# Declare recipes for all <module>-copy targets |
|
137 |
$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
138 |
$m, copy, copy, Copy))) |
|
139 |
||
140 |
ALL_TARGETS += $(COPY_TARGETS) |
|
15395
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
141 |
|
25854 | 142 |
################################################################################ |
143 |
# Targets for compiling all java modules. Nashorn is treated separately. |
|
144 |
JAVA_MODULES := $(call FindJavaModules) |
|
145 |
JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES)) |
|
14111 | 146 |
|
25854 | 147 |
define DeclareCompileJavaRecipe |
148 |
$1-java: |
|
149 |
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \ |
|
150 |
$1 JAVA_MODULES=$1) |
|
151 |
endef |
|
152 |
||
153 |
$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \ |
|
154 |
$(eval $(call DeclareCompileJavaRecipe,$m))) |
|
155 |
||
156 |
# Build nashorn. Needs to be compiled separately from the rest of the modules |
|
157 |
# due to nasgen. |
|
158 |
jdk.scripting.nashorn-java: |
|
159 |
+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile) |
|
14111 | 160 |
|
25854 | 161 |
ALL_TARGETS += $(JAVA_TARGETS) |
162 |
||
163 |
################################################################################ |
|
164 |
# Targets for running rmic. |
|
165 |
RMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic) |
|
166 |
RMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES)) |
|
167 |
||
168 |
# Declare recipes for all <module>-rmic targets |
|
169 |
$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
170 |
$m, rmic, rmic, Rmic))) |
|
171 |
||
172 |
ALL_TARGETS += $(RMIC_TARGETS) |
|
173 |
||
174 |
################################################################################ |
|
175 |
# Targets for compiling native libraries |
|
176 |
ALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib) |
|
177 |
LIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES)) |
|
178 |
LIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES)) |
|
14111 | 179 |
|
25854 | 180 |
# Declare recipes for all <module>-libs targets |
181 |
$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
182 |
$m, libs, lib, Lib))) |
|
183 |
||
184 |
ALL_TARGETS += $(LIB_TARGETS) |
|
14111 | 185 |
|
25854 | 186 |
################################################################################ |
187 |
# Targets for compiling native executables |
|
188 |
ALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher) |
|
189 |
LAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES)) |
|
190 |
LAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES)) |
|
191 |
||
192 |
# Declare recipes for all <module>-launchers targets |
|
193 |
$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ |
|
194 |
$m, launchers, launcher, Launcher))) |
|
195 |
||
196 |
ALL_TARGETS += $(LAUNCHER_TARGETS) |
|
197 |
||
198 |
################################################################################ |
|
199 |
# Build hotspot target |
|
14111 | 200 |
|
14378
0ef5d942b98e
8002028: build-infra: need no-hotspot partial build
tbell
parents:
14111
diff
changeset
|
201 |
ifeq ($(BUILD_HOTSPOT),true) |
25854 | 202 |
hotspot: |
203 |
($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) |
|
14378
0ef5d942b98e
8002028: build-infra: need no-hotspot partial build
tbell
parents:
14111
diff
changeset
|
204 |
endif |
14111 | 205 |
|
25854 | 206 |
ALL_TARGETS += hotspot |
15903 | 207 |
|
25854 | 208 |
################################################################################ |
209 |
# Build demos and samples targets |
|
14111 | 210 |
|
25854 | 211 |
demos: |
212 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk) |
|
14111 | 213 |
|
25854 | 214 |
samples: |
215 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk) |
|
14111 | 216 |
|
25854 | 217 |
ALL_TARGETS += demos samples |
14111 | 218 |
|
25854 | 219 |
################################################################################ |
220 |
# Image targets |
|
14111 | 221 |
|
222 |
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be |
|
223 |
# used to track the exact sources used to build that image. |
|
224 |
source-tips: $(OUTPUT_ROOT)/source_tips |
|
225 |
$(OUTPUT_ROOT)/source_tips: FRC |
|
226 |
@$(MKDIR) -p $(@D) |
|
227 |
@$(RM) $@ |
|
18052
f326fa317a81
8012564: The SOURCE value in release file of JDK 8 doesn't contain valid changesets for some OS since b74
erikj
parents:
17664
diff
changeset
|
228 |
@$(call GetSourceTips) |
14111 | 229 |
|
25854 | 230 |
security-jars: |
231 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk) |
|
232 |
||
233 |
nashorn-jar: |
|
234 |
+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all) |
|
235 |
||
236 |
# Creates the jar files (rt.jar resources.jar etc) |
|
237 |
main-jars: |
|
238 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk) |
|
239 |
||
240 |
# Creates the images (j2sdk-image j2re-image etc) |
|
241 |
images: |
|
242 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk) |
|
243 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
244 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk) |
|
245 |
endif |
|
246 |
||
247 |
# Create Compact Profile jars |
|
248 |
PROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES)) |
|
249 |
$(PROFILE_JARS_TARGETS): |
|
250 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk) |
|
251 |
||
252 |
# Create Compact Profile images |
|
253 |
PROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES)) |
|
254 |
$(PROFILE_IMAGES_TARGETS): |
|
255 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \ |
|
256 |
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \ |
|
257 |
-f Images.gmk profile-image) |
|
258 |
||
259 |
profiles-oscheck: |
|
260 |
ifneq ($(OPENJDK_TARGET_OS), linux) |
|
261 |
@echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 |
|
262 |
endif |
|
263 |
||
264 |
bootcycle-images: |
|
265 |
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image |
|
266 |
+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images |
|
267 |
||
268 |
ALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \ |
|
269 |
$(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \ |
|
270 |
bootcycle-images |
|
271 |
||
272 |
################################################################################ |
|
273 |
# Docs targets |
|
274 |
||
275 |
docs-javadoc: |
|
276 |
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) |
|
277 |
||
278 |
docs-jvmtidoc: |
|
279 |
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs) |
|
280 |
||
281 |
ALL_TARGETS += docs-javadoc docs-jvmtidoc |
|
282 |
||
283 |
################################################################################ |
|
284 |
# Test target |
|
285 |
||
286 |
test: |
|
287 |
($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \ |
|
288 |
JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \ |
|
289 |
ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true |
|
290 |
||
291 |
test-make: |
|
292 |
($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET)) |
|
293 |
||
294 |
ALL_TARGETS += test test-make |
|
295 |
||
296 |
################################################################################ |
|
297 |
# Verification targets |
|
298 |
||
299 |
# generate modules.xml in the exploded image |
|
300 |
modules-xml: |
|
301 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk gen-modules-xml) |
|
302 |
||
303 |
verify-modules: |
|
304 |
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk checkdeps) |
|
305 |
||
306 |
ALL_TARGETS += modules-xml verify-modules |
|
307 |
||
308 |
################################################################################ |
|
309 |
# Install targets |
|
310 |
||
311 |
install: |
|
312 |
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk) |
|
313 |
||
314 |
ALL_TARGETS += install |
|
315 |
||
316 |
################################################################################ |
|
317 |
# |
|
318 |
# Dependency declarations between targets. |
|
319 |
# |
|
320 |
# These are declared in two groups. First all dependencies between targets that |
|
321 |
# have recipes above as these dependencies may be disabled. Then the aggregator |
|
322 |
# targets that do not have recipes of their own, which will never have their |
|
323 |
# dependencies disabled. |
|
324 |
# |
|
325 |
################################################################################ |
|
326 |
# Targets with recipes above |
|
327 |
||
328 |
# If running an *-only target, parallel execution and dependencies between |
|
329 |
# recipe targets are disabled. This makes it possible to run a select set of |
|
330 |
# recipe targets in order. It's the responsibility of the user to make sure |
|
331 |
# all prerequisites are fulfilled. |
|
332 |
ifneq ($(findstring -only, $(MAKECMDGOALS)), ) |
|
333 |
.NOTPARALLEL: |
|
334 |
else |
|
335 |
interim-langtools: $(LANGTOOLS_GENSRC_TARGETS) |
|
336 |
||
337 |
build-tools-jdk: interim-langtools |
|
338 |
||
339 |
$(CORBA_GENSRC_TARGETS): interim-langtools |
|
340 |
||
341 |
$(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk |
|
342 |
||
343 |
interim-corba: $(CORBA_GENSRC_TARGETS) |
|
344 |
||
345 |
$(GENDATA_TARGETS): interim-langtools build-tools-jdk |
|
346 |
||
347 |
interim-rmic: interim-langtools |
|
348 |
||
349 |
$(RMIC_TARGETS): interim-langtools interim-corba interim-rmic |
|
350 |
||
351 |
import-hotspot: hotspot |
|
352 |
||
353 |
$(LIB_TARGETS): import-hotspot |
|
354 |
||
355 |
$(LAUNCHER_TARGETS): java.base-libs |
|
356 |
||
357 |
demos: $(JAVA_TARGETS) |
|
358 |
||
359 |
# Declare dependency from <module>-java to <module>-gensrc |
|
360 |
$(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc)) |
|
361 |
||
362 |
# Declare dependencies between java modules |
|
363 |
$(foreach m, $(JAVA_MODULES), \ |
|
364 |
$(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \ |
|
365 |
$(call FindDepsForModule,$m))))) |
|
366 |
||
367 |
# Declare dependencies between <module>-rmic to <module>-java |
|
368 |
$(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java)) |
|
369 |
||
370 |
# Declare dependencies from <module>-lib to <module>-java |
|
371 |
# Skip jdk.jdwp.agent as it contains no java code. |
|
372 |
$(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java)) |
|
373 |
||
374 |
# Declare dependencies from all other <module>-lib to java.base-lib |
|
375 |
$(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \ |
|
376 |
$(eval $t: java.base-libs)) |
|
377 |
# Declare the special case dependency for jdk.deploy.osx where libosx |
|
378 |
# links against libosxapp. |
|
379 |
jdk.deploy.osx-libs: java.desktop-libs |
|
380 |
||
381 |
# This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a |
|
382 |
# header file used by jdk.jdwp libs. |
|
383 |
jdk.jdwp-libs: jdk.jdi-gensrc |
|
384 |
||
385 |
# Explicitly add dependencies for special targets |
|
386 |
java.base-java: unpack-sec |
|
387 |
||
388 |
security-jars: java |
|
389 |
||
390 |
nashorn-jar: jdk.scripting.nashorn-java |
|
391 |
||
392 |
main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot |
|
393 |
||
394 |
# On windows, the jars target needs to wait for jgss libs to be built. |
|
395 |
# Should ideally split out the sec-bin zip file generation to avoid |
|
396 |
# this dependency. |
|
397 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
398 |
main-jars: java.security.jgss-libs |
|
399 |
endif |
|
400 |
||
401 |
images: jars demos samples exploded-image source-tips |
|
402 |
||
403 |
bootcycle-images: images |
|
404 |
||
405 |
# Need to depend on jars as otherwise there will a race between all the |
|
406 |
# invocations of CreateJars.gmk. |
|
407 |
$(PROFILE_JARS_TARGETS): jars profiles-oscheck |
|
408 |
||
409 |
$(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips |
|
410 |
||
411 |
# Declare dependencies from <profile>-images to <profile>-jars |
|
412 |
$(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars)) |
|
413 |
||
414 |
docs-javadoc: $(GENSRC_TARGETS) rmic |
|
415 |
||
416 |
docs-jvmtidoc: hotspot |
|
417 |
||
418 |
test: exploded-image |
|
419 |
||
420 |
modules-xml: build-tools-jdk java |
|
421 |
||
422 |
verify-modules: exploded-image modules-xml |
|
423 |
||
424 |
endif |
|
425 |
||
426 |
################################################################################ |
|
427 |
# Virtual targets without recipes |
|
428 |
||
429 |
gensrc: $(GENSRC_TARGETS) |
|
430 |
||
431 |
gendata: $(GENDATA_TARGETS) |
|
432 |
||
433 |
copy: $(COPY_TARGETS) |
|
434 |
||
435 |
java: $(JAVA_TARGETS) |
|
436 |
||
437 |
rmic: $(RMIC_TARGETS) |
|
438 |
||
439 |
libs: $(LIB_TARGETS) |
|
440 |
||
441 |
launchers: $(LAUNCHER_TARGETS) |
|
442 |
||
443 |
# Explicitly add dependencies for these special targets |
|
444 |
java.base: import-hotspot policy-jars |
|
445 |
||
446 |
# Declare dependencies from <module> to all the individual targets specific |
|
447 |
# to that module <module>-*. |
|
448 |
$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc)) |
|
449 |
$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java)) |
|
450 |
$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata)) |
|
451 |
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic)) |
|
452 |
$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs)) |
|
453 |
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers)) |
|
454 |
$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy)) |
|
455 |
||
456 |
ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \ |
|
457 |
$(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES)) |
|
458 |
||
459 |
exploded-image: $(ALL_MODULE_TARGETS) modules-xml |
|
460 |
||
461 |
jars: main-jars nashorn-jar security-jars policy-jars |
|
462 |
||
463 |
# Make each profile name a target that depends on it's images target. |
|
464 |
$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars)) |
|
465 |
||
466 |
profiles: $(ALL_PROFILES) |
|
467 |
||
468 |
docs: docs-javadoc docs-jvmtidoc |
|
469 |
||
470 |
ALL_TARGETS += gensrc gendata copy java rmic libs launchers \ |
|
471 |
$(ALL_MODULE_TARGETS) exploded-image jars \ |
|
472 |
$(ALL_PROFILES) profiles docs |
|
473 |
||
474 |
################################################################################ |
|
475 |
||
476 |
all: images docs verify-modules |
|
477 |
default: exploded-image |
|
478 |
||
479 |
ALL_TARGETS += default all |
|
480 |
||
481 |
################################################################################ |
|
482 |
################################################################################ |
|
483 |
# |
|
484 |
# Clean targets |
|
485 |
# |
|
486 |
################################################################################ |
|
487 |
||
488 |
# If running a clean target, disable parallel execution |
|
489 |
ifneq ($(findstring clean, $(MAKECMDGOALS)), ) |
|
490 |
.NOTPARALLEL: |
|
491 |
endif |
|
492 |
||
493 |
CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \ |
|
494 |
bootcycle-build docs docstemp test |
|
495 |
CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS)) |
|
14111 | 496 |
|
497 |
# Remove everything, except the output from configure. |
|
25854 | 498 |
clean: $(CLEAN_TARGETS) |
499 |
($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*) |
|
500 |
$(ECHO) Cleaned all build artifacts. |
|
501 |
||
502 |
$(CLEAN_TARGETS): |
|
503 |
$(call CleanComponent,$(patsubst clean-%, %, $@)) |
|
504 |
||
505 |
clean-docs: clean-docstemp |
|
14111 | 506 |
|
507 |
# Remove everything, including configure configuration. |
|
508 |
# If the output directory was created by configure and now becomes empty, remove it as well. |
|
509 |
dist-clean: clean |
|
25854 | 510 |
($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \ |
511 |
Makefile compare.sh spec.sh tmp javacservers) |
|
512 |
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ |
|
20363 | 513 |
if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ |
514 |
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \ |
|
515 |
else \ |
|
25854 | 516 |
($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \ |
517 |
&& $(RM) -r $(OUTPUT_ROOT)) \ |
|
20363 | 518 |
fi \ |
519 |
) |
|
25854 | 520 |
$(ECHO) Cleaned everything, you will have to re-run configure. |
521 |
||
522 |
ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS) |
|
523 |
||
524 |
################################################################################ |
|
14111 | 525 |
|
25854 | 526 |
# Setup a rule for SPEC file that fails if executed. This check makes sure the |
527 |
# configuration is up to date after changes to configure. |
|
528 |
ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), ) |
|
529 |
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) |
|
530 |
@$(ECHO) "ERROR: $(SPEC) is not up to date." |
|
531 |
@$(ECHO) "Please rerun configure! Easiest way to do this is by running" |
|
532 |
@$(ECHO) "'make reconfigure'." |
|
533 |
@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true" |
|
534 |
@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi |
|
535 |
endif |
|
536 |
||
22716
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
537 |
reconfigure: |
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
538 |
ifneq ($(CONFIGURE_COMMAND_LINE), ) |
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
539 |
@$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'" |
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
540 |
else |
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
541 |
@$(ECHO) "Re-running configure using default settings" |
cf32fe2eb254
8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents:
22714
diff
changeset
|
542 |
endif |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22716
diff
changeset
|
543 |
@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) |
14111 | 544 |
|
25854 | 545 |
ALL_TARGETS += reconfigure |
546 |
||
547 |
################################################################################ |
|
548 |
# Declare *-only targets for each normal target |
|
549 |
$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t))) |
|
14111 | 550 |
|
25854 | 551 |
ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS)) |
552 |
||
553 |
################################################################################ |
|
554 |
||
555 |
.PHONY: $(ALL_TARGETS) |
|
556 |
||
557 |
include $(SRC_ROOT)/make/Jprt.gmk |
|
22031 | 558 |
|
14111 | 559 |
FRC: # Force target |