Main.gmk revision 2352:f34963dc0f1d
154359Sroberto#
254359Sroberto# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
354359Sroberto# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
454359Sroberto#
554359Sroberto# This code is free software; you can redistribute it and/or modify it
654359Sroberto# under the terms of the GNU General Public License version 2 only, as
7280849Scy# published by the Free Software Foundation.  Oracle designates this
854359Sroberto# particular file as subject to the "Classpath" exception as provided
9280849Scy# by Oracle in the LICENSE file that accompanied this code.
10280849Scy#
11280849Scy# This code is distributed in the hope that it will be useful, but WITHOUT
12280849Scy# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13280849Scy# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14280849Scy# version 2 for more details (a copy is included in the LICENSE file that
15182007Sroberto# accompanied this code).
16280849Scy#
1754359Sroberto# You should have received a copy of the GNU General Public License version
18182007Sroberto# 2 along with this work; if not, write to the Free Software Foundation,
19182007Sroberto# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2082498Sroberto#
2182498Sroberto# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2282498Sroberto# or visit www.oracle.com if you need additional information or have any
2382498Sroberto# questions.
2482498Sroberto#
2582498Sroberto
2654359Sroberto################################################################################
2782498Sroberto# This is the main makefile containing most actual top level targets. It needs
2882498Sroberto# to be called with a SPEC file defined.
2982498Sroberto################################################################################
3054359Sroberto
3182498Sroberto# Declare default target
3282498Srobertodefault:
3382498Sroberto
3482498Srobertoifeq ($(wildcard $(SPEC)),)
3582498Sroberto  $(error Main.gmk needs SPEC set to a proper spec.gmk)
3682498Srobertoendif
3754359Sroberto
3882498Sroberto# Now load the spec
3982498Srobertoinclude $(SPEC)
4082498Sroberto
4182498Srobertoinclude $(SRC_ROOT)/make/MainSupport.gmk
4254359Sroberto
4382498Sroberto# Load the vital tools for all the makefiles.
4482498Srobertoinclude $(SRC_ROOT)/make/common/MakeBase.gmk
4582498Srobertoinclude $(SRC_ROOT)/make/common/Modules.gmk
4682498Sroberto
4754359Sroberto# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
4882498Sroberto# valid top level targets. It's used to declare them all as PHONY and to
4982498Sroberto# generate the -only targets.
5082498SrobertoALL_TARGETS :=
5182498Sroberto
5282498Sroberto# Hook to include the corresponding custom file, if present.
5354359Sroberto$(eval $(call IncludeCustomExtension, , Main.gmk))
5482498Sroberto
5582498Sroberto# All modules for the current target platform.
5682498SrobertoALL_MODULES := $(call FindAllModules)
5782498Sroberto
5882498Sroberto################################################################################
5954359Sroberto################################################################################
6082498Sroberto#
6182498Sroberto# Recipes for all targets. Only recipes, dependencies are declared later.
6282498Sroberto#
6382498Sroberto################################################################################
6482498Sroberto
6582498Sroberto################################################################################
6682498Sroberto# Interim/build tools targets, compiling tools used during the build
6782498Sroberto
6882498Sroberto# When creating a BUILDJDK, the buildtools and interim targets have already
6982498Sroberto# been built and should not be built again.
7082498Srobertoifneq ($(CREATING_BUILDJDK), true)
7182498Sroberto  buildtools-langtools:
7282498Sroberto	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
7382498Sroberto
7454359Sroberto  interim-langtools:
7554359Sroberto	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
7654359Sroberto
7782498Sroberto  interim-rmic:
7854359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
7954359Sroberto
8054359Sroberto  interim-cldrconverter:
8154359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
8254359Sroberto
8354359Sroberto  buildtools-jdk:
8454359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk)
8554359Sroberto
8654359Sroberto  buildtools-modules:
8754359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
8854359Srobertoendif
8954359Sroberto
9054359SrobertoALL_TARGETS += buildtools-langtools interim-langtools \
9154359Sroberto    interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules
9254359Sroberto
9354359Sroberto################################################################################
9454359Sroberto# Special targets for certain modules
9554359Sroberto
9654359Srobertounpack-sec:
9754359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
98132451Sroberto
99132451Srobertogenerate-exported-symbols:
100132451Sroberto	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildStatic.gmk)
101132451Sroberto
102132451SrobertoALL_TARGETS += unpack-sec generate-exported-symbols
103280849Scy
104280849Scy################################################################################
105132451Sroberto# Gensrc targets, generating source before java compilation can be done
106132451Sroberto#
107132451Sroberto# When creating a BUILDJDK, the java targets have already been built and copied
108280849Scy# into the buildjdk so no need to generate sources.
109280849Scyifneq ($(CREATING_BUILDJDK), true)
110132451Sroberto  $(eval $(call DeclareRecipesForPhase, GENSRC, \
111132451Sroberto      TARGET_SUFFIX := gensrc, \
112132451Sroberto      FILE_PREFIX := Gensrc, \
113132451Sroberto      MAKE_SUBDIR := gensrc, \
114132451Sroberto      CHECK_MODULES := $(ALL_MODULES), \
115132451Sroberto      MULTIPLE_MAKEFILES := true))
11654359Sroberto
117132451Sroberto  JDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
118132451Sroberto  LANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
119132451Sroberto  CORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
120132451Sroberto  HOTSPOT_GENSRC_TARGETS := $(filter %-gensrc-hotspot, $(GENSRC_TARGETS))
121182007Sroberto
122182007Sroberto  GENSRC_MODULEINFO_MODULES := $(ALL_MODULES)
123280849Scy  GENSRC_MODULEINFO_TARGETS := $(addsuffix -gensrc-moduleinfo, \
124280849Scy      $(GENSRC_MODULEINFO_MODULES))
125132451Sroberto
12682498Sroberto  GENSRC_MODULES := $(GENSRC_MODULEINFO_MODULES)
127182007Sroberto  GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \
128132451Sroberto      $(addsuffix -gensrc, $(GENSRC_MODULES)))
129182007Sroberto
130280849Scy  define DeclareModuleInfoRecipe
131362716Scy    $1-gensrc-moduleinfo:
13282498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
13354359Sroberto	    -f GensrcModuleInfo.gmk MODULE=$1)
134132451Sroberto
135132451Sroberto    $1-gensrc: $1-gensrc-moduleinfo
136182007Sroberto  endef
137280849Scy
138132451Sroberto  $(foreach m, $(GENSRC_MODULEINFO_MODULES), $(eval $(call DeclareModuleInfoRecipe,$m)))
139132451Srobertoendif
140132451Sroberto
141280849ScyALL_TARGETS += $(GENSRC_TARGETS)
142132451Sroberto
143182007Sroberto################################################################################
144132451Sroberto# Generate data targets
145132451Sroberto$(eval $(call DeclareRecipesForPhase, GENDATA, \
14682498Sroberto    TARGET_SUFFIX := gendata, \
14782498Sroberto    FILE_PREFIX := Gendata, \
14882498Sroberto    MAKE_SUBDIR := gendata, \
14982498Sroberto    CHECK_MODULES := $(ALL_MODULES), \
15082498Sroberto    USE_WRAPPER := true))
15182498Sroberto
152280849ScyALL_TARGETS += $(GENDATA_TARGETS)
15382498Sroberto
15482498Sroberto################################################################################
15554359Sroberto# Copy files targets
15654359Sroberto$(eval $(call DeclareRecipesForPhase, COPY, \
15754359Sroberto    TARGET_SUFFIX := copy, \
15854359Sroberto    FILE_PREFIX := Copy, \
159280849Scy    MAKE_SUBDIR := copy, \
16054359Sroberto    CHECK_MODULES := $(ALL_MODULES), \
161280849Scy    USE_WRAPPER := true, \
16254359Sroberto    MULTIPLE_MAKEFILES := true))
16382498Sroberto
16482498SrobertoALL_COPY_MODULES += $(COPY_MODULES)
165280849ScyALL_COPY_TARGETS += $(COPY_TARGETS)
16654359Sroberto
16754359SrobertoIMPORT_COPY_MODULES := $(call FindImportedModules)
168280849ScyIMPORT_COPY_TARGETS := $(addsuffix -copy, $(IMPORT_COPY_MODULES))
169280849ScyALL_COPY_MODULES += $(IMPORT_COPY_MODULES)
170280849ScyALL_COPY_TARGETS += $(IMPORT_COPY_TARGETS)
171280849Scy
172280849Scydefine DeclareImportCopyRecipe
17354359Sroberto  $1-copy:
174280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
17554359Sroberto	    -f CopyImportModules.gmk MODULE=$1)
176280849Scyendef
177280849Scy
178298695Sdelphij$(foreach m, $(IMPORT_COPY_MODULES), $(eval $(call DeclareImportCopyRecipe,$m)))
179280849Scy
180280849ScyALL_TARGETS += $(ALL_COPY_TARGETS)
181280849Scy
182280849Scy################################################################################
183280849Scy# Targets for compiling all java modules. Nashorn is treated separately.
184280849ScyJAVA_MODULES := $(ALL_MODULES)
185280849ScyJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
186280849Scy
187280849Scydefine DeclareCompileJavaRecipe
188280849Scy  $1-java:
189280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
190280849Scy	    -f CompileJavaModules.gmk MODULE=$1)
191280849Scyendef
192280849Scy
193280849Scy$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
194280849Scy    $(eval $(call DeclareCompileJavaRecipe,$m)))
195280849Scy
196280849Scy# Build nashorn. Needs to be compiled separately from the rest of the modules
197280849Scy# due to nasgen.
198280849Scyjdk.scripting.nashorn-java:
199280849Scy	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
20054359Sroberto	    -f BuildNashorn.gmk compile)
20154359Sroberto
20254359SrobertoALL_TARGETS += $(JAVA_TARGETS)
20354359Sroberto
20454359Sroberto################################################################################
205182007Sroberto# Targets for running rmic.
206182007Sroberto$(eval $(call DeclareRecipesForPhase, RMIC, \
207182007Sroberto    TARGET_SUFFIX := rmic, \
208182007Sroberto    FILE_PREFIX := Rmic, \
209182007Sroberto    MAKE_SUBDIR := rmic, \
210280849Scy    CHECK_MODULES := $(ALL_MODULES)))
211182007Sroberto
212280849ScyALL_TARGETS += $(RMIC_TARGETS)
213280849Scy
214280849Scy################################################################################
215280849Scy# Targets for compiling native libraries
216280849Scy$(eval $(call DeclareRecipesForPhase, LIBS, \
21754359Sroberto    TARGET_SUFFIX := libs, \
21882498Sroberto    FILE_PREFIX := Lib, \
21954359Sroberto    MAKE_SUBDIR := lib, \
22054359Sroberto    CHECK_MODULES := $(ALL_MODULES), \
22154359Sroberto    USE_WRAPPER := true))
222182007Sroberto
223182007SrobertoALL_TARGETS += $(LIBS_TARGETS)
22454359Sroberto
225182007Sroberto################################################################################
226182007Sroberto# Targets for compiling native executables
22754359Sroberto$(eval $(call DeclareRecipesForPhase, LAUNCHER, \
22882498Sroberto    TARGET_SUFFIX := launchers, \
229280849Scy    FILE_PREFIX := Launcher, \
230182007Sroberto    MAKE_SUBDIR := launcher, \
231280849Scy    CHECK_MODULES := $(ALL_MODULES), \
232280849Scy    USE_WRAPPER := true))
233280849Scy
234182007SrobertoALL_TARGETS += $(LAUNCHER_TARGETS)
235182007Sroberto
236182007Sroberto################################################################################
237182007Sroberto# Build hotspot target
238182007Sroberto
239182007Srobertoifeq ($(BUILD_HOTSPOT),true)
240182007Sroberto  hotspot:
241182007Sroberto	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildHotspot.gmk)
242182007Srobertoendif
243182007Sroberto
24454359Srobertohotspot-ide-project:
24554359Sroberto	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ide/CreateVSProject.gmk)
246298695Sdelphij
247298695SdelphijALL_TARGETS += hotspot hotspot-ide-project
248298695Sdelphij
249298695Sdelphij################################################################################
250298695Sdelphij# Build demos and samples targets
251298695Sdelphij
252298695Sdelphijdemos-jdk:
25382498Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
25482498Sroberto
25554359Srobertosamples-jdk:
25654359Sroberto	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
25754359Sroberto
258280849ScyALL_TARGETS += demos-jdk samples-jdk
259280849Scy
260280849Scy################################################################################
261280849Scy# Jigsaw specific data and analysis targets.
262280849Scy
263280849Scygenerate-summary:
264280849Scy	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) -f GenerateModuleSummary.gmk)
265280849Scy
266280849ScyALL_TARGETS += generate-summary
26782498Sroberto
26882498Sroberto################################################################################
26982498Sroberto# Jmod targets
27082498Sroberto
27182498SrobertoJMOD_MODULES := $(ALL_MODULES)
27282498SrobertoJMOD_TARGETS := $(addsuffix -jmod, $(JMOD_MODULES))
27382498Sroberto
27482498Srobertodefine DeclareJmodRecipe
27582498Sroberto  $1-jmod:
27682498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
277280849Scy	    MODULE=$1)
278280849Scyendef
27954359Sroberto
28082498Sroberto$(foreach m, $(JMOD_MODULES), $(eval $(call DeclareJmodRecipe,$m)))
28182498Sroberto
28282498SrobertoALL_TARGETS += $(JMOD_TARGETS)
283182007Sroberto
28482498Sroberto################################################################################
28582498Sroberto# Images targets
28682498Sroberto
28782498Srobertostore-source-revision:
288182007Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk store-source-revision)
28954359Sroberto
29082498Srobertocreate-source-revision-tracker:
29182498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk create-source-revision-tracker)
29282498Sroberto
29382498SrobertoBOOTCYCLE_TARGET := product-images
29482498Srobertobootcycle-images:
29582498Sroberto        ifneq ($(COMPILE_TYPE), cross)
296182007Sroberto	  $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
29782498Sroberto	  +$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
298280849Scy	      JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
299280849Scy        else
30082498Sroberto	  $(call LogWarn, Boot cycle build disabled when cross compiling)
30182498Sroberto        endif
30282498Sroberto
30382498Srobertozip-security:
30482498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
30582498Sroberto
30682498Srobertozip-source:
307280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
308280849Scy
309280849Scyjrtfs-jar:
31082498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
31182498Sroberto
312132451Srobertojdk-image:
313132451Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jdk)
314132451Sroberto
315132451Srobertojre-image:
316280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jre)
31782498Sroberto
318280849Scysymbols-image:
319132451Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk symbols)
320280849Scy
321280849Scyprofiles:
322280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
323280849Scy
324132451Srobertomac-bundles-jdk:
325132451Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
326280849Scy
327132451Srobertorelease-file:
32882498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ReleaseFile.gmk)
32982498Sroberto
33082498Srobertoexploded-image-optimize:
33182498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
33282498Sroberto
333132451SrobertoALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
334132451Sroberto    zip-source jrtfs-jar jdk-image jre-image \
335280849Scy    symbols-image profiles mac-bundles-jdk \
33682498Sroberto    release-file exploded-image-optimize
337280849Scy
33882498Sroberto################################################################################
33982498Sroberto# Docs targets
34082498Sroberto
34182498Srobertodocs-javadoc:
34282498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javadoc)
343280849Scy
34482498Srobertodocs-copy:
345280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
34682498Sroberto
347280849Scydocs-zip:
348280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
349280849Scy
350280849ScyALL_TARGETS += docs-javadoc docs-copy docs-zip
35182498Sroberto
35282498Sroberto################################################################################
35382498Sroberto# Cross compilation support
35482498Sroberto
35582498Srobertoifeq ($(CREATING_BUILDJDK), true)
35682498Sroberto  # This target is only called by the recursive call below.
35782498Sroberto  create-buildjdk-interim-image-helper: interim-image jdk.jlink-launchers \
358280849Scy      java.base-copy jdk.jdeps-launchers
359280849Scyendif
360280849Scy
361294554Sdelphijcreate-buildjdk-copy:
362358659Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateBuildJdkCopy.gmk)
36382498Sroberto
36482498Srobertocreate-buildjdk-interim-image:
36582498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \
36682498Sroberto	    $@-helper \
367280849Scy	    SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
368280849Scy	    HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
36982498Sroberto	    CREATING_BUILDJDK=true)
37082498Sroberto
371280849ScyALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image
372280849Scy
373280849Scy################################################################################
374280849Scy# The interim-image is a small jlinked image that is used to generate artifacts
375280849Scy# at build time for use when linking the real images.
376280849Scy
377280849ScyINTERIM_JMOD_TARGETS := $(addsuffix -interim-jmod, $(INTERIM_IMAGE_MODULES))
378280849Scy
379280849Scydefine DeclareInterimJmodRecipe
380280849Scy  $1-interim-jmod:
381280849Scy	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
38282498Sroberto	    MODULE=$1 \
38382498Sroberto	    JMODS_DIR=$(INTERIM_JMODS_DIR) \
38482498Sroberto	    JMODS_TEMPDIR=$(INTERIM_JMODS_DIR)/temp \
385280849Scy	    INTERIM_JMOD=true \
386280849Scy	)
387280849Scyendef
38882498Sroberto
38982498Sroberto$(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $(call DeclareInterimJmodRecipe,$m)))
390182007Sroberto
39154359Srobertointerim-image:
39282498Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
39354359Sroberto
39482498Srobertoifeq ($(ENABLE_GENERATE_CLASSLIST), true)
395309007Sdelphij  generate-link-opt-data:
396294554Sdelphij	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f GenerateLinkOptData.gmk)
39782498Srobertoendif
39882498Sroberto
39982498SrobertoALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
40082498Sroberto
401280849Scy################################################################################
402280849Scy# Build tests
403298695Sdelphij#
404280849Scy
405280849Scyprepare-test-image:
406280849Scy	$(MKDIR) -p $(TEST_IMAGE_DIR)
407280849Scy	$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
40854359Sroberto
40954359Srobertobuild-test-hotspot-jtreg-native:
41054359Sroberto	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
41154359Sroberto	    build-test-hotspot-jtreg-native)
41254359Sroberto
41354359Srobertotest-image-hotspot-jtreg-native:
41454359Sroberto	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
41554359Sroberto	    test-image-hotspot-jtreg-native)
41654359Sroberto
41754359Srobertobuild-test-jdk-jtreg-native:
41854359Sroberto	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
419182007Sroberto	    build-test-jdk-jtreg-native)
420182007Sroberto
421182007Srobertotest-image-jdk-jtreg-native:
422182007Sroberto	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
423309007Sdelphij	    test-image-jdk-jtreg-native)
424132451Sroberto
425182007Srobertoifeq ($(BUILD_GTEST), true)
426182007Sroberto  test-image-hotspot-gtest:
42754359Sroberto	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
42854359Srobertoendif
42954359Sroberto
430182007Srobertobuild-test-lib:
431182007Sroberto	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
432182007Sroberto
433182007Srobertoifeq ($(BUILD_FAILURE_HANDLER), true)
434182007Sroberto  # Builds the failure handler jtreg extension
435182007Sroberto  build-test-failure-handler:
436309007Sdelphij	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
437182007Sroberto	    -f BuildFailureHandler.gmk build)
438182007Sroberto
43954359Sroberto  # Runs the tests for the failure handler jtreg extension
44054359Sroberto  test-failure-handler:
44154359Sroberto	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
44254359Sroberto	    -f BuildFailureHandler.gmk test)
443132451Sroberto
44454359Sroberto  # Copies the failure handler jtreg extension into the test image
44554359Sroberto  test-image-failure-handler:
44682498Sroberto	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
44754359Sroberto	     -f BuildFailureHandler.gmk images)
44854359Srobertoendif
449282408Scy
45054359SrobertoALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
45182498Sroberto    test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
452280849Scy    test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
45382498Sroberto    test-failure-handler test-image-failure-handler test-image-hotspot-gtest
454280849Scy
455280849Scy################################################################################
456280849Scy# Run tests
457280849Scy
458280849Scy# Run tests specified by $(TEST), or the default test set.
459280849Scytest:
460280849Scy	$(call RunTests, $(TEST), $(JDK_IMAGE_DIR))
461280849Scy
462280849Scytest-hotspot-jtreg:
463280849Scy	$(call RunTests, "hotspot_all", $(JDK_IMAGE_DIR))
464280849Scy
465280849Scytest-hotspot-jtreg-native:
466280849Scy	$(call RunTests, "hotspot_native_sanity", $(JDK_IMAGE_DIR))
467282408Scy
468280849Scytest-hotspot-internal:
469282408Scy	$(call RunTests, "hotspot_internal", $(JDK_OUTPUTDIR))
470358659Scy
47154359Srobertotest-hotspot-gtest:
47254359Sroberto	$(call RunTests, "hotspot_gtest", $(JDK_OUTPUTDIR))
47354359Sroberto
47454359Srobertotest-jdk-jtreg-native:
47554359Sroberto	$(call RunTests, "jdk_native_sanity", $(JDK_IMAGE_DIR))
47654359Sroberto
47754359Srobertotest-make:
47854359Sroberto	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
479280849Scy
480132451SrobertoALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \
481132451Sroberto    test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make
482132451Sroberto
48382498Sroberto################################################################################
48482498Sroberto# Bundles
48554359Sroberto
48654359Srobertoproduct-bundles:
48754359Sroberto	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
48854359Sroberto
48954359Srobertotest-bundles:
49054359Sroberto	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
49154359Sroberto
49256746Srobertodocs-bundles:
49354359Sroberto	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
494132451Sroberto
49556746SrobertoALL_TARGETS += product-bundles test-bundles docs-bundles
49654359Sroberto
49754359Sroberto################################################################################
49854359Sroberto# Install targets
49954359Sroberto
50054359Srobertoinstall:
50154359Sroberto	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
50254359Sroberto
50354359SrobertoALL_TARGETS += install
50454359Sroberto
50554359Sroberto################################################################################
506182007Sroberto#
50754359Sroberto# Dependency declarations between targets.
50854359Sroberto#
50954359Sroberto# These are declared in two groups. First all dependencies between targets that
51054359Sroberto# have recipes above as these dependencies may be disabled. Then the aggregator
511182007Sroberto# targets that do not have recipes of their own, which will never have their
512182007Sroberto# dependencies disabled.
51354359Sroberto#
514132451Sroberto################################################################################
51554359Sroberto# Targets with recipes above
51654359Sroberto
51754359Sroberto# If running an *-only target, parallel execution and dependencies between
51854359Sroberto# recipe targets are disabled. This makes it possible to run a select set of
519132451Sroberto# recipe targets in order. It's the responsibility of the user to make sure
520132451Sroberto# all prerequisites are fulfilled.
521132451Srobertoifneq ($(findstring -only, $(MAKECMDGOALS)), )
52256746Sroberto  .NOTPARALLEL:
52356746Srobertoelse
52456746Sroberto  $(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
525132451Sroberto
52682498Sroberto  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
527106163Sroberto
528106424Sroberto  buildtools-jdk: interim-langtools interim-cldrconverter
529106424Sroberto
530106424Sroberto  buildtools-modules: exploded-image-base
531132451Sroberto
532280849Scy  $(CORBA_GENSRC_TARGETS): interim-langtools
533280849Scy
534280849Scy  $(HOTSPOT_GENSRC_TARGETS): interim-langtools
53554359Sroberto
536132451Sroberto  $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
53754359Sroberto
53854359Sroberto  $(GENSRC_MODULEINFO_TARGETS): buildtools-jdk
53954359Sroberto
54054359Sroberto  $(GENDATA_TARGETS): interim-langtools buildtools-jdk
54154359Sroberto
54254359Sroberto  interim-rmic: interim-langtools
54354359Sroberto
54454359Sroberto  $(RMIC_TARGETS): interim-langtools interim-rmic
54554359Sroberto
546280849Scy  $(JAVA_TARGETS): interim-langtools
54782498Sroberto
54882498Sroberto  hotspot-ide-project: hotspot exploded-image
54982498Sroberto
550280849Scy  generate-exported-symbols: java.base-libs jdk.jdwp.agent-libs
551280849Scy
552280849Scy  $(LIBS_TARGETS): hotspot
553280849Scy
55482498Sroberto  $(LAUNCHER_TARGETS): java.base-libs
55582498Sroberto
55682498Sroberto  ifeq ($(STATIC_BUILD), true)
55754359Sroberto    $(LAUNCHER_TARGETS): generate-exported-symbols
558330106Sdelphij  endif
559330106Sdelphij
560330106Sdelphij  # The demos are currently linking to libjvm and libjava, just like all other
561330106Sdelphij  # jdk libs, even though they don't need to. To avoid warnings, make sure they
562280849Scy  # aren't built until after libjava and libjvm are available to link to.
563330106Sdelphij  demos-jdk: java.base-libs exploded-image-optimize
564330106Sdelphij
56554359Sroberto  # Declare dependency from <module>-java to <module>-gensrc
56654359Sroberto  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
56754359Sroberto
568280849Scy  # Declare dependencies between java modules
56982498Sroberto  $(foreach m, $(JAVA_MODULES), \
57082498Sroberto      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
57182498Sroberto      $(call FindDepsForModule,$m)))))
572280849Scy
57382498Sroberto  # Declare dependencies between <module>-rmic to <module>-java
57482498Sroberto  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
575280849Scy
576280849Scy  # Declare dependencies from <module>-lib to <module>-java
577280849Scy  # Skip modules that do not have java source.
578280849Scy  # When creating a BUILDJDK, the java compilation has already been done by the
579280849Scy  # normal build and copied in.
580280849Scy  ifneq ($(CREATING_BUILDJDK), true)
581280849Scy    $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
58254359Sroberto  endif
583280849Scy
584280849Scy  # Declare dependencies from all other <module>-lib to java.base-lib
585280849Scy  $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
586280849Scy      $(eval $t: java.base-libs))
587280849Scy
58854359Sroberto  # jdk.accessibility depends on java.desktop
58954359Sroberto  jdk.accessibility-libs: java.desktop-libs
59054359Sroberto
59154359Sroberto  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
59254359Sroberto  # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
59354359Sroberto  # virtual target.
59454359Sroberto  jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
59554359Sroberto
59654359Sroberto  # The swing beans need to have java base properly generated to avoid errors
59754359Sroberto  # in javadoc.
598280849Scy  java.desktop-gensrc-jdk: java.base-gensrc
599280849Scy
60054359Sroberto  # The annotation processing for jdk.vm.ci needs java.base classes from the
601280849Scy  # current JDK.
602280849Scy  jdk.vm.ci-gensrc-hotspot: java.base-java
60354359Sroberto
60454359Sroberto  # Explicitly add dependencies for special targets
60554359Sroberto  java.base-java: unpack-sec
60654359Sroberto
60754359Sroberto  jdk.jdeps-gendata: java rmic
60854359Sroberto
60954359Sroberto  # Declare dependencies between jmod targets.
61054359Sroberto  # java.base jmod needs jrt-fs.jar and access to the other jmods to be built.
61154359Sroberto  # When creating a BUILDJDK, we don't need to add hashes to java.base, thus
61254359Sroberto  # we don't need to depend on all other jmods
61354359Sroberto  ifneq ($(CREATING_BUILDJDK), true)
61454359Sroberto    java.base-jmod: jrtfs-jar $(filter-out java.base-jmod \
615338530Sdelphij        $(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
61682498Sroberto  endif
617338530Sdelphij
618338530Sdelphij  # Declare dependencies from <module>-jmod to all other module targets
619338530Sdelphij  # When creating a BUILDJDK, the java compilation has already been done by the
620338530Sdelphij  # normal build and copied in.
621338530Sdelphij  ifneq ($(CREATING_BUILDJDK), true)
622338530Sdelphij    $(foreach m, $(JAVA_MODULES), $(eval $m_JMOD_DEPS += $m-java))
623338530Sdelphij  endif
624338530Sdelphij  $(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata))
625338530Sdelphij  $(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic))
626338530Sdelphij  $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs))
627338530Sdelphij  $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers))
62882498Sroberto  $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy))
62982498Sroberto  $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
630132451Sroberto  $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
631132451Sroberto
63254359Sroberto  # Jmods cannot be created until we have the jmod tool ready to run. During
63354359Sroberto  # a normal build we run it from the exploded image, but when cross compiling
63482498Sroberto  # it's run from the buildjdk, which is either created at build time or user
63554359Sroberto  # supplied.
63682498Sroberto  #
637280849Scy  # For the exploded image to be runnable, all java modules and
638280849Scy  # jdk.jlink-launchers need to be built. We also need to copy jvm.cfg (done
639280849Scy  # in java.base-copy) and tzdb.dat (done in java.base-gendata) to the
640280849Scy  # appropriate location otherwise jimage, jlink and jmod won't start. This
641280849Scy  # also applies when creating the buildjdk.
642280849Scy  DEFAULT_JMOD_DEPS := java.base-libs java.base-copy java.base-gendata \
643280849Scy      jdk.jlink-launchers
644280849Scy  # When cross compiling and buildjdk is to be created, depend on creating the
645280849Scy  # buildjdk instead of the default dependencies.
646280849Scy  ifeq ($(CREATE_BUILDJDK), true)
647280849Scy    # Avoid calling create-buildjdk from within a create-buildjdk call.
648280849Scy    ifneq ($(CREATING_BUILDJDK), true)
649280849Scy      $(JMOD_TARGETS): create-buildjdk
650280849Scy      buildtools-modules: create-buildjdk
651280849Scy    else
65254359Sroberto      # While actually creating the buildjdk, the default deps applies.
65382498Sroberto      $(JMOD_TARGETS) $(INTERIM_JMOD_TARGETS): $(DEFAULT_JMOD_DEPS)
65482498Sroberto    endif
65582498Sroberto  else
656280849Scy    # The normal non cross compilation case uses the default deps.
657280849Scy    # To avoid races with the optimize target, that also needs to happen first.
658280849Scy    $(JMOD_TARGETS) $(INTERIM_JMOD_TARGETS): $(DEFAULT_JMOD_DEPS) \
659280849Scy        exploded-image-optimize
660280849Scy  endif
661280849Scy
662280849Scy  zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
663280849Scy      $(filter jdk.crypto%, $(JAVA_TARGETS))
664280849Scy
665280849Scy  zip-source: gensrc rmic
666280849Scy
667280849Scy  jrtfs-jar: interim-langtools
668280849Scy
669280849Scy  ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
670280849Scy    ifeq ($(CREATE_BUILDJDK), true)
67154359Sroberto      # If creating a buildjdk, the interim image needs to be based on that.
67254359Sroberto      generate-link-opt-data: create-buildjdk
67354359Sroberto    else ifeq ($(EXTERNAL_BUILDJDK), false)
67454359Sroberto      # If an external buildjdk has been provided, we skip generating an
67582498Sroberto      # interim-image and just use the external buildjdk for generating
676280849Scy      # classlist.
677280849Scy      generate-link-opt-data: interim-image
678280849Scy    endif
679280849Scy    generate-link-opt-data: buildtools-jdk
680280849Scy
681280849Scy    # The generated classlist needs to go into java.base-jmod.
68254359Sroberto    java.base-jmod jdk-image jre-image: generate-link-opt-data
68354359Sroberto  endif
68454359Sroberto
68554359Sroberto  release-file: create-source-revision-tracker
68654359Sroberto
68754359Sroberto  jdk-image: jmods zip-source demos samples release-file
68854359Sroberto  jre-image: jmods release-file
68954359Sroberto
69054359Sroberto  profiles: jmods release-file
69182498Sroberto
69282498Sroberto  mac-bundles-jdk: jdk-image jre-image
69354359Sroberto
694280849Scy  # The optimize target can run as soon as the modules dir has been completely
695280849Scy  # populated (java, copy and gendata targets) and the basic libs and launchers
696280849Scy  # have been built.
69754359Sroberto  exploded-image-optimize: java copy gendata java.base-libs java.base-launchers \
69854359Sroberto      buildtools-modules
69954359Sroberto
70054359Sroberto  bootcycle-images: jdk-image
70154359Sroberto
70254359Sroberto  docs-javadoc: $(GENSRC_TARGETS) rmic
70354359Sroberto
70454359Sroberto  # The gensrc step for jdk.jdi creates an html file that is used by docs-copy.
70554359Sroberto  docs-copy: hotspot jdk.jdi-gensrc
70654359Sroberto
70754359Sroberto  docs-zip: docs-javadoc docs-copy
70854359Sroberto
70954359Sroberto  test: jdk-image test-image
71054359Sroberto
71154359Sroberto  create-buildjdk-copy: jdk.jlink-java java.base-gendata \
71254359Sroberto      $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
71354359Sroberto
71454359Sroberto  create-buildjdk-interim-image: create-buildjdk-copy
71554359Sroberto
71654359Sroberto  interim-image: $(INTERIM_JMOD_TARGETS)
71754359Sroberto
71854359Sroberto  test-make: clean-test-make
71954359Sroberto
72054359Sroberto  build-test-lib: exploded-image-optimize
72182498Sroberto
72282498Sroberto  build-test-failure-handler: interim-langtools
723132451Sroberto
724182007Sroberto  test-failure-handler: build-test-failure-handler
725182007Sroberto
726182007Sroberto  test-image-failure-handler: build-test-failure-handler
727182007Sroberto
728182007Sroberto  build-test-hotspot-jtreg-native: buildtools-jdk hotspot
729182007Sroberto
730182007Sroberto  build-test-jdk-jtreg-native: buildtools-jdk
731182007Sroberto
732280849Scy  test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
733182007Sroberto
734182007Sroberto  test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
735182007Sroberto
736280849Scy  test-image-hotspot-gtest: hotspot
737280849Scy
738294554Sdelphij  test-hotspot-internal: exploded-image
739294554Sdelphij
740294554Sdelphij  test-hotspot-jtreg: jdk-image test-image
741301247Sdelphij
742309007Sdelphij  test-hotspot-gtest: exploded-image test-image-hotspot-gtest
74354359Sroberto
74454359Sroberto  install: product-images
74554359Sroberto
74654359Sroberto  product-bundles: product-images
747280849Scy
748280849Scy  test-bundles: test-image
749282408Scy
750309007Sdelphij  docs-bundles: docs-image
751282408Scy
752282408Scy  generate-summary: jmods buildtools-modules
753282408Scy
754282408Scyendif
755282408Scy
756282408Scy################################################################################
757282408Scy# Virtual targets without recipes
758282408Scy
759282408Scybuildtools: buildtools-langtools interim-langtools interim-rmic \
760282408Scy    buildtools-jdk
761282408Scy
76254359Srobertogensrc: $(GENSRC_TARGETS)
76354359Sroberto
76454359Srobertogendata: $(GENDATA_TARGETS)
76554359Sroberto
76654359Srobertocopy: $(ALL_COPY_TARGETS)
76754359Sroberto
76854359Srobertojava: $(JAVA_TARGETS)
769280849Scy
77054359Srobertormic: $(RMIC_TARGETS)
771132451Sroberto
77254359Srobertolibs: $(LIBS_TARGETS)
77354359Sroberto
77454359Srobertolaunchers: $(LAUNCHER_TARGETS)
77554359Sroberto
77654359Srobertojmods: $(JMOD_TARGETS)
77782498Sroberto
77854359Sroberto# Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
77954359Sroberto# is actually handled by jdk.jdi-gensrc
78054359Srobertojdk.jdwp.agent-gensrc: jdk.jdi-gensrc
781280849Scy
78254359Sroberto# Declare dependencies from <module> to all the individual targets specific
783280849Scy# to that module <module>-*, that are needed for the exploded image.
784280849Scy$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
785280849Scy$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
786280849Scy$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
787280849Scy$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
788280849Scy$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
789280849Scy$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
790280849Scy$(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
791280849Scydemos: demos-jdk
792280849Scy
793280849Scysamples: samples-jdk
79454359Sroberto
79554359Sroberto# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
79682498Srobertoexploded-image-base: $(ALL_MODULES)
797280849Scyexploded-image: exploded-image-base release-file
798280849Scy# When cross compiling, no need to optimize the exploded image since it won't
79982498Sroberto# be runnable on the host platform anyway.
800280849Scyifneq ($(COMPILE_TYPE), cross)
801280849Scy  exploded-image: exploded-image-optimize
802280849Scyendif
803280849Scy
804280849Scycreate-buildjdk: create-buildjdk-copy create-buildjdk-interim-image
805280849Scy
806280849Scymac-bundles: mac-bundles-jdk
80754359Sroberto
808280849Scy# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
809280849Scy# and in line with this, our targets for creating these are named *-image[s].
810280849Scy
811280849Scy# This target builds the product images, e.g. the JRE and JDK image
812280849Scy# (and possibly other, more specific versions)
813280849Scyproduct-images: jdk-image jre-image symbols-image exploded-image
814280849Scy
815280849Scy# zip-security is actually a bundle, but for now it needs to be considered
816280849Scy# an image until this can be cleaned up properly.
817280849Scyproduct-images: zip-security
818280849Scy
819280849Scy# The module summary cannot be run when:
820280849Scy# * Cross compiling and building a partial BUILDJDK for the build host
82154359Sroberto# * An external buildjdk has been supplied since it may not match the
82254359Sroberto#   module selection of the target jdk
823280849Scyifneq ($(CREATE_BUILDJDK), true)
824280849Scy  ifeq ($(EXTERNAL_BUILDJDK), false)
825280849Scy    product-images: generate-summary
82654359Sroberto  endif
82754359Srobertoendif
82854359Sroberto
829280849Scyifeq ($(OPENJDK_TARGET_OS), macosx)
830280849Scy  product-images: mac-bundles
831280849Scyendif
832280849Scy
83354359Sroberto# This target builds the documentation image
834280849Scydocs-image: docs-javadoc docs-copy
835280849Scy
836280849Scy# This target builds the test image
837280849Scytest-image: prepare-test-image test-image-hotspot-jtreg-native \
838280849Scy    test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest
839280849Scy
840280849Scy# all-images builds all our deliverables as images.
841330106Sdelphijall-images: product-images test-image docs-image
842330106Sdelphij
843330106Sdelphij# all-bundles packages all our deliverables as tar.gz bundles.
844330106Sdelphijall-bundles: product-bundles test-bundles docs-bundles
845330106Sdelphij
846358659ScyALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers jmods \
847330106Sdelphij    jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples \
848280849Scy    exploded-image-base exploded-image \
849280849Scy    create-buildjdk mac-bundles product-images docs-image test-image all-images \
850280849Scy    all-bundles
851280849Scy
852132451Sroberto################################################################################
853280849Scy
854280849Scy# Traditional targets typically run by users.
855280849Scy# These can be considered aliases for the targets now named by a more
856280849Scy# "modern" naming scheme.
857132451Srobertodefault: $(DEFAULT_MAKE_TARGET)
858330106Sdelphijjdk: exploded-image
859330106Sdelphijimages: product-images
860330106Sdelphijdocs: docs-image
861330106Sdelphijbundles: all-bundles
862330106Sdelphijall: all-images
863330106Sdelphij
864330106SdelphijALL_TARGETS += default jdk images docs bundles all
865330106Sdelphij
866330106Sdelphij################################################################################
867330106Sdelphij################################################################################
86854359Sroberto#
869330106Sdelphij# Clean targets
87054359Sroberto#
871280849Scy################################################################################
872280849Scy# Clean targets are automatically run serially by the Makefile calling this
873280849Scy# file.
874280849Scy
875280849ScyCLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
876330106Sdelphij    images make-support test-make bundles buildjdk
877330106SdelphijCLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
878132451SrobertoCLEAN_SUPPORT_DIRS += demos
879132451SrobertoCLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
880330106SdelphijCLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
88154359SrobertoCLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
882330106SdelphijCLEAN_PHASES := gensrc java native include
883330106SdelphijCLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
884330106SdelphijCLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
885330106Sdelphij# Construct targets of the form clean-$module-$phase
886132451SrobertoCLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
887330106Sdelphij    $(addprefix $m-, $(CLEAN_PHASES))))
888330106Sdelphij
889330106Sdelphij# Remove everything, except the output from configure.
890330106Sdelphijclean: $(CLEAN_DIR_TARGETS)
891132451Sroberto	($(CD) $(OUTPUT_ROOT) && $(RM) -r build*.log*)
892358659Scy	$(ECHO) Cleaned all build artifacts.
893358659Scy
894358659Scyclean-docs:
895358659Scy	$(call CleanDocs)
896280849Scy
897280849Scy$(CLEAN_DIR_TARGETS):
898280849Scy	$(call CleanDir,$(patsubst clean-%, %, $@))
899280849Scy
900358659Scy$(CLEAN_SUPPORT_DIR_TARGETS):
901132451Sroberto	$(call CleanSupportDir,$(patsubst clean-%, %, $@))
90254359Sroberto
903330106Sdelphij$(CLEAN_TEST_TARGETS):
90454359Sroberto	$(call CleanTest,$(patsubst clean-test-%, %, $@))
905280849Scy
906280849Scy$(CLEAN_PHASE_TARGETS):
907280849Scy	$(call Clean-$(patsubst clean-%,%, $@))
90854359Sroberto
90954359Sroberto$(CLEAN_MODULE_TARGETS):
91054359Sroberto	$(call CleanModule,$(patsubst clean-%, %, $@))
91154359Sroberto
912330106Sdelphij$(CLEAN_MODULE_PHASE_TARGETS):
913330106Sdelphij	$(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
914330106Sdelphij	    $(word 2, $(subst -,$(SPACE),$@)))
915330106Sdelphij
916330106Sdelphij# When removing the support dir, we must also remove jdk. Building classes has
917330106Sdelphij# the side effect of generating native headers. The headers end up in support
918330106Sdelphij# while classes and touch files end up in jdk.
91954359Srobertoclean-support: clean-jdk
92054359Sroberto
92154359Sroberto# Remove everything, including configure configuration. If the output
92254359Sroberto# directory was created by configure and now becomes empty, remove it as well.
92354359Srobertodist-clean: clean
92454359Sroberto	($(CD) $(OUTPUT_ROOT) && \
92554359Sroberto	    $(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide)
92654359Sroberto	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
92754359Sroberto	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
92854359Sroberto	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
92954359Sroberto	  else \
93054359Sroberto	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
931182007Sroberto	        && $(RM) -r $(OUTPUT_ROOT)) \
932182007Sroberto	  fi \
933282408Scy	)
934282408Scy	$(ECHO) Cleaned everything, you will have to re-run configure.
935182007Sroberto
936280849ScyALL_TARGETS += clean clean-docs dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_SUPPORT_DIR_TARGETS) \
937182007Sroberto    $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) \
938182007Sroberto    $(CLEAN_MODULE_PHASE_TARGETS)
939282408Scy
94054359Sroberto################################################################################
94154359Sroberto# Declare *-only targets for each normal target
94254359Sroberto$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
94354359Sroberto
94454359SrobertoALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
94554359Sroberto
946280849Scy################################################################################
947280849Scy
948280849Scy# Include JPRT targets
949280849Scyinclude $(SRC_ROOT)/make/Jprt.gmk
95054359Sroberto
951################################################################################
952
953# The following targets are intentionally not added to ALL_TARGETS since they
954# are internal only, to support Init.gmk.
955
956print-targets:
957	  @$(ECHO) $(sort $(ALL_TARGETS))
958
959print-modules:
960	  @$(ECHO) $(sort $(ALL_MODULES))
961
962create-main-targets-include:
963	  $(call LogInfo, Generating main target list)
964	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
965	      $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
966
967################################################################################
968
969.PHONY: $(ALL_TARGETS)
970
971FRC: # Force target
972