Main.gmk revision 1131:70e378877c6a
11553Srgrimes#
21553Srgrimes# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
31553Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41553Srgrimes#
51553Srgrimes# This code is free software; you can redistribute it and/or modify it
61553Srgrimes# under the terms of the GNU General Public License version 2 only, as
71553Srgrimes# published by the Free Software Foundation.  Oracle designates this
81553Srgrimes# particular file as subject to the "Classpath" exception as provided
91553Srgrimes# by Oracle in the LICENSE file that accompanied this code.
101553Srgrimes#
111553Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
121553Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131553Srgrimes# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141553Srgrimes# version 2 for more details (a copy is included in the LICENSE file that
151553Srgrimes# accompanied this code).
161553Srgrimes#
171553Srgrimes# You should have received a copy of the GNU General Public License version
181553Srgrimes# 2 along with this work; if not, write to the Free Software Foundation,
191553Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201553Srgrimes#
211553Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221553Srgrimes# or visit www.oracle.com if you need additional information or have any
231553Srgrimes# questions.
241553Srgrimes#
251553Srgrimes
261553Srgrimes################################################################################
271553Srgrimes# This is the main makefile containing most actual top level targets. It needs
281553Srgrimes# to be called with a SPEC file defined.
291553Srgrimes
301553Srgrimes# Declare default target
3130642Scharnierdefault:
321553Srgrimes
3330642Scharnier# Now load the spec
3430642Scharnierinclude $(SPEC)
3550479Speter
361553Srgrimesinclude $(SRC_ROOT)/make/MakeHelpers.gmk
371553Srgrimes
381553Srgrimes# Load the vital tools for all the makefiles.
391553Srgrimesinclude $(SRC_ROOT)/make/common/MakeBase.gmk
401553Srgrimesinclude $(SRC_ROOT)/make/common/Modules.gmk
411553Srgrimes
421553Srgrimes# Load common profile names definitions
431553Srgrimesinclude $(JDK_TOPDIR)/make/ProfileNames.gmk
441553Srgrimes
451553Srgrimes# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
461553Srgrimes# valid top level targets. It's used to declare them all as PHONY and to 
471553Srgrimes# generate the -only targets.
481553SrgrimesALL_TARGETS :=
491553Srgrimes
501553Srgrimes# Hook to include the corresponding custom file, if present.
511553Srgrimes$(eval $(call IncludeCustomExtension, , Main.gmk))
521553Srgrimes
531553Srgrimes# All modules for the current target platform.
541553Srgrimes# Manually add jdk.hotspot.agent for now.
551553SrgrimesALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
561553Srgrimes
571553Srgrimes################################################################################
581553Srgrimes################################################################################
59246209Scharnier#
60246209Scharnier# Recipes for all targets. Only recipes, dependencies are declared later.
61246209Scharnier#
621553Srgrimes################################################################################
631553Srgrimes
64246209Scharnier################################################################################
651553Srgrimes# Interim/build tools targets, compiling tools used during the build
661553Srgrimes
671553Srgrimesinterim-langtools:
681553Srgrimes	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
691553Srgrimes
701553Srgrimesinterim-corba:
711553Srgrimes	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk)
721553Srgrimes
731553Srgrimesinterim-rmic:
741553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
751553Srgrimes
761553Srgrimesbuild-tools-jdk:
771553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
781553Srgrimes
791553SrgrimesALL_TARGETS += interim-langtools interim-corba build-tools-jdk
801553Srgrimes
811553Srgrimes################################################################################
821553Srgrimes# Special targets for certain modules
83209344Sgavin
841553Srgrimesimport-hotspot:
851553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
861553Srgrimes
871553Srgrimesunpack-sec:
881553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
891553Srgrimes
901553Srgrimespolicy-jars:
911553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk)
921553Srgrimes
931553SrgrimesALL_TARGETS += import-hotspot unpack-sec policy-jars
941553Srgrimes
958857Srgrimes################################################################################
961553Srgrimes# Gensrc targets, generating source before java compilation can be done
971553SrgrimesJDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc)
981553SrgrimesLANGTOOLS_GENSRC_MODULES := jdk.compiler.tools
991553SrgrimesCORBA_GENSRC_MODULES := java.corba
1001553SrgrimesGENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \
1011553Srgrimes    $(CORBA_GENSRC_MODULES)
1021553SrgrimesJDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES))
1031553SrgrimesLANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES))
1041553SrgrimesCORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES))
1051553SrgrimesGENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES))
1061553Srgrimes
1071553Srgrimesjdk.compiler.tools-gensrc:
1081553Srgrimes	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk)
1091553Srgrimes
1101553Srgrimesjava.corba-gensrc:
1111553Srgrimes	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk)
1121553Srgrimes
1131553Srgrimes# Declare recipes for all jdk <module>-gensrc targets
1141553Srgrimes$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1151553Srgrimes    $m, gensrc, gensrc, Gensrc)))
1161553Srgrimes
1171553SrgrimesALL_TARGETS += $(GENSRC_TARGETS)
1181553Srgrimes
1191553Srgrimes################################################################################
1201553Srgrimes# Generate data targets
1211553SrgrimesGENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata)
1221553SrgrimesGENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES))
1231553Srgrimes
1241553Srgrimes# Declare recipes for all <module>-gendata targets
1251553Srgrimes$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1261553Srgrimes    $m, gendata, gendata, Gendata)))
1271553Srgrimes
1281553Srgrimes$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m)))
129239991Sed
1301553SrgrimesALL_TARGETS += $(GENDATA_TARGETS)
1311553Srgrimes
1321553Srgrimes################################################################################
1331553Srgrimes# Copy files targets
1341553SrgrimesCOPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy)
1351553SrgrimesCOPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES))
1361553Srgrimes
137239991Sed# Declare recipes for all <module>-copy targets
1381553Srgrimes$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1391553Srgrimes    $m, copy, copy, Copy)))
1401553Srgrimes
1411553SrgrimesALL_TARGETS += $(COPY_TARGETS)
1421553Srgrimes
1431553Srgrimes################################################################################
14430761Scharnier# Targets for compiling all java modules. Nashorn is treated separately.
1454840SbdeJAVA_MODULES := $(call FindJavaModules)
1461553SrgrimesJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
1471553Srgrimes
1481553Srgrimesdefine DeclareCompileJavaRecipe
1491553Srgrimes  $1-java:
1501553Srgrimes	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
1511553Srgrimes	    $1 JAVA_MODULES=$1)
1521553Srgrimesendef
1531553Srgrimes
1541553Srgrimes$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
1551553Srgrimes    $(eval $(call DeclareCompileJavaRecipe,$m)))
1561553Srgrimes
1571553Srgrimes# Build nashorn. Needs to be compiled separately from the rest of the modules
1581553Srgrimes# due to nasgen.
1591553Srgrimesjdk.scripting.nashorn-java:
1601553Srgrimes	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
1611553Srgrimes
1621553SrgrimesALL_TARGETS += $(JAVA_TARGETS)
1631553Srgrimes
1641553Srgrimes################################################################################
1651553Srgrimes# Targets for running rmic.
1661553SrgrimesRMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic)
1671553SrgrimesRMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES))
1681553Srgrimes
1691553Srgrimes# Declare recipes for all <module>-rmic targets
1701553Srgrimes$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1711553Srgrimes    $m, rmic, rmic, Rmic)))
1721553Srgrimes
1731553SrgrimesALL_TARGETS += $(RMIC_TARGETS)
174239991Sed
1751553Srgrimes################################################################################
1761553Srgrimes# Targets for compiling native libraries
1771553SrgrimesALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib)
1781553SrgrimesLIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES))
1791553SrgrimesLIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES))
1801553Srgrimes
1811553Srgrimes# Declare recipes for all <module>-libs targets
1821553Srgrimes$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1831553Srgrimes    $m, libs, lib, Lib)))
1848857Srgrimes
1851553SrgrimesALL_TARGETS += $(LIB_TARGETS)
1861553Srgrimes
1871553Srgrimes################################################################################
1881553Srgrimes# Targets for compiling native executables
1891553SrgrimesALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher)
1901553SrgrimesLAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES))
1911553SrgrimesLAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES))
1921553Srgrimes
1931553Srgrimes# Declare recipes for all <module>-launchers targets
1941553Srgrimes$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
1951553Srgrimes    $m, launchers, launcher, Launcher)))
1961553Srgrimes
1971553SrgrimesALL_TARGETS += $(LAUNCHER_TARGETS)
1981553Srgrimes
1991553Srgrimes################################################################################
2001553Srgrimes# Build hotspot target
2011553Srgrimes
2021553Srgrimesifeq ($(BUILD_HOTSPOT),true)
2031553Srgrimes  hotspot:
2041553Srgrimes	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
2051553Srgrimesendif
2061553Srgrimes
2071553SrgrimesALL_TARGETS += hotspot
2081553Srgrimes
2091553Srgrimes################################################################################
2101553Srgrimes# Build demos and samples targets
2111553Srgrimes
2121553Srgrimesdemos:
2131553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
2141553Srgrimes
2151553Srgrimessamples:
2161553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
2171553Srgrimes
2181553SrgrimesALL_TARGETS += demos samples
2191553Srgrimes
2201553Srgrimes################################################################################
2211553Srgrimes# Image targets
2221553Srgrimes
2231553Srgrimes# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
2241553Srgrimes# used to track the exact sources used to build that image.
2251553Srgrimessource-tips: $(OUTPUT_ROOT)/source_tips
2261553Srgrimes$(OUTPUT_ROOT)/source_tips: FRC
2271553Srgrimes	@$(MKDIR) -p $(@D)
2281553Srgrimes	@$(RM) $@
2291553Srgrimes	@$(call GetSourceTips)
2301553Srgrimes
2311553Srgrimessecurity-jars:
2321553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk)
2331553Srgrimes
2341553Srgrimesnashorn-jar:
2351553Srgrimes	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all)
2361553Srgrimes
2371553Srgrimes# Creates the jar files (rt.jar resources.jar etc)
2381553Srgrimesmain-jars:
2391553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk)
2401553Srgrimes
2411553Srgrimes# Creates the images (j2sdk-image j2re-image etc)
2421553Srgrimesimages:
2431553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk)
2441553Srgrimes        ifeq ($(OPENJDK_TARGET_OS), macosx)
2451553Srgrimes	  +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk)
2461553Srgrimes        endif
2471553Srgrimes
2481553Srgrimes# Create Compact Profile jars
2491553SrgrimesPROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES))
2501553Srgrimes$(PROFILE_JARS_TARGETS):
2511553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk)
2521553Srgrimes
2531553Srgrimes# Create Compact Profile images
2541553SrgrimesPROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES))
2551553Srgrimes$(PROFILE_IMAGES_TARGETS):
2561553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \
2571553Srgrimes	    JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \
2581553Srgrimes	    -f Images.gmk profile-image)
2591553Srgrimes
2601553Srgrimesprofiles-oscheck:
2611553Srgrimes        ifneq ($(OPENJDK_TARGET_OS), linux)
2621553Srgrimes	  @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
2631553Srgrimes        endif
2641553Srgrimes
2651553Srgrimesbootcycle-images:
2661553Srgrimes	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
26730642Scharnier	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images
2681553Srgrimes
2691553SrgrimesALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \
2701553Srgrimes    $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \
2711553Srgrimes    bootcycle-images
2721553Srgrimes
2731553Srgrimes################################################################################
2741553Srgrimes# Docs targets
2751553Srgrimes
2761553Srgrimesdocs-javadoc:
2771553Srgrimes	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
2781553Srgrimes
2791553Srgrimesdocs-jvmtidoc:
2801553Srgrimes	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
2811553Srgrimes
2821553SrgrimesALL_TARGETS += docs-javadoc docs-jvmtidoc
2831553Srgrimes
2841553Srgrimes################################################################################
2851553Srgrimes# Test target
2861553Srgrimes
2871553Srgrimestest:
2881553Srgrimes	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
2891553Srgrimes	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \
2901553Srgrimes	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
2911553Srgrimes
2921553Srgrimestest-make:
293246209Scharnier	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
2941553Srgrimes
2951553SrgrimesALL_TARGETS += test test-make
2961553Srgrimes
2971553Srgrimes################################################################################
2981553Srgrimes# Verification targets
2991553Srgrimes
3001553Srgrimes# generate modules.xml in the exploded image
3011553Srgrimesmodules-xml:
3021553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk gen-modules-xml)
3031553Srgrimes
3041553Srgrimesverify-modules:
3051553Srgrimes	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk checkdeps)
3061553Srgrimes
3071553SrgrimesALL_TARGETS += modules-xml verify-modules
3081553Srgrimes
309246209Scharnier################################################################################
3101553Srgrimes# Install targets
3111553Srgrimes
3121553Srgrimesinstall:
3131553Srgrimes	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
3141553Srgrimes
3151553SrgrimesALL_TARGETS += install
3161553Srgrimes
3171553Srgrimes################################################################################
3181553Srgrimes#
3191553Srgrimes# Dependency declarations between targets. 
3201553Srgrimes#
3211553Srgrimes# These are declared in two groups. First all dependencies between targets that 
3221553Srgrimes# have recipes above as these dependencies may be disabled. Then the aggregator
3231553Srgrimes# targets that do not have recipes of their own, which will never have their
324246209Scharnier# dependencies disabled.
3251553Srgrimes#
3261553Srgrimes################################################################################
3271553Srgrimes# Targets with recipes above
3281553Srgrimes
3291553Srgrimes# If running an *-only target, parallel execution and dependencies between 
3301553Srgrimes# recipe targets are disabled. This makes it possible to run a select set of 
3311553Srgrimes# recipe targets in order. It's the responsibility of the user to make sure
3321553Srgrimes# all prerequisites are fulfilled. 
3331553Srgrimesifneq ($(findstring -only, $(MAKECMDGOALS)), )
3341553Srgrimes  .NOTPARALLEL:
3351553Srgrimeselse
3361553Srgrimes  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
337
338  build-tools-jdk: interim-langtools
339
340  $(CORBA_GENSRC_TARGETS): interim-langtools
341
342  $(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk
343
344  interim-corba: $(CORBA_GENSRC_TARGETS)
345
346  $(GENDATA_TARGETS): interim-langtools build-tools-jdk
347
348  interim-rmic: interim-langtools
349
350  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
351
352  import-hotspot: hotspot
353
354  $(LIB_TARGETS): import-hotspot
355
356  $(LAUNCHER_TARGETS): java.base-libs
357
358  # The demos are currently linking to libjvm and libjava, just like all other
359  # jdk libs, even though they don't need to. To avoid warnings, make sure they
360  # aren't built until after libjava and libjvm are available to link to.
361  demos: $(JAVA_TARGETS)
362
363  # Declare dependency from <module>-java to <module>-gensrc
364  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
365
366  # Declare dependencies between java modules
367  $(foreach m, $(JAVA_MODULES), \
368      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
369      $(call FindDepsForModule,$m)))))
370
371  # Declare dependencies between <module>-rmic to <module>-java
372  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
373
374  # Declare dependencies from <module>-lib to <module>-java
375  # Skip jdk.jdwp.agent as it contains no java code.
376  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java))
377
378  # Declare dependencies from all other <module>-lib to java.base-lib
379  $(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \
380      $(eval $t: java.base-libs))
381  # Declare the special case dependency for jdk.deploy.osx where libosx 
382  # links against libosxapp.
383  jdk.deploy.osx-libs: java.desktop-libs
384
385  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 
386  # header file used by jdk.jdwp libs.
387  jdk.jdwp.agent-libs: jdk.jdi-gensrc
388
389  # Explicitly add dependencies for special targets
390  java.base-java: unpack-sec
391
392  security-jars: java
393
394  nashorn-jar: jdk.scripting.nashorn-java
395
396  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot gendata
397
398  # On windows, the jars target needs to wait for jgss libs to be built.
399  # Should ideally split out the sec-bin zip file generation to avoid
400  # this dependency.
401  ifeq ($(OPENJDK_TARGET_OS), windows)
402    main-jars: java.security.jgss-libs
403  endif
404
405  images: jars demos samples exploded-image source-tips
406
407  bootcycle-images: images
408
409  # Need to depend on jars as otherwise there will a race between all the
410  # invocations of CreateJars.gmk.
411  $(PROFILE_JARS_TARGETS): jars profiles-oscheck
412
413  $(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips
414
415  # Declare dependencies from <profile>-images to <profile>-jars
416  $(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars))
417
418  docs-javadoc: $(GENSRC_TARGETS) rmic
419
420  docs-jvmtidoc: hotspot
421
422  test: exploded-image
423
424  modules-xml: build-tools-jdk java
425
426  verify-modules: exploded-image modules-xml
427
428endif
429
430################################################################################
431# Virtual targets without recipes
432
433gensrc: $(GENSRC_TARGETS)
434
435gendata: $(GENDATA_TARGETS)
436
437copy: $(COPY_TARGETS)
438
439java: $(JAVA_TARGETS)
440
441rmic: $(RMIC_TARGETS)
442
443libs: $(LIB_TARGETS)
444
445launchers: $(LAUNCHER_TARGETS)
446
447# Explicitly add dependencies for these special targets
448java.base: import-hotspot policy-jars
449
450# Declare dependencies from <module> to all the individual targets specific
451# to that module <module>-*.
452$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
453$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
454$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
455$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
456$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs))
457$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
458$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
459
460ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
461    $(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
462
463exploded-image: $(ALL_MODULE_TARGETS) modules-xml
464
465jars: main-jars nashorn-jar security-jars policy-jars
466
467# Make each profile name a target that depends on it's images target.
468$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars))
469
470profiles: $(ALL_PROFILES)
471
472docs: docs-javadoc docs-jvmtidoc
473
474ALL_TARGETS += gensrc gendata copy java rmic libs launchers \
475    $(ALL_MODULE_TARGETS) exploded-image jars \
476    $(ALL_PROFILES) profiles docs
477
478################################################################################
479
480all: images docs verify-modules
481default: exploded-image
482
483ALL_TARGETS += default all
484
485################################################################################
486################################################################################
487#
488# Clean targets
489#
490################################################################################
491
492# If running a clean target, disable parallel execution
493ifneq ($(findstring clean, $(MAKECMDGOALS)), )
494  .NOTPARALLEL:
495endif
496
497CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
498    bootcycle-build docs docstemp test
499CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS))
500
501# Remove everything, except the output from configure.
502clean: $(CLEAN_TARGETS)
503	($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
504	$(ECHO) Cleaned all build artifacts.
505
506$(CLEAN_TARGETS):
507	$(call CleanComponent,$(patsubst clean-%, %, $@))
508
509clean-docs: clean-docstemp
510
511# Remove everything, including configure configuration.
512# If the output directory was created by configure and now becomes empty, remove it as well.
513dist-clean: clean
514	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
515	    Makefile compare.sh spec.sh tmp javacservers)
516	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
517	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
518	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
519	  else \
520	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
521	        && $(RM) -r $(OUTPUT_ROOT)) \
522	  fi \
523	)
524	$(ECHO) Cleaned everything, you will have to re-run configure.
525
526ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS)
527
528################################################################################
529
530# Setup a rule for SPEC file that fails if executed. This check makes sure the 
531# configuration is up to date after changes to configure. 
532ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
533  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
534	@$(ECHO) "ERROR: $(SPEC) is not up to date."
535	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
536	@$(ECHO) "'make reconfigure'."
537	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
538	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
539endif
540
541reconfigure:
542        ifneq ($(CONFIGURE_COMMAND_LINE), )
543	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
544        else
545	  @$(ECHO) "Re-running configure using default settings"
546        endif
547	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
548
549ALL_TARGETS += reconfigure
550
551################################################################################
552# Declare *-only targets for each normal target
553$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
554
555ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS))
556
557################################################################################
558
559.PHONY: $(ALL_TARGETS)
560
561include $(SRC_ROOT)/make/Jprt.gmk
562
563FRC: # Force target
564