rev 57986 : 8234347: "Turkey" meta time zone does not generate composed localized names
8236548: Localized time zone name inconsistency between English and other locales
Reviewed-by:

   1 #
   2 # Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 ################################################################################
  27 # This is the main makefile containing most actual top level targets. It needs
  28 # to be called with a SPEC file defined.
  29 ################################################################################
  30 
  31 # Declare default target
  32 default:
  33 
  34 ifeq ($(wildcard $(SPEC)),)
  35   $(error Main.gmk needs SPEC set to a proper spec.gmk)
  36 endif
  37 
  38 # Now load the spec
  39 include $(SPEC)
  40 
  41 include $(TOPDIR)/make/MainSupport.gmk
  42 
  43 # Load the vital tools for all the makefiles.
  44 include $(TOPDIR)/make/common/MakeBase.gmk
  45 include $(TOPDIR)/make/common/Modules.gmk
  46 include $(TOPDIR)/make/common/FindTests.gmk
  47 
  48 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
  49 # valid top level targets. It's used to declare them all as PHONY and to
  50 # generate the -only targets.
  51 ALL_TARGETS :=
  52 
  53 # Hook to include the corresponding custom file, if present.
  54 $(eval $(call IncludeCustomExtension, Main.gmk))
  55 
  56 # All modules for the current target platform.
  57 ALL_MODULES := $(call FindAllModules)
  58 
  59 ################################################################################
  60 ################################################################################
  61 #
  62 # Recipes for all targets. Only recipes, dependencies are declared later.
  63 #
  64 ################################################################################
  65 
  66 ################################################################################
  67 # Interim/build tools targets, compiling tools used during the build
  68 
  69 buildtools-langtools:
  70         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ToolsLangtools.gmk)
  71 
  72 interim-langtools:
  73         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimLangtools.gmk)
  74 
  75 interim-rmic:
  76         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
  77 
  78 interim-cldrconverter:
  79         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
  80 
  81 interim-tzdb:
  82         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk)
  83 
  84 
  85 buildtools-jdk:
  86         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsJdk.gmk)
  87 
  88 buildtools-modules:
  89         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
  90 
  91 buildtools-hotspot:
  92         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsHotspot.gmk)
  93 
  94 ALL_TARGETS += buildtools-langtools interim-langtools \
  95     interim-rmic interim-cldrconverter interim-tzdb buildtools-jdk buildtools-modules \
  96     buildtools-hotspot
  97 
  98 ################################################################################
  99 # Special targets for certain modules
 100 
 101 generate-exported-symbols:
 102         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildStatic.gmk)
 103 
 104 ALL_TARGETS += generate-exported-symbols
 105 
 106 ################################################################################
 107 # Gensrc targets, generating source before java compilation can be done
 108 #
 109 $(eval $(call DeclareRecipesForPhase, GENSRC, \
 110     TARGET_SUFFIX := gensrc-src, \
 111     FILE_PREFIX := Gensrc, \
 112     MAKE_SUBDIR := gensrc, \
 113     CHECK_MODULES := $(ALL_MODULES), \
 114 ))
 115 
 116 $(foreach m, $(GENSRC_MODULES), $(eval $m-gensrc: $m-gensrc-src))
 117 
 118 LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, $(LANGTOOLS_MODULES)), $(GENSRC_TARGETS))
 119 INTERIM_LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, \
 120     $(INTERIM_LANGTOOLS_BASE_MODULES)), $(GENSRC_TARGETS))
 121 HOTSPOT_GENSRC_TARGETS := $(filter $(addsuffix -%, $(HOTSPOT_MODULES)), $(GENSRC_TARGETS))
 122 JDK_GENSRC_TARGETS := $(filter-out $(LANGTOOLS_GENSRC_TARGETS) \
 123     $(HOTSPOT_GENSRC_TARGETS), $(GENSRC_TARGETS))
 124 
 125 GENSRC_MODULEINFO_MODULES := $(ALL_MODULES)
 126 GENSRC_MODULEINFO_TARGETS := $(addsuffix -gensrc-moduleinfo, \
 127     $(GENSRC_MODULEINFO_MODULES))
 128 
 129 GENSRC_MODULES := $(GENSRC_MODULEINFO_MODULES)
 130 GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \
 131     $(addsuffix -gensrc, $(GENSRC_MODULES)))
 132 
 133 define DeclareModuleInfoRecipe
 134   $1-gensrc-moduleinfo:
 135         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
 136             -f gensrc/GensrcModuleInfo.gmk MODULE=$1)
 137 
 138   $1-gensrc: $1-gensrc-moduleinfo
 139 endef
 140 
 141 $(foreach m, $(GENSRC_MODULEINFO_MODULES), $(eval $(call DeclareModuleInfoRecipe,$m)))
 142 
 143 ALL_TARGETS += $(GENSRC_TARGETS)
 144 
 145 ################################################################################
 146 # Generate data targets
 147 $(eval $(call DeclareRecipesForPhase, GENDATA, \
 148     TARGET_SUFFIX := gendata, \
 149     FILE_PREFIX := Gendata, \
 150     MAKE_SUBDIR := gendata, \
 151     CHECK_MODULES := $(ALL_MODULES), \
 152     USE_WRAPPER := true))
 153 
 154 ALL_TARGETS += $(GENDATA_TARGETS)
 155 
 156 ################################################################################
 157 # Copy files targets
 158 $(eval $(call DeclareRecipesForPhase, COPY, \
 159     TARGET_SUFFIX := copy, \
 160     FILE_PREFIX := Copy, \
 161     MAKE_SUBDIR := copy, \
 162     CHECK_MODULES := $(ALL_MODULES), \
 163     USE_WRAPPER := true, \
 164 ))
 165 
 166 ALL_COPY_MODULES += $(COPY_MODULES)
 167 ALL_COPY_TARGETS += $(COPY_TARGETS)
 168 
 169 IMPORT_COPY_MODULES := $(call FindImportedModules)
 170 IMPORT_COPY_TARGETS := $(addsuffix -copy, $(IMPORT_COPY_MODULES))
 171 ALL_COPY_MODULES += $(IMPORT_COPY_MODULES)
 172 ALL_COPY_TARGETS += $(IMPORT_COPY_TARGETS)
 173 
 174 define DeclareImportCopyRecipe
 175   $1-copy:
 176         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
 177             -f CopyImportModules.gmk MODULE=$1)
 178 endef
 179 
 180 $(foreach m, $(IMPORT_COPY_MODULES), $(eval $(call DeclareImportCopyRecipe,$m)))
 181 
 182 ALL_TARGETS += $(ALL_COPY_TARGETS)
 183 
 184 ################################################################################
 185 # Targets for compiling all java modules.
 186 JAVA_MODULES := $(ALL_MODULES)
 187 JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
 188 
 189 define DeclareCompileJavaRecipe
 190   $1-java:
 191         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
 192             -f CompileJavaModules.gmk MODULE=$1)
 193 endef
 194 
 195 $(foreach m, $(JAVA_MODULES), $(eval $(call DeclareCompileJavaRecipe,$m)))
 196 
 197 ALL_TARGETS += $(JAVA_TARGETS)
 198 
 199 ################################################################################
 200 # Targets for running rmic.
 201 $(eval $(call DeclareRecipesForPhase, RMIC, \
 202     TARGET_SUFFIX := rmic, \
 203     FILE_PREFIX := Rmic, \
 204     MAKE_SUBDIR := rmic, \
 205     CHECK_MODULES := $(ALL_MODULES)))
 206 
 207 ALL_TARGETS += $(RMIC_TARGETS)
 208 
 209 ################################################################################
 210 # Targets for compiling native libraries
 211 $(eval $(call DeclareRecipesForPhase, LIBS, \
 212     TARGET_SUFFIX := libs, \
 213     FILE_PREFIX := Lib, \
 214     MAKE_SUBDIR := lib, \
 215     CHECK_MODULES := $(ALL_MODULES), \
 216     USE_WRAPPER := true))
 217 
 218 ALL_TARGETS += $(LIBS_TARGETS)
 219 
 220 ################################################################################
 221 # Targets for compiling static versions of certain native libraries. These do
 222 # not end up in the jmods or the normal JDK image, but are instead bundled into
 223 # a special deliverable.
 224 $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \
 225     TARGET_SUFFIX := static-libs, \
 226     FILE_PREFIX := Lib, \
 227     MAKE_SUBDIR := lib, \
 228     CHECK_MODULES := $(STATIC_LIBS_MODULES), \
 229     USE_WRAPPER := true, \
 230     EXTRA_ARGS := STATIC_LIBS=true, \
 231 ))
 232 
 233 ALL_TARGETS += $(STATIC_LIBS_TARGETS)
 234 
 235 ################################################################################
 236 # Targets for compiling native executables
 237 $(eval $(call DeclareRecipesForPhase, LAUNCHER, \
 238     TARGET_SUFFIX := launchers, \
 239     FILE_PREFIX := Launcher, \
 240     MAKE_SUBDIR := launcher, \
 241     CHECK_MODULES := $(ALL_MODULES), \
 242     USE_WRAPPER := true))
 243 
 244 ALL_TARGETS += $(LAUNCHER_TARGETS)
 245 
 246 ################################################################################
 247 # Build hotspot target
 248 
 249 HOTSPOT_VARIANT_TARGETS := $(addprefix hotspot-, $(JVM_VARIANTS))
 250 HOTSPOT_VARIANT_GENSRC_TARGETS := $(addsuffix -gensrc, $(HOTSPOT_VARIANT_TARGETS))
 251 HOTSPOT_VARIANT_LIBS_TARGETS := $(addsuffix -libs, $(HOTSPOT_VARIANT_TARGETS))
 252 
 253 define DeclareHotspotGensrcRecipe
 254   hotspot-$1-gensrc:
 255         $$(call LogInfo, Building JVM variant '$1' with features '$(JVM_FEATURES_$1)')
 256         +($(CD) $(TOPDIR)/make/hotspot && $(MAKE) $(MAKE_ARGS) -f gensrc/GenerateSources.gmk \
 257             JVM_VARIANT=$1)
 258 endef
 259 
 260 $(foreach v, $(JVM_VARIANTS), $(eval $(call DeclareHotspotGensrcRecipe,$v)))
 261 
 262 define DeclareHotspotLibsRecipe
 263   hotspot-$1-libs:
 264         +($(CD) $(TOPDIR)/make/hotspot && $(MAKE) $(MAKE_ARGS) -f lib/CompileLibraries.gmk \
 265             JVM_VARIANT=$1)
 266 endef
 267 
 268 $(foreach v, $(JVM_VARIANTS), $(eval $(call DeclareHotspotLibsRecipe,$v)))
 269 
 270 hotspot-ide-project:
 271         +($(CD) $(TOPDIR)/make/hotspot && $(MAKE) $(MAKE_ARGS) -f ide/CreateVSProject.gmk)
 272 
 273 ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
 274     $(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project
 275 
 276 ################################################################################
 277 # Generate libs and launcher targets for creating compile_commands.json fragments
 278 define DeclareCompileCommandsRecipe
 279   $1-compile-commands:
 280         $$(call LogInfo, Generating compile_commands.json fragments for $1)
 281         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk $1-only \
 282             GENERATE_COMPILE_COMMANDS_ONLY=true)
 283 
 284   COMPILE_COMMANDS_TARGETS_$2 += $1-compile-commands
 285 endef
 286 
 287 $(foreach t, $(HOTSPOT_VARIANT_LIBS_TARGETS), \
 288   $(eval $(call DeclareCompileCommandsRecipe,$t,HOTSPOT)) \
 289 )
 290 
 291 $(foreach t, $(LIBS_TARGETS) $(LAUNCHER_TARGETS), \
 292   $(eval $(call DeclareCompileCommandsRecipe,$t,JDK)) \
 293 )
 294 
 295 compile-commands compile-commands-hotspot:
 296         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCommands.gmk)
 297 
 298 ALL_TARGETS += $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
 299 ALL_TARGETS += compile-commands compile-commands-hotspot
 300 
 301 ################################################################################
 302 # VS Code projects
 303 vscode-project:
 304         +($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
 305       VSCODE_INDEXER=cpptools)
 306 
 307 vscode-project-clangd:
 308         +($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
 309       VSCODE_INDEXER=clangd)
 310 
 311 vscode-project-rtags:
 312         +($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
 313       VSCODE_INDEXER=rtags)
 314 
 315 vscode-project-ccls:
 316         +($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
 317       VSCODE_INDEXER=ccls)
 318 
 319 ALL_TARGETS += vscode-project vscode-project-clangd vscode-project-rtags \
 320   vscode-project-ccls
 321 
 322 ################################################################################
 323 # Build demos targets
 324 
 325 demos-jdk:
 326         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
 327 
 328 test-image-demos-jdk:
 329         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk images)
 330 
 331 ALL_TARGETS += demos-jdk test-image-demos-jdk
 332 
 333 ################################################################################
 334 # Jigsaw specific data and analysis targets.
 335 
 336 generate-summary:
 337         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateModuleSummary.gmk)
 338 
 339 ALL_TARGETS += generate-summary
 340 
 341 ################################################################################
 342 # Jmod targets
 343 
 344 JMOD_MODULES := $(ALL_MODULES)
 345 JMOD_TARGETS := $(addsuffix -jmod, $(JMOD_MODULES))
 346 
 347 define DeclareJmodRecipe
 348   $1-jmod:
 349         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
 350             MODULE=$1)
 351 endef
 352 
 353 $(foreach m, $(JMOD_MODULES), $(eval $(call DeclareJmodRecipe,$m)))
 354 
 355 ALL_TARGETS += $(JMOD_TARGETS)
 356 
 357 ################################################################################
 358 # Images targets
 359 
 360 store-source-revision:
 361         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk store-source-revision)
 362 
 363 create-source-revision-tracker:
 364         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk create-source-revision-tracker)
 365 
 366 BOOTCYCLE_TARGET := product-images
 367 bootcycle-images:
 368         ifneq ($(COMPILE_TYPE), cross)
 369           $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
 370           $(call MakeDir, $(OUTPUTDIR)/bootcycle-build)
 371           +$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
 372               LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
 373         else
 374           $(call LogWarn, Boot cycle build disabled when cross compiling)
 375         endif
 376 
 377 zip-security:
 378         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
 379 
 380 zip-source:
 381         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
 382 
 383 jrtfs-jar:
 384         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
 385 
 386 jdk-image:
 387         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jdk)
 388 
 389 legacy-jre-image:
 390         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jre)
 391 
 392 symbols-image:
 393         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk symbols)
 394 
 395 static-libs-image:
 396         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f StaticLibsImage.gmk)
 397 
 398 mac-jdk-bundle:
 399         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jdk-bundle)
 400 
 401 mac-legacy-jre-bundle:
 402         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk jre-bundle)
 403 
 404 release-file:
 405         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ReleaseFile.gmk)
 406 
 407 exploded-image-optimize:
 408         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
 409 
 410 graal-builder-image:
 411         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GraalBuilderImage.gmk)
 412 
 413 ifeq ($(JCOV_ENABLED), true)
 414   jcov-image:
 415         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Coverage.gmk jcov-image)
 416 endif
 417 
 418 ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
 419     zip-source jrtfs-jar jdk-image legacy-jre-image \
 420     symbols-image static-libs-image mac-jdk-bundle mac-legacy-jre-bundle \
 421     release-file exploded-image-optimize graal-builder-image jcov-image
 422 
 423 ################################################################################
 424 # Docs targets
 425 
 426 # If building full docs, to complete docs-*-api we need both the javadoc and
 427 # modulegraph targets.
 428 docs-jdk-api-javadoc:
 429         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-javadoc)
 430 
 431 docs-jdk-api-modulegraph:
 432         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-api-modulegraph)
 433 
 434 docs-javase-api-javadoc:
 435         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-javadoc)
 436 
 437 docs-javase-api-modulegraph:
 438         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-javase-api-modulegraph)
 439 
 440 docs-reference-api-javadoc:
 441         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-reference-api-javadoc)
 442 
 443 docs-reference-api-modulegraph:
 444         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-reference-api-modulegraph)
 445 
 446 docs-jdk-specs:
 447         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-specs)
 448 
 449 docs-jdk-index:
 450         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-jdk-index)
 451 
 452 docs-zip:
 453         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-zip)
 454 
 455 docs-specs-zip:
 456         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Docs.gmk docs-specs-zip)
 457 
 458 update-build-docs:
 459         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
 460 
 461 update-x11wrappers:
 462         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UpdateX11Wrappers.gmk)
 463 
 464 ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
 465     docs-javase-api-javadoc docs-javase-api-modulegraph \
 466     docs-reference-api-javadoc docs-reference-api-modulegraph docs-jdk-specs \
 467     docs-jdk-index docs-zip docs-specs-zip update-build-docs update-x11wrappers
 468 
 469 ################################################################################
 470 # Cross compilation support
 471 
 472 ifeq ($(CREATING_BUILDJDK), true)
 473   # This target is only called by the recursive call below.
 474   create-buildjdk-interim-image-helper: interim-image jdk.jlink-launchers \
 475       java.base-copy jdk.jdeps-launchers
 476 endif
 477 
 478 BUILDJDK_MODULES := $(sort $(foreach m, jdk.jlink $(INTERIM_IMAGE_MODULES), \
 479     $(call FindTransitiveDepsForModule, $m) $m))
 480 
 481 create-buildjdk-interim-image:
 482         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \
 483             $@-helper \
 484             SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
 485             HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
 486             CREATING_BUILDJDK=true \
 487             LOG_PREFIX="[buildjdk] " \
 488             JAVA_MODULES="$(BUILDJDK_MODULES)" \
 489         )
 490 
 491 ALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image
 492 
 493 ################################################################################
 494 # The interim-image is a small jlinked image that is used to generate artifacts
 495 # at build time for use when linking the real images.
 496 
 497 INTERIM_JMOD_TARGETS := $(addsuffix -interim-jmod, $(INTERIM_IMAGE_MODULES))
 498 
 499 define DeclareInterimJmodRecipe
 500   $1-interim-jmod:
 501         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
 502             MODULE=$1 \
 503             JMODS_DIR=$(INTERIM_JMODS_DIR) \
 504             JMODS_SUPPORT_DIR=$(INTERIM_JMODS_DIR)/support \
 505             INTERIM_JMOD=true \
 506         )
 507 endef
 508 
 509 $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $(call DeclareInterimJmodRecipe,$m)))
 510 
 511 interim-image:
 512         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
 513 
 514 ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
 515   generate-link-opt-data:
 516         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateLinkOptData.gmk)
 517 endif
 518 
 519 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
 520 
 521 ################################################################################
 522 # Generate test names for all JTReg test groups
 523 #
 524 
 525 define DeclareRunTestRecipe
 526   test-$1:
 527         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 528             TEST="$1")
 529 
 530   exploded-test-$1:
 531         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 532             TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
 533 endef
 534 
 535 # ALL_NAMED_TESTS is defined in FindTests.gmk
 536 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
 537 ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS))
 538 
 539 # We only support the "exploded-test-gtest" shortcut
 540 ALL_EXPLODED_TESTS := gtest
 541 ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS))
 542 
 543 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS)
 544 
 545 ################################################################################
 546 # Build tests and microbenchmarks
 547 #
 548 
 549 prepare-test-image:
 550         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f TestImage.gmk prepare-test-image)
 551 
 552 build-test-hotspot-jtreg-native:
 553         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeHotspot.gmk \
 554             build-test-hotspot-jtreg-native)
 555 
 556 test-image-hotspot-jtreg-native:
 557         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeHotspot.gmk \
 558             test-image-hotspot-jtreg-native)
 559 
 560 build-test-jdk-jtreg-native:
 561         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
 562             build-test-jdk-jtreg-native)
 563 
 564 test-image-jdk-jtreg-native:
 565         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
 566             test-image-jdk-jtreg-native)
 567 
 568 build-test-hotspot-jtreg-graal:
 569         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
 570              build-test-hotspot-jtreg-graal)
 571 
 572 test-image-hotspot-jtreg-graal:
 573         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
 574              test-image-hotspot-jtreg-graal)
 575 
 576 ifeq ($(BUILD_GTEST), true)
 577   test-image-hotspot-gtest:
 578         +($(CD) $(TOPDIR)/make/hotspot/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
 579 endif
 580 
 581 build-test-lib:
 582         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
 583 
 584 ifeq ($(BUILD_FAILURE_HANDLER), true)
 585   # Builds the failure handler jtreg extension
 586   build-test-failure-handler:
 587         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
 588             -f BuildFailureHandler.gmk build)
 589 
 590   # Copies the failure handler jtreg extension into the test image
 591   test-image-failure-handler:
 592         +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
 593              -f BuildFailureHandler.gmk images)
 594 endif
 595 
 596 build-microbenchmark:
 597         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f test/BuildMicrobenchmark.gmk)
 598 
 599 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
 600     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
 601     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
 602     test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
 603     test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \
 604     build-microbenchmark
 605 
 606 ################################################################################
 607 # Run tests
 608 
 609 test:
 610         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 611             TEST="$(TEST)")
 612 
 613 exploded-test:
 614         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 615             TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR))
 616 
 617 jcov-test:
 618         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \
 619             TEST="$(TEST)" TEST_OPTS_JCOV=true)
 620 
 621 ALL_TARGETS += test exploded-test jcov-test
 622 
 623 ################################################################################
 624 # Bundles
 625 
 626 product-bundles:
 627         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
 628 
 629 legacy-bundles:
 630         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk legacy-bundles)
 631 
 632 test-bundles:
 633         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
 634 
 635 docs-bundles:
 636         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
 637 
 638 static-libs-bundles:
 639         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk static-libs-bundles)
 640 
 641 ifeq ($(JCOV_ENABLED), true)
 642   jcov-bundles:
 643         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk jcov-bundles)
 644 endif
 645 
 646 ALL_TARGETS += product-bundles legacy-bundles test-bundles docs-bundles \
 647     static-libs-bundles jcov-bundles
 648 
 649 ################################################################################
 650 # Install targets
 651 
 652 install:
 653         +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
 654 
 655 ALL_TARGETS += install
 656 
 657 ################################################################################
 658 #
 659 # Dependency declarations between targets.
 660 #
 661 # These are declared in two groups. First all dependencies between targets that
 662 # have recipes above as these dependencies may be disabled. Then the aggregator
 663 # targets that do not have recipes of their own, which will never have their
 664 # dependencies disabled.
 665 #
 666 ################################################################################
 667 # Targets with recipes above
 668 
 669 # If running an *-only target, parallel execution and dependencies between
 670 # recipe targets are disabled. This makes it possible to run a select set of
 671 # recipe targets in order. It's the responsibility of the user to make sure
 672 # all prerequisites are fulfilled.
 673 ifneq ($(findstring -only, $(MAKECMDGOALS)), )
 674   .NOTPARALLEL:
 675 else
 676   $(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
 677 
 678   interim-langtools: $(INTERIM_LANGTOOLS_GENSRC_TARGETS)
 679 
 680   buildtools-jdk: interim-langtools interim-cldrconverter interim-tzdb
 681 
 682   buildtools-hotspot: interim-langtools
 683 
 684   buildtools-modules: exploded-image-base
 685 
 686   $(HOTSPOT_GENSRC_TARGETS): interim-langtools buildtools-hotspot
 687 
 688   $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
 689 
 690   $(GENSRC_MODULEINFO_TARGETS): buildtools-jdk
 691 
 692   $(GENDATA_TARGETS): interim-langtools buildtools-jdk
 693 
 694   interim-rmic: interim-langtools
 695 
 696   $(RMIC_TARGETS): interim-langtools interim-rmic
 697 
 698   $(JAVA_TARGETS): interim-langtools
 699 
 700   # Declare dependencies between hotspot-<variant>* targets
 701   $(foreach v, $(JVM_VARIANTS), \
 702       $(eval hotspot-$v-gensrc: java.base-copy) \
 703       $(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
 704   )
 705 
 706   hotspot-ide-project: hotspot exploded-image
 707 
 708   generate-exported-symbols: java.base-libs jdk.jdwp.agent-libs
 709 
 710   # If not already set, set the JVM variant target so that the JVM will be built.
 711   JVM_MAIN_LIB_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs
 712 
 713   # Building one JVM variant is enough to start building the other libs
 714   $(LIBS_TARGETS): $(JVM_MAIN_LIB_TARGETS)
 715 
 716   $(LAUNCHER_TARGETS): java.base-libs
 717 
 718   ifeq ($(STATIC_BUILD), true)
 719     $(LAUNCHER_TARGETS): generate-exported-symbols
 720   endif
 721 
 722   # The demos are currently linking to libjvm and libjava, just like all other
 723   # jdk libs, even though they don't need to. To avoid warnings, make sure they
 724   # aren't built until after libjava and libjvm are available to link to.
 725   demos-jdk: java.base-libs exploded-image
 726   test-image-demos-jdk: demos-jdk
 727 
 728   # Declare dependency from <module>-java to <module>-gensrc
 729   $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
 730 
 731   # Declare dependencies between java modules
 732   $(foreach m, $(JAVA_MODULES), \
 733       $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
 734       $(call FindDepsForModule,$m)))))
 735   # Declare dependencies between the module meta targets
 736   $(foreach m, $(ALL_MODULES), $(eval $m: $(call FindDepsForModule,$m)))
 737 
 738   # Declare dependencies between <module>-rmic to <module>-java
 739   $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
 740 
 741   # Declare dependencies from <module>-lib to <module>-java
 742   # Skip modules that do not have java source.
 743   $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
 744 
 745   # Declare dependencies from all other <module>-lib to java.base-lib
 746   $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
 747       $(eval $t: java.base-libs))
 748 
 749   # jdk.accessibility depends on java.desktop
 750   jdk.accessibility-libs: java.desktop-libs
 751 
 752   # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
 753   # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
 754   # virtual target.
 755   jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
 756 
 757   # The swing beans need to have java base properly generated to avoid errors
 758   # in javadoc. The X11 wrappers need the java.base include files to have been
 759   # copied and processed.
 760   java.desktop-gensrc-src: java.base-gensrc java.base-copy
 761 
 762   # The annotation processing for jdk.internal.vm.compiler
 763   # and jdk.internal.vm.compiler.management needs classes from the current JDK.
 764   jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \
 765       $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
 766   jdk.internal.vm.compiler.management-gensrc-src: $(addsuffix -java, \
 767       $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler.management))
 768 
 769   # For these modules, the gensrc step is generating a module-info.java.extra
 770   # file to be processed by the gensrc-moduleinfo target.
 771   jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src
 772   jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src
 773 
 774   jdk.jdeps-gendata: java rmic
 775 
 776   # The ct.sym generation uses all the moduleinfos as input
 777   jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS)
 778 
 779   # Declare dependencies between jmod targets.
 780   # java.base jmod needs jrt-fs.jar and access to the other jmods to be built.
 781   # When creating the BUILDJDK, we don't need to add hashes to java.base, thus
 782   # we don't need to depend on all other jmods
 783   ifneq ($(CREATING_BUILDJDK), true)
 784     java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS))
 785   endif
 786 
 787   # If not already set, set the JVM target so that the JVM will be built.
 788   JVM_MAIN_TARGETS ?= hotspot
 789 
 790   # Building java.base-jmod requires all of VM (ie hotspot) to be built.
 791   java.base-jmod: $(JVM_MAIN_TARGETS)
 792 
 793   # Declare dependencies from <module>-jmod to all other module targets
 794   $(foreach m, $(JAVA_MODULES), $(eval $m_JMOD_DEPS += $m-java))
 795   $(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata))
 796   $(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic))
 797   $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs))
 798   $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers))
 799   $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy))
 800   $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
 801   $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
 802 
 803   # Setup the minimal set of generated native source dependencies for hotspot
 804   $(foreach v, $(JVM_VARIANTS), \
 805     $(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \
 806     $(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \
 807       $(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \
 808   )
 809 
 810   # For the full JDK compile commands, create all possible generated sources
 811   $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
 812   $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
 813 
 814   $(COMPILE_COMMANDS_TARGETS_HOTSPOT): clean-compile-commands
 815   $(COMPILE_COMMANDS_TARGETS_JDK): clean-compile-commands
 816   compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
 817   compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
 818 
 819   vscode-project: compile-commands
 820   vscode-project-clangd: compile-commands
 821   vscode-project-rtags: compile-commands
 822   vscode-project-ccls: compile-commands
 823 
 824   # The -static-libs targets depend on -java as well as java.base-copy.
 825   $(foreach m, $(filter $(JAVA_MODULES), $(STATIC_LIBS_MODULES)), \
 826     $(eval $m-static-libs: $m-java java.base-copy))
 827 
 828   # Jmods cannot be created until we have the jmod tool ready to run. During
 829   # a normal build we run it from the exploded image, but when cross compiling
 830   # it's run from the buildjdk, which is either created at build time or user
 831   # supplied.
 832   ifeq ($(CREATE_BUILDJDK), true)
 833     ifneq ($(CREATING_BUILDJDK), true)
 834       # When cross compiling and buildjdk is to be created, simply depend on
 835       # creating the buildjdk.
 836       $(JMOD_TARGETS): create-buildjdk
 837       buildtools-modules: create-buildjdk
 838     else
 839       # While actually creating the buildjdk, we need to list the bare
 840       # minimum dependencies needed before running jmod, to avoid building
 841       # more than necessary. This includes:
 842       # * all java modules
 843       # * jdk.jlink-launchers
 844       # * copy jvm.cfg (done in java.base-copy)
 845       # * tzdb.dat (done in java.base-gendata)
 846       # Without all of these jimage, jlink and jmod won't start.
 847       $(JMOD_TARGETS) $(INTERIM_JMOD_TARGETS): java.base-libs java.base-copy \
 848           java.base-gendata jdk.jlink-launchers java
 849     endif
 850   else
 851     # The normal non cross compilation case uses needs to wait for the full
 852     # exploded-image to avoid a race with the optimize target.
 853     $(JMOD_TARGETS) $(INTERIM_JMOD_TARGETS): exploded-image
 854   endif
 855 
 856   # All modules include the main license files from java.base.
 857   $(JMOD_TARGETS): java.base-copy
 858 
 859   zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
 860       $(filter jdk.crypto%, $(JAVA_TARGETS))
 861 
 862   zip-source: gensrc rmic
 863 
 864   jrtfs-jar: interim-langtools
 865 
 866   build-microbenchmark: interim-langtools exploded-image
 867 
 868   ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
 869     ifeq ($(CREATE_BUILDJDK), true)
 870       # If creating a buildjdk, the interim image needs to be based on that.
 871       generate-link-opt-data: create-buildjdk
 872     else ifeq ($(EXTERNAL_BUILDJDK), false)
 873       # If an external buildjdk has been provided, we skip generating an
 874       # interim-image and just use the external buildjdk for generating
 875       # classlist.
 876       generate-link-opt-data: interim-image
 877     endif
 878     generate-link-opt-data: buildtools-jdk
 879 
 880     # The generated classlist needs to go into java.base-jmod.
 881     java.base-jmod jdk.jlink-jmod jdk-image legacy-jre-image: generate-link-opt-data
 882   endif
 883 
 884   release-file: create-source-revision-tracker
 885 
 886   jdk-image: jmods zip-source demos release-file
 887   legacy-jre-image: jmods release-file
 888   symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
 889 
 890   static-libs-image: $(STATIC_LIBS_TARGETS)
 891 
 892   graal-builder-image: jdk-image static-libs-image
 893 
 894   mac-jdk-bundle: jdk-image
 895   mac-legacy-jre-bundle: legacy-jre-image
 896 
 897   ifeq ($(JCOV_INPUT_JDK), )
 898     jcov-image: jdk-image
 899   endif
 900 
 901   # The optimize target can run as soon as the modules dir has been completely
 902   # populated (java, copy and gendata targets) and the basic libs and launchers
 903   # have been built.
 904   exploded-image-optimize: java copy gendata java.base-libs java.base-launchers \
 905       buildtools-modules
 906 
 907   bootcycle-images: jdk-image
 908 
 909   docs-jdk-api-javadoc: $(GENSRC_TARGETS) rmic
 910 
 911   docs-javase-api-javadoc: $(GENSRC_TARGETS) rmic
 912 
 913   docs-reference-api-javadoc: $(GENSRC_TARGETS) rmic
 914 
 915   docs-jdk-api-modulegraph: exploded-image buildtools-modules
 916 
 917   docs-javase-api-modulegraph: exploded-image buildtools-modules
 918 
 919   docs-reference-api-modulegraph: exploded-image buildtools-modules
 920 
 921   # If not already set, then set the JVM specific docs targets
 922   JVM_DOCS_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
 923 
 924   # The gensrc steps for hotspot and jdk.jdi create html spec files.
 925   docs-jdk-specs: buildtools-jdk $(JVM_DOCS_TARGETS) jdk.jdi-gensrc \
 926       docs-jdk-index
 927 
 928   docs-zip: docs-jdk
 929 
 930   docs-specs-zip: docs-jdk-specs
 931 
 932   # Tests
 933   test: jdk-image test-image
 934 
 935   exploded-test: exploded-image test-image
 936 
 937   jcov-test: jcov-image test-image
 938 
 939   test-make: clean-test-make compile-commands
 940 
 941   test-make-compile-commands: compile-commands
 942 
 943   # Declare dependency for all generated test targets
 944   $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
 945   $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
 946 
 947   interim-image: $(INTERIM_JMOD_TARGETS)
 948 
 949   build-test-lib: exploded-image
 950 
 951   build-test-failure-handler: interim-langtools
 952 
 953   test-image-failure-handler: build-test-failure-handler
 954 
 955   build-test-hotspot-jtreg-native: buildtools-jdk \
 956       hotspot-$(JVM_VARIANT_MAIN)-libs
 957 
 958   build-test-jdk-jtreg-native: buildtools-jdk java.base-libs
 959 
 960   build-test-hotspot-jtreg-graal: exploded-image
 961 
 962   test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
 963 
 964   test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
 965 
 966   test-image-hotspot-jtreg-graal: build-test-hotspot-jtreg-graal
 967 
 968   test-image-hotspot-gtest: hotspot
 969 
 970   install: product-images
 971 
 972   product-bundles: product-images
 973 
 974   legacy-bundles: legacy-images
 975 
 976   test-bundles: test-image
 977 
 978   docs-bundles: docs-image
 979 
 980   jcov-bundles: jcov-image
 981 
 982   static-libs-bundles: static-libs-image
 983 
 984   generate-summary: jmods buildtools-modules
 985 
 986   update-x11wrappers: java.base-copy buildtools-jdk
 987 
 988 endif
 989 
 990 ################################################################################
 991 # Virtual targets without recipes
 992 
 993 # If not already set, set the JVM specific tools targets
 994 JVM_TOOLS_TARGETS ?= buildtools-hotspot
 995 buildtools: buildtools-langtools interim-langtools interim-rmic \
 996     buildtools-jdk $(JVM_TOOLS_TARGETS)
 997 
 998 # Declare dependencies from hotspot-<variant> targets
 999 $(foreach v, $(JVM_VARIANTS), \
1000   $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
1001 )
1002 hotspot: $(HOTSPOT_VARIANT_TARGETS)
1003 
1004 # Create targets hotspot-libs and hotspot-gensrc.
1005 $(foreach v, $(JVM_VARIANTS), \
1006   $(eval hotspot-libs: hotspot-$v-libs) \
1007   $(eval hotspot-gensrc: hotspot-$v-gensrc) \
1008 )
1009 
1010 gensrc: $(GENSRC_TARGETS)
1011 
1012 gendata: $(GENDATA_TARGETS)
1013 
1014 copy: $(ALL_COPY_TARGETS)
1015 
1016 java: $(JAVA_TARGETS)
1017 
1018 rmic: $(RMIC_TARGETS)
1019 
1020 libs: $(LIBS_TARGETS)
1021 
1022 static-libs: $(STATIC_LIBS_TARGETS)
1023 
1024 launchers: $(LAUNCHER_TARGETS)
1025 
1026 jmods: $(JMOD_TARGETS)
1027 
1028 # Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
1029 # is actually handled by jdk.jdi-gensrc
1030 jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
1031 
1032 # Declare dependencies from <module> to all the individual targets specific
1033 # to that module <module>-*, that are needed for the exploded image.
1034 $(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
1035 $(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
1036 $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
1037 $(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
1038 $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
1039 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
1040 $(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
1041 
1042 # Building java.base includes building all of hotspot.
1043 java.base: $(JVM_MAIN_TARGETS)
1044 
1045 demos: demos-jdk
1046 
1047 # The "exploded image" is a locally runnable JDK in $(OUTPUTDIR)/jdk.
1048 exploded-image-base: $(ALL_MODULES)
1049 exploded-image: exploded-image-base release-file
1050 # When cross compiling, no need to optimize the exploded image since it won't
1051 # be runnable on the host platform anyway.
1052 ifneq ($(COMPILE_TYPE), cross)
1053   exploded-image: exploded-image-optimize
1054 endif
1055 
1056 create-buildjdk: create-buildjdk-interim-image
1057 
1058 docs-jdk-api: docs-jdk-api-javadoc
1059 docs-javase-api: docs-javase-api-javadoc
1060 docs-reference-api: docs-reference-api-javadoc
1061 
1062 # If we're building full docs, we must also generate the module graphs to
1063 # get non-broken api documentation.
1064 ifeq ($(ENABLE_FULL_DOCS), true)
1065   docs-jdk-api: docs-jdk-api-modulegraph
1066   docs-javase-api: docs-javase-api-modulegraph
1067   docs-reference-api: docs-reference-api-modulegraph
1068 endif
1069 
1070 docs-jdk: docs-jdk-api docs-jdk-specs docs-jdk-index
1071 docs-javase: docs-javase-api
1072 docs-reference: docs-reference-api
1073 
1074 # alias for backwards compatibility
1075 docs-javadoc: docs-jdk-api
1076 
1077 mac-bundles: mac-jdk-bundle
1078 
1079 # The $(OUTPUTDIR)/images directory contain the resulting deliverables,
1080 # and in line with this, our targets for creating these are named *-image[s].
1081 
1082 # This target builds the product images, e.g. the JDK image
1083 # (and possibly other, more specific versions)
1084 product-images: jdk-image symbols-image exploded-image
1085 
1086 # This target builds the legacy images, e.g. the legacy JRE image
1087 legacy-images: legacy-jre-image
1088 
1089 # zip-security is actually a bundle, but for now it needs to be considered
1090 # an image until this can be cleaned up properly.
1091 product-images: zip-security
1092 
1093 # The module summary cannot be run when:
1094 # * Cross compiling and building a partial BUILDJDK for the build host
1095 # * An external buildjdk has been supplied since it may not match the
1096 #   module selection of the target jdk
1097 ifneq ($(CREATE_BUILDJDK), true)
1098   ifeq ($(EXTERNAL_BUILDJDK), false)
1099     product-images: generate-summary
1100   endif
1101 endif
1102 
1103 ifeq ($(call isTargetOs, macosx), true)
1104   product-images: mac-jdk-bundle
1105 
1106   legacy-images: mac-legacy-jre-bundle
1107 endif
1108 
1109 # This target builds the documentation image
1110 docs-image: docs-jdk
1111 
1112 # If not already set, set the JVM specific targets to build the test image
1113 JVM_TEST_IMAGE_TARGETS ?= test-image-hotspot-jtreg-native test-image-hotspot-gtest
1114 
1115 ifeq ($(INCLUDE_GRAAL), true)
1116   JVM_TEST_IMAGE_TARGETS += test-image-hotspot-jtreg-graal
1117 endif
1118 
1119 # This target builds the test image
1120 test-image: prepare-test-image \
1121     test-image-jdk-jtreg-native test-image-failure-handler \
1122     test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS)
1123 
1124 ifneq ($(JMH_CORE_JAR), )
1125   test-image: build-microbenchmark
1126 endif
1127 
1128 ################################################################################
1129 
1130 # all-images builds all our deliverables as images.
1131 all-images: product-images test-image docs-image
1132 
1133 # all-bundles packages all our deliverables as tar.gz bundles.
1134 all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
1135 
1136 ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-gensrc gensrc gendata \
1137     copy java rmic libs static-libs launchers jmods \
1138     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \
1139     exploded-image-base exploded-image \
1140     create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
1141     docs-javase docs-reference docs-javadoc mac-bundles product-images legacy-images \
1142     docs-image test-image all-images \
1143     all-bundles
1144 
1145 ################################################################################
1146 
1147 # Traditional targets typically run by users.
1148 # These can be considered aliases for the targets now named by a more
1149 # "modern" naming scheme.
1150 default: $(DEFAULT_MAKE_TARGET)
1151 jdk: exploded-image
1152 images: product-images
1153 docs: docs-image
1154 bundles: all-bundles
1155 all: all-images
1156 
1157 ALL_TARGETS += default jdk images docs bundles all
1158 
1159 # Aliases used for running tests.
1160 
1161 # Let "run-test" be an alias for "test"
1162 $(foreach t, $(ALL_NAMED_TESTS), $(eval run-test-$t: test-$t))
1163 RUN_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
1164 
1165 run-test: test
1166 exploded-run-test: exploded-test
1167 
1168 # "make check" is a common idiom for running basic testing
1169 check: test-tier1
1170 
1171 # Keep some old names as aliases
1172 test-hotspot-jtreg: test-hotspot_all
1173 test-hotspot-jtreg-native: test-hotspot_native_sanity
1174 test-hotspot-gtest: exploded-test-gtest
1175 test-jdk-jtreg-native: test-jdk_native_sanity
1176 
1177 ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
1178     test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \
1179     test-jdk-jtreg-native
1180 
1181 ################################################################################
1182 ################################################################################
1183 #
1184 # Clean targets
1185 #
1186 ################################################################################
1187 # Clean targets are automatically run serially by the Makefile calling this
1188 # file.
1189 
1190 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
1191     images make-support test-make bundles buildjdk test-results test-support \
1192     support/images
1193 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
1194 CLEAN_SUPPORT_DIRS += demos
1195 CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
1196 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
1197 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
1198 CLEAN_PHASES := gensrc java native include
1199 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
1200 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
1201 # Construct targets of the form clean-$module-$phase
1202 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
1203     $(addprefix $m-, $(CLEAN_PHASES))))
1204 
1205 # Remove everything, except the output from configure.
1206 clean: $(CLEAN_DIR_TARGETS)
1207         ($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json)
1208         $(ECHO) Cleaned all build artifacts.
1209 
1210 clean-docs:
1211         $(call CleanDocs)
1212 
1213 clean-compile-commands:
1214         $(call CleanMakeSupportDir,compile-commands)
1215 
1216 $(CLEAN_DIR_TARGETS):
1217         $(call CleanDir,$(patsubst clean-%, %, $@))
1218 
1219 $(CLEAN_SUPPORT_DIR_TARGETS):
1220         $(call CleanSupportDir,$(patsubst clean-%, %, $@))
1221 
1222 $(CLEAN_TEST_TARGETS):
1223         $(call CleanTest,$(patsubst clean-test-%, %, $@))
1224 
1225 $(CLEAN_PHASE_TARGETS):
1226         $(call Clean-$(patsubst clean-%,%, $@))
1227 
1228 $(CLEAN_MODULE_TARGETS):
1229         $(call CleanModule,$(patsubst clean-%, %, $@))
1230 
1231 $(CLEAN_MODULE_PHASE_TARGETS):
1232         $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
1233             $(word 2, $(subst -,$(SPACE),$@)))
1234 
1235 # When removing the support dir, we must also remove jdk. Building classes has
1236 # the side effect of generating native headers. The headers end up in support
1237 # while classes and touch files end up in jdk.
1238 clean-support: clean-jdk
1239 
1240 clean-test: clean-test-results clean-test-support
1241 
1242 # When cleaning images, also clean the support/images directory.
1243 clean-images: clean-support/images
1244 
1245 # Remove everything, including configure configuration. If the output
1246 # directory was created by configure and now becomes empty, remove it as well.
1247 dist-clean: clean
1248         ($(CD) $(OUTPUTDIR) && \
1249             $(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide \
1250             configure.log* build.log*)
1251         $(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
1252           if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
1253             $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
1254           else \
1255             ($(CD) $(TOPDIR) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
1256                 && $(RM) -r $(OUTPUTDIR)) \
1257           fi \
1258         )
1259         $(ECHO) Cleaned everything, you will have to re-run configure.
1260 
1261 ALL_TARGETS += clean clean-docs clean-compile-commands dist-clean $(CLEAN_DIR_TARGETS) \
1262     $(CLEAN_SUPPORT_DIR_TARGETS) $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) \
1263     $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
1264 
1265 ################################################################################
1266 # Declare *-only targets for each normal target
1267 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
1268 
1269 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
1270 
1271 ################################################################################
1272 
1273 # The following targets are intentionally not added to ALL_TARGETS since they
1274 # are internal only, to support Init.gmk.
1275 
1276 print-targets:
1277           @$(ECHO) $(sort $(ALL_TARGETS))
1278 
1279 print-modules:
1280           @$(ECHO) $(sort $(ALL_MODULES))
1281 
1282 print-tests:
1283           @$(ECHO) $(sort $(ALL_NAMED_TESTS))
1284 
1285 create-main-targets-include:
1286           $(call LogInfo, Generating main target list)
1287           @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
1288               $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
1289 
1290 ################################################################################
1291 # Hook to include the corresponding custom file, if present.
1292 $(eval $(call IncludeCustomExtension, Main-post.gmk))
1293 
1294 .PHONY: $(ALL_TARGETS)
1295 
1296 FRC: # Force target
--- EOF ---