Main.gmk revision 1410:e805c9330c7a
16081Sphk#
28857Srgrimes# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
319983Smckay# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
419983Smckay#
519983Smckay# This code is free software; you can redistribute it and/or modify it
619983Smckay# under the terms of the GNU General Public License version 2 only, as
76081Sphk# published by the Free Software Foundation.  Oracle designates this
86081Sphk# particular file as subject to the "Classpath" exception as provided
96081Sphk# by Oracle in the LICENSE file that accompanied this code.
108857Srgrimes#
118857Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
128857Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1316880Sgpalmer# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1450479Speter# version 2 for more details (a copy is included in the LICENSE file that
156081Sphk# accompanied this code).
166081Sphk#
176081Sphk# You should have received a copy of the GNU General Public License version
1816880Sgpalmer# 2 along with this work; if not, write to the Free Software Foundation,
196081Sphk# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
206290Sphk#
2116880Sgpalmer# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
226081Sphk# or visit www.oracle.com if you need additional information or have any
236081Sphk# questions.
246081Sphk#
256081Sphk
2619983Smckay################################################################################
276081Sphk# This is the main makefile containing most actual top level targets. It needs
286081Sphk# to be called with a SPEC file defined.
296081Sphk################################################################################
306081Sphk
316081Sphk# Declare default target
32202918Smckaydefault:
336081Sphk
3419983Smckayifeq ($(wildcard $(SPEC)),)
3519983Smckay  $(error Main.gmk needs SPEC set to a proper spec.gmk)
3619983Smckayendif
376081Sphk
3819983Smckay# Now load the spec
3919983Smckayinclude $(SPEC)
4019983Smckay
4119983Smckayinclude $(SRC_ROOT)/make/MainSupport.gmk
426081Sphk
436081Sphk# Load the vital tools for all the makefiles.
446081Sphkinclude $(SRC_ROOT)/make/common/MakeBase.gmk
4519983Smckayinclude $(SRC_ROOT)/make/common/Modules.gmk
46117503Skris
476081Sphk# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
486081Sphk# valid top level targets. It's used to declare them all as PHONY and to
496081Sphk# generate the -only targets.
506290SphkALL_TARGETS :=
516081Sphk
526081Sphk# Hook to include the corresponding custom file, if present.
5319983Smckay$(eval $(call IncludeCustomExtension, , Main.gmk))
546081Sphk
556081Sphk# All modules for the current target platform.
566081Sphk# Manually add jdk.hotspot.agent for now.
576081SphkALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
586081Sphk
5916880Sgpalmer################################################################################
6019983Smckay################################################################################
6119983Smckay#
626081Sphk# Recipes for all targets. Only recipes, dependencies are declared later.
636081Sphk#
646081Sphk################################################################################
656081Sphk
6616880Sgpalmer################################################################################
676081Sphk# Interim/build tools targets, compiling tools used during the build
686081Sphk
696081Sphkbuildtools-langtools:
7016880Sgpalmer	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
716081Sphk
726081Sphkinterim-langtools:
736081Sphk	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
746081Sphk
756081Sphkinterim-corba:
766081Sphk	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
776081Sphk
786081Sphkinterim-rmic:
796081Sphk	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
806081Sphk
816081Sphkbuildtools-jdk:
8219983Smckay	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
8319983Smckay
8419983SmckayALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
8519983Smckay    interim-rmic buildtools-jdk
8619983Smckay
8719983Smckay################################################################################
886081Sphk# Special targets for certain modules
8919983Smckay
906081Sphkimport-hotspot:
916081Sphk	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
928857Srgrimes
936081Sphkunpack-sec:
94117503Skris	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
95117503Skris
966081SphkALL_TARGETS += import-hotspot unpack-sec
9719983Smckay
9819983Smckay################################################################################
996081Sphk# Gensrc targets, generating source before java compilation can be done
10019983Smckay$(eval $(call DeclareRecipesForPhase, GENSRC, \
10119983Smckay    TARGET_SUFFIX := gensrc, \
10219983Smckay    FILE_PREFIX := Gensrc, \
1036081Sphk    MAKE_SUBDIR := gensrc, \
1046081Sphk    CHECK_MODULES := $(ALL_MODULES), \
1056081Sphk    MULTIPLE_MAKEFILES := true))
1066081Sphk
10719983SmckayJDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
10819983SmckayLANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
1096081SphkCORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
11019983Smckay
11119983SmckayALL_TARGETS += $(GENSRC_TARGETS)
11219983Smckay
1136081Sphk################################################################################
1146081Sphk# Generate data targets
1156081Sphk$(eval $(call DeclareRecipesForPhase, GENDATA, \
1166081Sphk    TARGET_SUFFIX := gendata, \
11719983Smckay    FILE_PREFIX := Gendata, \
1186081Sphk    MAKE_SUBDIR := gendata, \
11916880Sgpalmer    CHECK_MODULES := $(ALL_MODULES), \
12019983Smckay    USE_WRAPPER := true))
12116880Sgpalmer
1226081SphkALL_TARGETS += $(GENDATA_TARGETS)
1236081Sphk
1246081Sphk################################################################################
1256081Sphk# Copy files targets
1266081Sphk$(eval $(call DeclareRecipesForPhase, COPY, \
1276081Sphk    TARGET_SUFFIX := copy, \
1286081Sphk    FILE_PREFIX := Copy, \
1296081Sphk    MAKE_SUBDIR := copy, \
1306081Sphk    CHECK_MODULES := $(ALL_MODULES), \
1316081Sphk    USE_WRAPPER := true))
1326081Sphk
1336081SphkALL_TARGETS += $(COPY_TARGETS)
1346081Sphk
13519983Smckay################################################################################
13619983Smckay# Targets for compiling all java modules. Nashorn is treated separately.
13719983SmckayJAVA_MODULES := $(call FindJavaModules)
1386081SphkJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
13919983Smckay
14019983Smckaydefine DeclareCompileJavaRecipe
14119983Smckay  $1-java:
14219983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
1436081Sphk	    $1 JAVA_MODULES=$1)
1446081Sphkendef
14519983Smckay
14619983Smckay$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
14718120Speter    $(eval $(call DeclareCompileJavaRecipe,$m)))
14819983Smckay
14919983Smckay# Build nashorn. Needs to be compiled separately from the rest of the modules
15019983Smckay# due to nasgen.
15119983Smckayjdk.scripting.nashorn-java:
15219983Smckay	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
15319983Smckay
15419983SmckayALL_TARGETS += $(JAVA_TARGETS)
15519983Smckay
15619983Smckay################################################################################
15719983Smckay# Targets for running rmic.
15819983Smckay$(eval $(call DeclareRecipesForPhase, RMIC, \
15919983Smckay    TARGET_SUFFIX := rmic, \
16019983Smckay    FILE_PREFIX := Rmic, \
16119983Smckay    MAKE_SUBDIR := rmic, \
16219983Smckay    CHECK_MODULES := $(ALL_MODULES)))
16319983Smckay
16419983SmckayALL_TARGETS += $(RMIC_TARGETS)
16519983Smckay
16619983Smckay################################################################################
1676081Sphk# Targets for compiling native libraries
1686081Sphk$(eval $(call DeclareRecipesForPhase, LIBS, \
16919983Smckay    TARGET_SUFFIX := libs, \
17019983Smckay    FILE_PREFIX := Lib, \
17119983Smckay    MAKE_SUBDIR := lib, \
17219983Smckay    CHECK_MODULES := $(ALL_MODULES), \
17319983Smckay    USE_WRAPPER := true))
1746081Sphk
17519983SmckayALL_TARGETS += $(LIBS_TARGETS)
17619983Smckay
17719983Smckay################################################################################
17819983Smckay# Targets for compiling native executables
17919983Smckay$(eval $(call DeclareRecipesForPhase, LAUNCHER, \
18019983Smckay    TARGET_SUFFIX := launchers, \
18119983Smckay    FILE_PREFIX := Launcher, \
18219983Smckay    MAKE_SUBDIR := launcher, \
1836081Sphk    CHECK_MODULES := $(ALL_MODULES), \
1846081Sphk    USE_WRAPPER := true))
18519983Smckay
1866081SphkALL_TARGETS += $(LAUNCHER_TARGETS)
1876081Sphk
18819983Smckay################################################################################
18919983Smckay# Build hotspot target
19019983Smckay
19116880Sgpalmerifeq ($(BUILD_HOTSPOT),true)
19219983Smckay  hotspot:
19319983Smckay	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
1946081Sphkendif
19519983Smckay
19619983SmckayALL_TARGETS += hotspot
19719983Smckay
19819983Smckay################################################################################
19919983Smckay# Build demos and samples targets
20019983Smckay
20119983Smckaydemos:
20219983Smckay	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
20319983Smckay
20419983Smckaysamples:
20519983Smckay	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
20619983Smckay
20719983SmckayALL_TARGETS += demos samples
20819983Smckay
20919983Smckay################################################################################
21019983Smckay# Image targets
21116880Sgpalmer
21219983Smckay# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
21319983Smckay# used to track the exact sources used to build that image.
21416880Sgpalmersource-tips: $(SUPPORT_OUTPUTDIR)/source_tips
21516880Sgpalmer$(SUPPORT_OUTPUTDIR)/source_tips: FRC
21619983Smckay	@$(MKDIR) -p $(@D)
21719983Smckay	@$(RM) $@
21819983Smckay	@$(call GetSourceTips)
21916880Sgpalmer
22019983SmckayBOOTCYCLE_TARGET := product-images
22119983Smckaybootcycle-images:
22219983Smckay	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
22316880Sgpalmer	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
22419983Smckay
22519983Smckayzip-security:
22619983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
22719983Smckay
22819983Smckayzip-source:
22919983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
23016880Sgpalmer
23119983Smckaystrip-binaries:
23219983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
23319983Smckay
23419983Smckayjrtfs-jar:
23519983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
23619983Smckay
23719983Smckayjimages:
23819983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
23919983Smckay
24019983Smckayprofiles:
24119983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
24219983Smckay
24319983Smckaymac-bundles:
24419983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
24519983Smckay
24619983SmckayALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
24719983Smckay    jrtfs-jar jimages profiles mac-bundles
24819983Smckay
24919983Smckay################################################################################
25019983Smckay# Docs targets
25119983Smckay
25216880Sgpalmerdocs-javadoc:
25319983Smckay	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
25419983Smckay
25519983Smckaydocs-jvmtidoc:
25616880Sgpalmer	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
25719983Smckay
25819983SmckayALL_TARGETS += docs-javadoc docs-jvmtidoc
25919983Smckay
26019983Smckay################################################################################
26119983Smckay# Build tests
26219983Smckay#
26319983Smckay
26419983Smckayprepare-test-image:
26519983Smckay	$(MKDIR) -p $(TEST_IMAGE_DIR)
26619983Smckay	$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
26719983Smckay
26819983Smckaybuild-test-hotspot-jtreg-native:
26916880Sgpalmer	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
27016880Sgpalmer	    build-test-hotspot-jtreg-native)
27116880Sgpalmer
27219983Smckaytest-image-hotspot-jtreg-native:
27319983Smckay	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
27419983Smckay	    test-image-hotspot-jtreg-native)
27519983Smckay
27619983Smckaybuild-test-jdk-jtreg-native:
27716880Sgpalmer	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
27819983Smckay	    build-test-jdk-jtreg-native)
27919983Smckay
28016880Sgpalmertest-image-jdk-jtreg-native:
28119983Smckay	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
28219983Smckay	    test-image-jdk-jtreg-native)
28316880Sgpalmer
28419983SmckayALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
28519983Smckay    test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
28619983Smckay    test-image-jdk-jtreg-native
28716880Sgpalmer
28816880Sgpalmer################################################################################
28916880Sgpalmer# Run tests
29016880Sgpalmer
2916081Sphk# Run tests specified by $(TEST), or the default test set.
2926081Sphktest:
2936081Sphk	$(call RunTests, $(TEST))
2946081Sphk
2956081Sphktest-hotspot-jtreg-native:
2966081Sphk	$(call RunTests, "hotspot_native_sanity")
2976081Sphk
2986081Sphktest-jdk-jtreg-native:
2996081Sphk	$(call RunTests, "jdk_native_sanity")
3006081Sphk
3016081Sphktest-make:
3026081Sphk	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
3036081Sphk
3046081SphkALL_TARGETS += test test-hotspot-jtreg-native test-jdk-jtreg-native test-make
3056081Sphk
3066081Sphk################################################################################
3076081Sphk# Verification targets
3086081Sphk
3096081Sphkverify-modules:
3106081Sphk	@$(call TargetEnter)
3116081Sphk	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
3126081Sphk	@$(call TargetExit)
3136081Sphk
3146081SphkALL_TARGETS += verify-modules
31519983Smckay
31619983Smckay################################################################################
3176081Sphk# Install targets
3186081Sphk
3196081Sphkinstall:
3206081Sphk	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
3216081Sphk
3226081SphkALL_TARGETS += install
3236081Sphk
3246081Sphk################################################################################
3256081Sphk#
3266081Sphk# Dependency declarations between targets.
3276081Sphk#
3286081Sphk# These are declared in two groups. First all dependencies between targets that
3296081Sphk# have recipes above as these dependencies may be disabled. Then the aggregator
3306081Sphk# targets that do not have recipes of their own, which will never have their
3316081Sphk# dependencies disabled.
3326081Sphk#
3336081Sphk################################################################################
3346081Sphk# Targets with recipes above
3356081Sphk
3366081Sphk# If running an *-only target, parallel execution and dependencies between
3376081Sphk# recipe targets are disabled. This makes it possible to run a select set of
3386081Sphk# recipe targets in order. It's the responsibility of the user to make sure
3396081Sphk# all prerequisites are fulfilled.
3406081Sphkifneq ($(findstring -only, $(MAKECMDGOALS)), )
3416081Sphk  .NOTPARALLEL:
3426081Sphkelse
3436081Sphk  $(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
3446081Sphk
3456081Sphk  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
3466081Sphk
3476081Sphk  buildtools-jdk: interim-langtools
3486081Sphk
3496081Sphk  $(CORBA_GENSRC_TARGETS): interim-langtools
3506081Sphk
3516081Sphk  $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
3526081Sphk
3536081Sphk  interim-corba: $(CORBA_GENSRC_TARGETS)
3546081Sphk
3556081Sphk  $(GENDATA_TARGETS): interim-langtools buildtools-jdk
3566081Sphk
3576081Sphk  interim-rmic: interim-langtools
3586081Sphk
3596081Sphk  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
3606081Sphk
3616081Sphk  import-hotspot: hotspot
3626081Sphk
3636081Sphk  $(LIBS_TARGETS): import-hotspot
3646081Sphk
3656081Sphk  $(LAUNCHER_TARGETS): java.base-libs
3666081Sphk
3676081Sphk  # The demos are currently linking to libjvm and libjava, just like all other
3686081Sphk  # jdk libs, even though they don't need to. To avoid warnings, make sure they
3696081Sphk  # aren't built until after libjava and libjvm are available to link to.
3706081Sphk  demos: $(JAVA_TARGETS)
37119983Smckay
3726081Sphk  # Declare dependency from <module>-java to <module>-gensrc
3736081Sphk  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
37419983Smckay
3756081Sphk  # Declare dependencies between java modules
37619983Smckay  $(foreach m, $(JAVA_MODULES), \
3776081Sphk      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
3786081Sphk      $(call FindDepsForModule,$m)))))
3796081Sphk
3806081Sphk  # Declare dependencies between <module>-rmic to <module>-java
3816081Sphk  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
3826081Sphk
3836081Sphk  # Declare dependencies from <module>-lib to <module>-java
3846081Sphk  # Skip modules that do not have java source.
3856081Sphk  $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
3866457Sphk
3876081Sphk  # Declare dependencies from all other <module>-lib to java.base-lib
38819983Smckay  $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
3896081Sphk      $(eval $t: java.base-libs))
39019983Smckay  # Declare the special case dependency for jdk.deploy.osx where libosx
3916081Sphk  # links against libosxapp.
3926081Sphk  jdk.deploy.osx-libs: java.desktop-libs
3936081Sphk
3946081Sphk  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
3956081Sphk  # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
3966081Sphk  # virtual target.
3976081Sphk  jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
3986081Sphk
3996081Sphk  # Until the module system is in place, jdk.jdi-gensrc needs to combine service
4006081Sphk  # loader configuration with jdk.hotspot.agent so is dependent on importing
4016081Sphk  # hotspot.
4026081Sphk  jdk.jdi-gensrc-jdk: import-hotspot
4036081Sphk
4046081Sphk  # The swing beans need to have java base properly generated to avoid errors
4056081Sphk  # in javadoc.
40619983Smckay  java.desktop-gensrc-jdk: java.base-gensrc
4076081Sphk
40819983Smckay  # Explicitly add dependencies for special targets
409117503Skris  java.base-java: unpack-sec
410117503Skris
4116081Sphk  jdk.dev-gendata: java rmic
4126081Sphk
413117503Skris  zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
4146081Sphk      $(filter jdk.crypto%, $(JAVA_TARGETS))
415117503Skris
416117503Skris  zip-source: gensrc rmic
417117503Skris
418117503Skris  strip-binaries: libs launchers gendata copy
419117503Skris
420117503Skris  jrtfs-jar: buildtools-jdk
421117503Skris
422117503Skris  jimages: exploded-image zip-source strip-binaries source-tips demos samples \
423117503Skris      jrtfs-jar
424117503Skris
425117503Skris  profiles: exploded-image strip-binaries source-tips
426117503Skris
427117503Skris  mac-bundles: jimages
428117503Skris
429117503Skris  bootcycle-images: jimages
430117503Skris
4316081Sphk  docs-javadoc: gensrc rmic
432117503Skris
43319983Smckay  docs-jvmtidoc: hotspot
4346081Sphk
43519983Smckay  test: jimages test-image
4366081Sphk
43719983Smckay  verify-modules: exploded-image
4386081Sphk
439117503Skris  test-make: clean-test-make
4406081Sphk
441117503Skris  build-test-hotspot-jtreg-native: buildtools-jdk
442117503Skris
443117503Skris  build-test-jdk-jtreg-native: buildtools-jdk
444117503Skris
445117503Skris  test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
446117503Skris
447117503Skris  test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
448117503Skris
449117503Skrisendif
450117503Skris
451117503Skris################################################################################
452117503Skris# Virtual targets without recipes
453117503Skris
454117503Skrisbuildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
45519983Smckay    buildtools-jdk
45619983Smckay
4576081Sphkgensrc: $(GENSRC_TARGETS)
4586081Sphk
4596081Sphkgendata: $(GENDATA_TARGETS)
4606081Sphk
4616081Sphkcopy: $(COPY_TARGETS)
4626081Sphk
4636081Sphkjava: $(JAVA_TARGETS)
4646081Sphk
4656081Sphkrmic: $(RMIC_TARGETS)
4666081Sphk
4676081Sphklibs: $(LIBS_TARGETS)
4686081Sphk
4696081Sphklaunchers: $(LAUNCHER_TARGETS)
47018110Speter
4716081Sphk# Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
4726081Sphk# is actually handled by jdk.jdi-gensrc
4736081Sphkjdk.jdwp.agent-gensrc: jdk.jdi-gensrc
4746081Sphk
4756081Sphk# Declare dependencies from <module> to all the individual targets specific
4766081Sphk# to that module <module>-*.
4776081Sphk$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
4786081Sphk$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
4796081Sphk$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
4806081Sphk$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
4816081Sphk$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
4826081Sphk$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
4836081Sphk$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
4846081Sphk
4856081SphkALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
4866081Sphk    $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
4876081Sphk
4886081Sphk# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
4896081Sphkexploded-image: $(ALL_MODULE_TARGETS)
4906081Sphk
4916081Sphk# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
4926081Sphk# and in line with this, our targets for creating these are named *-image[s].
4936081Sphk
4946081Sphk# This target builds the product images, e.g. the JRE and JDK image
4956081Sphk# (and possibly other, more specific versions)
4966081Sphkproduct-images: jimages demos samples zip-security verify-modules
4976081Sphk
498ifeq ($(OPENJDK_TARGET_OS), macosx)
499  product-images: mac-bundles
500endif
501
502# This target builds the documentation image
503docs-image: docs-javadoc docs-jvmtidoc
504
505# This target builds the test image
506test-image: prepare-test-image test-image-hotspot-jtreg-native \
507    test-image-jdk-jtreg-native
508
509# all-images is the top-most target, it builds all our deliverables ("images").
510all-images: product-images test-image docs-image
511
512ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
513    jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
514    product-images docs-image test-image all-images
515
516################################################################################
517
518# Traditional targets typically run by users.
519# These can be considered aliases for the targets now named by a more
520# "modern" naming scheme.
521default: exploded-image
522jdk: exploded-image
523images: product-images
524docs: docs-image
525all: all-images
526
527ALL_TARGETS += default jdk images docs all
528
529################################################################################
530################################################################################
531#
532# Clean targets
533#
534################################################################################
535# Clean targets are automatically run serially by the Makefile calling this
536# file.
537
538CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
539    images make-support test-make bundles
540CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
541CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
542CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
543CLEAN_PHASES := gensrc java native include
544CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
545CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
546# Construct targets of the form clean-$module-$phase
547CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
548    $(addprefix $m-, $(CLEAN_PHASES))))
549
550# Remove everything, except the output from configure.
551clean: $(CLEAN_DIR_TARGETS)
552	($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
553	$(ECHO) Cleaned all build artifacts.
554
555$(CLEAN_DIR_TARGETS):
556	$(call CleanDir,$(patsubst clean-%, %, $@))
557
558$(CLEAN_TEST_TARGETS):
559	$(call CleanTest,$(patsubst clean-test-%, %, $@))
560
561$(CLEAN_PHASE_TARGETS):
562	$(call Clean-$(patsubst clean-%,%, $@))
563
564$(CLEAN_MODULE_TARGETS):
565	$(call CleanModule,$(patsubst clean-%, %, $@))
566
567$(CLEAN_MODULE_PHASE_TARGETS):
568	$(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
569	    $(word 2, $(subst -,$(SPACE),$@)))
570
571# When removing the support dir, we must also remove jdk. Building classes has
572# the side effect of generating native headers. The headers end up in support
573# while classes and touch files end up in jdk.
574clean-support: clean-jdk
575
576clean-docs: clean-docstemp
577
578# Remove everything, including configure configuration.
579# If the output directory was created by configure and now becomes empty, remove it as well.
580dist-clean: clean
581	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
582	    Makefile compare.sh tmp javacservers)
583	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
584	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
585	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
586	  else \
587	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
588	        && $(RM) -r $(OUTPUT_ROOT)) \
589	  fi \
590	)
591	$(ECHO) Cleaned everything, you will have to re-run configure.
592
593ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \
594    $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
595
596################################################################################
597# Declare *-only targets for each normal target
598$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
599
600ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
601
602################################################################################
603
604# Include JPRT targets
605include $(SRC_ROOT)/make/Jprt.gmk
606
607################################################################################
608
609print-targets:
610	  @$(ECHO) $(sort $(ALL_TARGETS))
611
612print-modules:
613	  @$(ECHO) $(sort $(ALL_MODULES))
614
615# print-* targets intentionally not added to ALL_TARGETS since they are internal only.
616# The corresponding external targets are in Help.gmk
617
618################################################################################
619
620.PHONY: $(ALL_TARGETS)
621
622FRC: # Force target
623