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