Main.gmk revision 1275:394de05938d7
17137SN/A#
217125Sjjg# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
37137SN/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
47137SN/A#
57137SN/A# This code is free software; you can redistribute it and/or modify it
67137SN/A# under the terms of the GNU General Public License version 2 only, as
77137SN/A# published by the Free Software Foundation.  Oracle designates this
87137SN/A# particular file as subject to the "Classpath" exception as provided
97137SN/A# by Oracle in the LICENSE file that accompanied this code.
107137SN/A#
117137SN/A# This code is distributed in the hope that it will be useful, but WITHOUT
127137SN/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
137137SN/A# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
147137SN/A# version 2 for more details (a copy is included in the LICENSE file that
157137SN/A# accompanied this code).
167137SN/A#
177137SN/A# You should have received a copy of the GNU General Public License version
187137SN/A# 2 along with this work; if not, write to the Free Software Foundation,
197137SN/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
207137SN/A#
217137SN/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
227137SN/A# or visit www.oracle.com if you need additional information or have any
237137SN/A# questions.
247137SN/A#
257137SN/A
267137SN/A################################################################################
277137SN/A# This is the main makefile containing most actual top level targets. It needs
287137SN/A# to be called with a SPEC file defined.
297137SN/A
307137SN/A# Declare default target
317137SN/Adefault:
327137SN/A
337137SN/A# Now load the spec
347137SN/Ainclude $(SPEC)
357137SN/A
367137SN/Ainclude $(SRC_ROOT)/make/MakeHelpers.gmk
378382SN/A
387137SN/A# Load the vital tools for all the makefiles.
397137SN/Ainclude $(SRC_ROOT)/make/common/MakeBase.gmk
407137SN/Ainclude $(SRC_ROOT)/make/common/Modules.gmk
417137SN/A
428382SN/A# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
438382SN/A# valid top level targets. It's used to declare them all as PHONY and to
448382SN/A# generate the -only targets.
458382SN/AALL_TARGETS :=
468382SN/A
478382SN/A# Hook to include the corresponding custom file, if present.
488621SN/A$(eval $(call IncludeCustomExtension, , Main.gmk))
498382SN/A
509024SN/A# All modules for the current target platform.
518382SN/A# Manually add jdk.hotspot.agent for now.
528382SN/AALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
538382SN/A
548382SN/A################################################################################
558382SN/A################################################################################
568382SN/A#
578382SN/A# Recipes for all targets. Only recipes, dependencies are declared later.
588382SN/A#
598382SN/A################################################################################
608382SN/A
618382SN/A################################################################################
628382SN/A# Interim/build tools targets, compiling tools used during the build
638382SN/A
648382SN/Abuildtools-langtools:
658382SN/A	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
668382SN/A
678382SN/Ainterim-langtools:
689024SN/A	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
699024SN/A
709024SN/Ainterim-corba:
718382SN/A	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
728382SN/A
738382SN/Ainterim-rmic:
748382SN/A	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
7517125Sjjg
767656SN/Abuildtools-jdk:
7717125Sjjg	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
787137SN/A
7917125SjjgALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
8017125Sjjg    interim-rmic buildtools-jdk
817137SN/A
827137SN/A################################################################################
837137SN/A# Special targets for certain modules
847137SN/A
857137SN/Aimport-hotspot:
867137SN/A	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
877137SN/A
887137SN/Aunpack-sec:
897137SN/A	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
907656SN/A
917137SN/AALL_TARGETS += import-hotspot unpack-sec
927137SN/A
937137SN/A################################################################################
947137SN/A# Gensrc targets, generating source before java compilation can be done
957137SN/A$(eval $(call DeclareRecipesForPhase, GENSRC, \
9617125Sjjg    TARGET_SUFFIX := gensrc, \
977137SN/A    FILE_PREFIX := Gensrc, \
987137SN/A    MAKE_SUBDIR := gensrc, \
997137SN/A    CHECK_MODULES := $(ALL_MODULES), \
1007137SN/A    MULTIPLE_MAKEFILES := true))
1018382SN/A
1027137SN/AJDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
1038382SN/ALANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
1047137SN/ACORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
1058382SN/A
1068382SN/AALL_TARGETS += $(GENSRC_TARGETS)
1078382SN/A
1088382SN/A################################################################################
1098382SN/A# Generate data targets
1108382SN/A$(eval $(call DeclareRecipesForPhase, GENDATA, \
1117137SN/A    TARGET_SUFFIX := gendata, \
1128382SN/A    FILE_PREFIX := Gendata, \
1138382SN/A    MAKE_SUBDIR := gendata, \
1147137SN/A    CHECK_MODULES := $(ALL_MODULES), \
1157137SN/A    USE_WRAPPER := true))
1167137SN/A
1177137SN/AALL_TARGETS += $(GENDATA_TARGETS)
1187137SN/A
1197137SN/A################################################################################
1207137SN/A# Copy files targets
1217137SN/A$(eval $(call DeclareRecipesForPhase, COPY, \
1227137SN/A    TARGET_SUFFIX := copy, \
1237137SN/A    FILE_PREFIX := Copy, \
1247137SN/A    MAKE_SUBDIR := copy, \
1257137SN/A    CHECK_MODULES := $(ALL_MODULES), \
1267137SN/A    USE_WRAPPER := true))
1277137SN/A
1288382SN/AALL_TARGETS += $(COPY_TARGETS)
1297137SN/A
1307137SN/A################################################################################
1317137SN/A# Targets for compiling all java modules. Nashorn is treated separately.
1327137SN/AJAVA_MODULES := $(call FindJavaModules)
1337137SN/AJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
1347137SN/A
1357137SN/Adefine DeclareCompileJavaRecipe
1367137SN/A  $1-java:
1377137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
1387137SN/A	    $1 JAVA_MODULES=$1)
1397137SN/Aendef
1407137SN/A
1418382SN/A$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
1427137SN/A    $(eval $(call DeclareCompileJavaRecipe,$m)))
1437137SN/A
1447137SN/A# Build nashorn. Needs to be compiled separately from the rest of the modules
1458382SN/A# due to nasgen.
1468382SN/Ajdk.scripting.nashorn-java:
1478382SN/A	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
1487137SN/A
1497137SN/AALL_TARGETS += $(JAVA_TARGETS)
1508382SN/A
1517137SN/A################################################################################
1527137SN/A# Targets for running rmic.
1537137SN/A$(eval $(call DeclareRecipesForPhase, RMIC, \
1547137SN/A    TARGET_SUFFIX := rmic, \
1557137SN/A    FILE_PREFIX := Rmic, \
1568382SN/A    MAKE_SUBDIR := rmic, \
1577137SN/A    CHECK_MODULES := $(ALL_MODULES)))
1588382SN/A
1598382SN/AALL_TARGETS += $(RMIC_TARGETS)
1607137SN/A
1617137SN/A################################################################################
1627137SN/A# Targets for compiling native libraries
1637137SN/A$(eval $(call DeclareRecipesForPhase, LIBS, \
1647137SN/A    TARGET_SUFFIX := libs, \
1657137SN/A    FILE_PREFIX := Lib, \
1668382SN/A    MAKE_SUBDIR := lib, \
1677137SN/A    CHECK_MODULES := $(ALL_MODULES), \
1688382SN/A    USE_WRAPPER := true))
1697137SN/A
1707137SN/AALL_TARGETS += $(LIBS_TARGETS)
1717137SN/A
1727137SN/A################################################################################
1737137SN/A# Targets for compiling native executables
1748382SN/A$(eval $(call DeclareRecipesForPhase, LAUNCHER, \
1757137SN/A    TARGET_SUFFIX := launchers, \
1767137SN/A    FILE_PREFIX := Launcher, \
17714262Scoffeys    MAKE_SUBDIR := launcher, \
17814262Scoffeys    CHECK_MODULES := $(ALL_MODULES), \
1797137SN/A    USE_WRAPPER := true))
1807137SN/A
1817137SN/AALL_TARGETS += $(LAUNCHER_TARGETS)
1827137SN/A
1837137SN/A################################################################################
1847137SN/A# Build hotspot target
1857137SN/A
1867137SN/Aifeq ($(BUILD_HOTSPOT),true)
1877137SN/A  hotspot:
1887137SN/A	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
1897137SN/Aendif
1907137SN/A
1917137SN/AALL_TARGETS += hotspot
1927137SN/A
1937137SN/A################################################################################
1947137SN/A# Build demos and samples targets
1957137SN/A
1967137SN/Ademos:
1977137SN/A	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
1987137SN/A
1997137SN/Asamples:
2007137SN/A	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
2017137SN/A
2028382SN/AALL_TARGETS += demos samples
2037137SN/A
2048382SN/A################################################################################
2057137SN/A# Image targets
2067656SN/A
2077656SN/A# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
2087137SN/A# used to track the exact sources used to build that image.
2097137SN/Asource-tips: $(SUPPORT_OUTPUTDIR)/source_tips
2108382SN/A$(SUPPORT_OUTPUTDIR)/source_tips: FRC
2117137SN/A	@$(MKDIR) -p $(@D)
2127137SN/A	@$(RM) $@
2137137SN/A	@$(call GetSourceTips)
2147137SN/A
2157137SN/ABOOTCYCLE_TARGET := images
2167137SN/Abootcycle-images:
2177137SN/A	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
2187137SN/A	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
2197137SN/A
2207137SN/Azip-security:
2217137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
2227137SN/A
2237137SN/Azip-source:
22415814Svtewari	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
2257137SN/A
2267137SN/Astrip-binaries:
2277137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
2287137SN/A
2297137SN/Ajrtfs-jar:
2307137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
2318382SN/A
2327137SN/Ajimages:
2337137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
2348621SN/A
2358382SN/Aprofiles:
2367137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
2377137SN/A
2387137SN/Amac-bundles:
2397137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
2407137SN/A
2417137SN/Aprepare-test-image:
2428382SN/A	$(MKDIR) -p $(TEST_IMAGE_DIR)
2438382SN/A	$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
2448382SN/A
2458382SN/AALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
2468382SN/A    jrtfs-jar jimages profiles mac-bundles prepare-test-image
2478382SN/A
2487137SN/A################################################################################
2497137SN/A# Docs targets
2507137SN/A
2517656SN/Adocs-javadoc:
2527656SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
25317125Sjjg
2547656SN/Adocs-jvmtidoc:
25517125Sjjg	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
2567137SN/A
25717125SjjgALL_TARGETS += docs-javadoc docs-jvmtidoc
25817125Sjjg
2597137SN/A################################################################################
2607137SN/A# Test target
2617137SN/A
2627137SN/Atest:
2637137SN/A	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
2647137SN/A	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
2657137SN/A	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
26617125Sjjg
2677137SN/Atest-make:
2687137SN/A	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
2697137SN/A
2708382SN/AALL_TARGETS += test test-make
2717137SN/A
2727137SN/A################################################################################
2737137SN/A# Verification targets
2748382SN/A
2757137SN/Averify-modules:
27614877Svtewari	@$(call TargetEnter)
27714877Svtewari	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
27814877Svtewari	@$(call TargetExit)
27914877Svtewari
28014877SvtewariALL_TARGETS += verify-modules
28114877Svtewari
28214877Svtewari################################################################################
28314877Svtewari# Install targets
2847137SN/A
2857137SN/Ainstall:
2867137SN/A	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
2877137SN/A
2887137SN/AALL_TARGETS += install
2897137SN/A
2907137SN/A################################################################################
2917137SN/A#
2927137SN/A# Dependency declarations between targets.
2937137SN/A#
2947137SN/A# These are declared in two groups. First all dependencies between targets that
2957137SN/A# have recipes above as these dependencies may be disabled. Then the aggregator
2967137SN/A# targets that do not have recipes of their own, which will never have their
2977137SN/A# dependencies disabled.
2988382SN/A#
2997137SN/A################################################################################
3007137SN/A# Targets with recipes above
3017137SN/A
3028382SN/A# If running an *-only target, parallel execution and dependencies between
3037137SN/A# recipe targets are disabled. This makes it possible to run a select set of
3047137SN/A# recipe targets in order. It's the responsibility of the user to make sure
3057137SN/A# all prerequisites are fulfilled.
3068382SN/Aifneq ($(findstring -only, $(MAKECMDGOALS)), )
3078382SN/A  .NOTPARALLEL:
3088382SN/Aelse
3097137SN/A  $(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
3108382SN/A
3118382SN/A  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
3128382SN/A
3138382SN/A  buildtools-jdk: interim-langtools
3147137SN/A
3157137SN/A  $(CORBA_GENSRC_TARGETS): interim-langtools
3167137SN/A
3178382SN/A  $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
3188382SN/A
3198382SN/A  interim-corba: $(CORBA_GENSRC_TARGETS)
3207137SN/A
3217137SN/A  $(GENDATA_TARGETS): interim-langtools buildtools-jdk
3228382SN/A
3238382SN/A  interim-rmic: interim-langtools
3248382SN/A
3257137SN/A  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
3267137SN/A
3278382SN/A  import-hotspot: hotspot
3287137SN/A
3297137SN/A  $(LIBS_TARGETS): import-hotspot
3307137SN/A
3317137SN/A  $(LAUNCHER_TARGETS): java.base-libs
3327137SN/A
3337137SN/A  # The demos are currently linking to libjvm and libjava, just like all other
3347137SN/A  # jdk libs, even though they don't need to. To avoid warnings, make sure they
3357137SN/A  # aren't built until after libjava and libjvm are available to link to.
3367137SN/A  demos: $(JAVA_TARGETS)
3378382SN/A
3387137SN/A  # Declare dependency from <module>-java to <module>-gensrc
3397137SN/A  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
3407137SN/A
3417137SN/A  # Declare dependencies between java modules
3427137SN/A  $(foreach m, $(JAVA_MODULES), \
3437137SN/A      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
3447137SN/A      $(call FindDepsForModule,$m)))))
3457137SN/A
3468382SN/A  # Declare dependencies between <module>-rmic to <module>-java
3478382SN/A  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
3488382SN/A
3498382SN/A  # Declare dependencies from <module>-lib to <module>-java
3508382SN/A  # Skip jdk.jdwp.agent as it contains no java code.
3517137SN/A  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIBS_MODULES)), $(eval $m-libs: $m-java))
3527137SN/A
3538382SN/A  # Declare dependencies from all other <module>-lib to java.base-lib
3548382SN/A  $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
3558382SN/A      $(eval $t: java.base-libs))
3568382SN/A  # Declare the special case dependency for jdk.deploy.osx where libosx
3578382SN/A  # links against libosxapp.
3588382SN/A  jdk.deploy.osx-libs: java.desktop-libs
3598382SN/A
3608382SN/A  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
3618382SN/A  # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
3628382SN/A  # virtual target.
3638382SN/A  jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
3647137SN/A
3657137SN/A  # Until the module system is in place, jdk.jdi-gensrc needs to combine service
3667137SN/A  # loader configuration with jdk.hotspot.agent so is dependent on importing
3677137SN/A  # hotspot.
3688382SN/A  jdk.jdi-gensrc-jdk: import-hotspot
3697137SN/A
3707137SN/A  # The swing beans need to have java base properly generated to avoid errors
3718382SN/A  # in javadoc.
3728382SN/A  java.desktop-gensrc-jdk: java.base-gensrc
3738382SN/A
3748701SN/A  # Explicitly add dependencies for special targets
3757137SN/A  java.base-java: unpack-sec
3767137SN/A
3777137SN/A  jdk.dev-gendata: java rmic
3787137SN/A
3797137SN/A  zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
3807137SN/A      $(filter jdk.crypto%, $(JAVA_TARGETS))
3817137SN/A
3827137SN/A  zip-source: gensrc rmic
3837137SN/A
3847137SN/A  strip-binaries: libs launchers gendata copy
3857137SN/A
3867137SN/A  jrtfs-jar: buildtools-jdk
3877137SN/A
3887137SN/A  jimages: exploded-image zip-source strip-binaries source-tips demos samples \
38914262Scoffeys      jrtfs-jar
39014262Scoffeys
3917137SN/A  profiles: exploded-image strip-binaries source-tips
3927137SN/A
3937137SN/A  mac-bundles: jimages
3947137SN/A
3957137SN/A  bootcycle-images: jimages
3967137SN/A
3977137SN/A  docs-javadoc: gensrc rmic
3987137SN/A
3997137SN/A  docs-jvmtidoc: hotspot
4007137SN/A
4017137SN/A  test: jimages
4027137SN/A
4037137SN/A  verify-modules: exploded-image
4047137SN/A
4057137SN/Aendif
4067137SN/A
4077137SN/A################################################################################
4087137SN/A# Virtual targets without recipes
4097137SN/A
4107137SN/Abuildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
4117137SN/A    buildtools-jdk
4127137SN/A
4137137SN/Agensrc: $(GENSRC_TARGETS)
4147137SN/A
4157137SN/Agendata: $(GENDATA_TARGETS)
4167137SN/A
41714262Scoffeyscopy: $(COPY_TARGETS)
41814262Scoffeys
4197137SN/Ajava: $(JAVA_TARGETS)
4207137SN/A
4217137SN/Armic: $(RMIC_TARGETS)
4227137SN/A
4237137SN/Alibs: $(LIBS_TARGETS)
4247137SN/A
4257137SN/Alaunchers: $(LAUNCHER_TARGETS)
4267137SN/A
4277137SN/A# Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
4287137SN/A# is actually handled by jdk.jdi-gensrc
4297137SN/Ajdk.jdwp.agent-gensrc: jdk.jdi-gensrc
4307137SN/A
4317137SN/A# Declare dependencies from <module> to all the individual targets specific
4327137SN/A# to that module <module>-*.
4337137SN/A$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
4347137SN/A$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
4357137SN/A$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
4367137SN/A$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
4377137SN/A$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
4387137SN/A$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
4398382SN/A$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
4408382SN/A
4418382SN/AALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
4428382SN/A    $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
44314262Scoffeys
44414262Scoffeysexploded-image: $(ALL_MODULE_TARGETS)
4458382SN/A# The old 'jdk' target most closely matches the new exploded-image. Keep an
4468382SN/A# alias for ease of use.
4478382SN/Ajdk: exploded-image
4488382SN/A
4498382SN/Aimages: test-image jimages demos samples zip-security
4508741SN/A
45114262Scoffeysifeq ($(OPENJDK_TARGET_OS), macosx)
45214262Scoffeys  images: mac-bundles
4538741SN/Aendif
4548741SN/A
4558382SN/Adocs: docs-javadoc docs-jvmtidoc
4567137SN/A
4578382SN/Atest-image: prepare-test-image
4588382SN/A
4598382SN/AALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
4608382SN/A    jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image jdk images \
4618382SN/A    docs test-image
4628382SN/A
4638382SN/A################################################################################
4648382SN/A
4658382SN/Aall: images
4668382SN/Adefault: exploded-image
4677137SN/A
4688382SN/AALL_TARGETS += default all
4697137SN/A
4707137SN/A################################################################################
4717137SN/A################################################################################
47215138Svtewari#
47315138Svtewari# Clean targets
47415138Svtewari#
47515138Svtewari################################################################################
4767137SN/A# Clean targets are automatically run serially by the Makefile calling this
4778382SN/A# file.
4787137SN/A
4797137SN/ACLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
4807137SN/A    images make-support
4817137SN/ACLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
4827137SN/ACLEAN_PHASES := gensrc java native include
4837137SN/ACLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
4847137SN/ACLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
4857137SN/A# Construct targets of the form clean-$module-$phase
4867137SN/ACLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
4877137SN/A    $(addprefix $m-, $(CLEAN_PHASES))))
4888382SN/A
4898382SN/A# Remove everything, except the output from configure.
4908382SN/Aclean: $(CLEAN_DIR_TARGETS)
4918382SN/A	($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
4928382SN/A	$(ECHO) Cleaned all build artifacts.
4939024SN/A
4949024SN/A$(CLEAN_DIR_TARGETS):
4959024SN/A	$(call CleanDir,$(patsubst clean-%, %, $@))
4969024SN/A
4979024SN/A$(CLEAN_PHASE_TARGETS):
4989024SN/A	$(call Clean-$(patsubst clean-%,%, $@))
4998382SN/A
5008382SN/A$(CLEAN_MODULE_TARGETS):
5018382SN/A	$(call CleanModule,$(patsubst clean-%, %, $@))
5028382SN/A
5038382SN/A$(CLEAN_MODULE_PHASE_TARGETS):
5048382SN/A	$(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
5058382SN/A	    $(word 2, $(subst -,$(SPACE),$@)))
5068382SN/A
5078382SN/A# When removing the support dir, we must also remove jdk. Building classes has
5088382SN/A# the side effect of generating native headers. The headers end up in support
5098382SN/A# while classes and touch files end up in jdk.
5108382SN/Aclean-support: clean-jdk
5118382SN/A
5128382SN/Aclean-docs: clean-docstemp
5138382SN/A
5148382SN/A# Remove everything, including configure configuration.
5158382SN/A# If the output directory was created by configure and now becomes empty, remove it as well.
5168382SN/Adist-clean: clean
5178382SN/A	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
5188382SN/A	    Makefile compare.sh tmp javacservers)
5198382SN/A	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
5208382SN/A	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
5218382SN/A	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
5228382SN/A	  else \
5238382SN/A	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
5248382SN/A	        && $(RM) -r $(OUTPUT_ROOT)) \
5258382SN/A	  fi \
5268382SN/A	)
5278382SN/A	$(ECHO) Cleaned everything, you will have to re-run configure.
5288382SN/A
5298382SN/AALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_PHASE_TARGETS) \
5308382SN/A    $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
5318382SN/A
5328382SN/A################################################################################
5338382SN/A
5348382SN/A# Setup a rule for SPEC file that fails if executed. This check makes sure the
5358382SN/A# configuration is up to date after changes to configure.
5368382SN/Aifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
5378382SN/A  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
5388382SN/A	@$(ECHO) "ERROR: $(SPEC) is not up to date."
5398382SN/A	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
5408382SN/A	@$(ECHO) "'make reconfigure'."
5418382SN/A	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
5428382SN/A	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
5438382SN/Aendif
5448382SN/A
5458382SN/A# The reconfigure target is automatically run serially from everything else
5468382SN/A# by the Makefile calling this file.
5478382SN/A
5487137SN/Areconfigure:
549        ifneq ($(CONFIGURE_COMMAND_LINE), )
550	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
551        else
552	  @$(ECHO) "Re-running configure using default settings"
553        endif
554	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
555
556ALL_TARGETS += reconfigure
557
558################################################################################
559# Declare *-only targets for each normal target
560$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
561
562ALL_TARGETS += $(addsuffix -only, $(filter-out clean%, $(ALL_TARGETS)))
563
564################################################################################
565
566.PHONY: $(ALL_TARGETS)
567
568include $(SRC_ROOT)/make/Jprt.gmk
569
570FRC: # Force target
571