annotate make/Main.gmk @ 2601:4635fa3adac6

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