annotate make/Main.gmk @ 1428:9fa2185bee17

8073634: Improve clean targets Reviewed-by: ihse
author erikj
date Fri, 10 Apr 2015 16:32:00 +0200
parents f658baecb743
children d0321d15e0a0
rev   line source
ohair@492 1 #
ihse@1345 2 # Copyright (c) 2011, 2015, 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
ohair@492 46
chegar@1120 47 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
ihse@1236 48 # valid top level targets. It's used to declare them all as PHONY and to
chegar@1120 49 # generate the -only targets.
chegar@1120 50 ALL_TARGETS :=
chegar@1120 51
ihse@968 52 # Hook to include the corresponding custom file, if present.
ihse@968 53 $(eval $(call IncludeCustomExtension, , Main.gmk))
ohair@492 54
chegar@1120 55 # All modules for the current target platform.
chegar@1120 56 # Manually add jdk.hotspot.agent for now.
chegar@1120 57 ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
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
chegar@1223 69 buildtools-langtools:
chegar@1223 70 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
chegar@1223 71
chegar@1120 72 interim-langtools:
chegar@1120 73 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
chegar@1120 74
chegar@1120 75 interim-corba:
chegar@1223 76 +($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
chegar@1120 77
chegar@1120 78 interim-rmic:
chegar@1120 79 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
chegar@1120 80
chegar@1223 81 buildtools-jdk:
chegar@1120 82 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
chegar@1120 83
chegar@1223 84 ALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
chegar@1223 85 interim-rmic buildtools-jdk
chegar@1120 86
chegar@1120 87 ################################################################################
chegar@1120 88 # Special targets for certain modules
chegar@1120 89
chegar@1120 90 import-hotspot:
chegar@1120 91 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
chegar@1120 92
chegar@1120 93 unpack-sec:
chegar@1120 94 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
chegar@1120 95
chegar@1223 96 ALL_TARGETS += import-hotspot unpack-sec
chegar@1120 97
chegar@1120 98 ################################################################################
chegar@1120 99 # Gensrc targets, generating source before java compilation can be done
chegar@1223 100 $(eval $(call DeclareRecipesForPhase, GENSRC, \
chegar@1223 101 TARGET_SUFFIX := gensrc, \
chegar@1223 102 FILE_PREFIX := Gensrc, \
chegar@1223 103 MAKE_SUBDIR := gensrc, \
chegar@1223 104 CHECK_MODULES := $(ALL_MODULES), \
chegar@1223 105 MULTIPLE_MAKEFILES := true))
chegar@1120 106
chegar@1223 107 JDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
chegar@1223 108 LANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
chegar@1223 109 CORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
chegar@1120 110
chegar@1120 111 ALL_TARGETS += $(GENSRC_TARGETS)
chegar@1120 112
chegar@1120 113 ################################################################################
chegar@1120 114 # Generate data targets
chegar@1223 115 $(eval $(call DeclareRecipesForPhase, GENDATA, \
chegar@1223 116 TARGET_SUFFIX := gendata, \
chegar@1223 117 FILE_PREFIX := Gendata, \
chegar@1223 118 MAKE_SUBDIR := gendata, \
chegar@1223 119 CHECK_MODULES := $(ALL_MODULES), \
chegar@1223 120 USE_WRAPPER := true))
chegar@1120 121
chegar@1120 122 ALL_TARGETS += $(GENDATA_TARGETS)
chegar@1120 123
chegar@1120 124 ################################################################################
chegar@1120 125 # Copy files targets
chegar@1223 126 $(eval $(call DeclareRecipesForPhase, COPY, \
chegar@1223 127 TARGET_SUFFIX := copy, \
chegar@1223 128 FILE_PREFIX := Copy, \
chegar@1223 129 MAKE_SUBDIR := copy, \
chegar@1223 130 CHECK_MODULES := $(ALL_MODULES), \
chegar@1223 131 USE_WRAPPER := true))
chegar@1120 132
chegar@1120 133 ALL_TARGETS += $(COPY_TARGETS)
chegar@1120 134
chegar@1120 135 ################################################################################
chegar@1120 136 # Targets for compiling all java modules. Nashorn is treated separately.
chegar@1120 137 JAVA_MODULES := $(call FindJavaModules)
chegar@1120 138 JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
chegar@1120 139
chegar@1120 140 define DeclareCompileJavaRecipe
chegar@1120 141 $1-java:
chegar@1120 142 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
chegar@1120 143 $1 JAVA_MODULES=$1)
chegar@1120 144 endef
chegar@1120 145
chegar@1120 146 $(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
chegar@1120 147 $(eval $(call DeclareCompileJavaRecipe,$m)))
chegar@1120 148
chegar@1120 149 # Build nashorn. Needs to be compiled separately from the rest of the modules
chegar@1120 150 # due to nasgen.
chegar@1120 151 jdk.scripting.nashorn-java:
chegar@1120 152 +($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
chegar@1120 153
chegar@1120 154 ALL_TARGETS += $(JAVA_TARGETS)
chegar@1120 155
chegar@1120 156 ################################################################################
chegar@1120 157 # Targets for running rmic.
chegar@1223 158 $(eval $(call DeclareRecipesForPhase, RMIC, \
chegar@1223 159 TARGET_SUFFIX := rmic, \
chegar@1223 160 FILE_PREFIX := Rmic, \
chegar@1223 161 MAKE_SUBDIR := rmic, \
chegar@1223 162 CHECK_MODULES := $(ALL_MODULES)))
chegar@1120 163
chegar@1120 164 ALL_TARGETS += $(RMIC_TARGETS)
chegar@1120 165
chegar@1120 166 ################################################################################
chegar@1120 167 # Targets for compiling native libraries
chegar@1223 168 $(eval $(call DeclareRecipesForPhase, LIBS, \
chegar@1223 169 TARGET_SUFFIX := libs, \
chegar@1223 170 FILE_PREFIX := Lib, \
chegar@1223 171 MAKE_SUBDIR := lib, \
chegar@1223 172 CHECK_MODULES := $(ALL_MODULES), \
chegar@1223 173 USE_WRAPPER := true))
chegar@1120 174
chegar@1223 175 ALL_TARGETS += $(LIBS_TARGETS)
chegar@1120 176
chegar@1120 177 ################################################################################
chegar@1120 178 # Targets for compiling native executables
chegar@1223 179 $(eval $(call DeclareRecipesForPhase, LAUNCHER, \
chegar@1223 180 TARGET_SUFFIX := launchers, \
chegar@1223 181 FILE_PREFIX := Launcher, \
chegar@1223 182 MAKE_SUBDIR := launcher, \
chegar@1223 183 CHECK_MODULES := $(ALL_MODULES), \
chegar@1223 184 USE_WRAPPER := true))
chegar@1120 185
chegar@1120 186 ALL_TARGETS += $(LAUNCHER_TARGETS)
chegar@1120 187
chegar@1120 188 ################################################################################
chegar@1120 189 # Build hotspot target
chegar@1120 190
chegar@1120 191 ifeq ($(BUILD_HOTSPOT),true)
chegar@1120 192 hotspot:
chegar@1120 193 ($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
ohair@492 194 endif
ohair@492 195
chegar@1120 196 ALL_TARGETS += hotspot
ohair@492 197
chegar@1120 198 ################################################################################
chegar@1120 199 # Build demos and samples targets
ohair@492 200
chegar@1120 201 demos:
chegar@1120 202 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
ohair@492 203
chegar@1120 204 samples:
chegar@1120 205 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
erikj@557 206
chegar@1120 207 ALL_TARGETS += demos samples
ohair@492 208
chegar@1120 209 ################################################################################
chegar@1120 210 # Image targets
ohair@492 211
ohair@492 212 # Stores the tips for each repository. This file is be used when constructing the jdk image and can be
ohair@492 213 # used to track the exact sources used to build that image.
chegar@1223 214 source-tips: $(SUPPORT_OUTPUTDIR)/source_tips
chegar@1223 215 $(SUPPORT_OUTPUTDIR)/source_tips: FRC
ohair@492 216 @$(MKDIR) -p $(@D)
ohair@492 217 @$(RM) $@
erikj@745 218 @$(call GetSourceTips)
ohair@492 219
ihse@1317 220 BOOTCYCLE_TARGET := product-images
chegar@1120 221 bootcycle-images:
chegar@1120 222 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
erikj@1411 223 +$(MAKE) $(MAKE_ARGS) -f $(SRC_ROOT)/make/Main.gmk \
erikj@1411 224 SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
chegar@1120 225
chegar@1223 226 zip-security:
chegar@1223 227 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
chegar@1223 228
chegar@1223 229 zip-source:
chegar@1223 230 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
chegar@1223 231
chegar@1223 232 strip-binaries:
chegar@1223 233 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
chegar@1223 234
chegar@1223 235 jrtfs-jar:
chegar@1223 236 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
chegar@1223 237
chegar@1223 238 jimages:
chegar@1223 239 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
chegar@1223 240
chegar@1223 241 profiles:
chegar@1223 242 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
chegar@1223 243
chegar@1223 244 mac-bundles:
chegar@1223 245 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
chegar@1223 246
chegar@1223 247 ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
ihse@1345 248 jrtfs-jar jimages profiles mac-bundles
chegar@1120 249
chegar@1120 250 ################################################################################
chegar@1120 251 # Docs targets
chegar@1120 252
chegar@1120 253 docs-javadoc:
chegar@1120 254 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
chegar@1120 255
chegar@1120 256 docs-jvmtidoc:
chegar@1120 257 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
chegar@1120 258
chegar@1120 259 ALL_TARGETS += docs-javadoc docs-jvmtidoc
chegar@1120 260
chegar@1120 261 ################################################################################
ihse@1345 262 # Build tests
ihse@1345 263 #
chegar@1120 264
ihse@1345 265 prepare-test-image:
ihse@1345 266 $(MKDIR) -p $(TEST_IMAGE_DIR)
ihse@1345 267 $(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
ihse@1345 268
ihse@1345 269 build-test-hotspot-jtreg-native:
ihse@1345 270 +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
ihse@1345 271 build-test-hotspot-jtreg-native)
ihse@1345 272
ihse@1345 273 test-image-hotspot-jtreg-native:
ihse@1345 274 +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
ihse@1345 275 test-image-hotspot-jtreg-native)
ihse@1345 276
ihse@1345 277 build-test-jdk-jtreg-native:
ihse@1345 278 +($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
ihse@1345 279 build-test-jdk-jtreg-native)
ihse@1345 280
ihse@1345 281 test-image-jdk-jtreg-native:
ihse@1345 282 +($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
ihse@1345 283 test-image-jdk-jtreg-native)
ihse@1345 284
ihse@1345 285 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
ihse@1345 286 test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
ihse@1345 287 test-image-jdk-jtreg-native
ihse@1345 288
ihse@1345 289 ################################################################################
ihse@1345 290 # Run tests
ihse@1345 291
ihse@1345 292 # Run tests specified by $(TEST), or the default test set.
chegar@1120 293 test:
ihse@1345 294 $(call RunTests, $(TEST))
ihse@1345 295
ihse@1345 296 test-hotspot-jtreg-native:
ihse@1345 297 $(call RunTests, "hotspot_native_sanity")
ihse@1345 298
ihse@1345 299 test-jdk-jtreg-native:
ihse@1345 300 $(call RunTests, "jdk_native_sanity")
chegar@1120 301
chegar@1120 302 test-make:
chegar@1120 303 ($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
chegar@1120 304
ihse@1345 305 ALL_TARGETS += test test-hotspot-jtreg-native test-jdk-jtreg-native test-make
chegar@1120 306
chegar@1120 307 ################################################################################
chegar@1120 308 # Verification targets
chegar@1120 309
mchung@1147 310 verify-modules:
mchung@1168 311 @$(call TargetEnter)
mchung@1147 312 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
mchung@1168 313 @$(call TargetExit)
chegar@1120 314
mchung@1147 315 ALL_TARGETS += verify-modules
chegar@1120 316
chegar@1120 317 ################################################################################
chegar@1120 318 # Install targets
chegar@1120 319
chegar@1120 320 install:
chegar@1120 321 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
chegar@1120 322
chegar@1120 323 ALL_TARGETS += install
chegar@1120 324
chegar@1120 325 ################################################################################
chegar@1120 326 #
ihse@1236 327 # Dependency declarations between targets.
chegar@1120 328 #
ihse@1236 329 # These are declared in two groups. First all dependencies between targets that
chegar@1120 330 # have recipes above as these dependencies may be disabled. Then the aggregator
chegar@1120 331 # targets that do not have recipes of their own, which will never have their
chegar@1120 332 # dependencies disabled.
chegar@1120 333 #
chegar@1120 334 ################################################################################
chegar@1120 335 # Targets with recipes above
chegar@1120 336
ihse@1236 337 # If running an *-only target, parallel execution and dependencies between
ihse@1236 338 # recipe targets are disabled. This makes it possible to run a select set of
chegar@1120 339 # recipe targets in order. It's the responsibility of the user to make sure
ihse@1236 340 # all prerequisites are fulfilled.
chegar@1120 341 ifneq ($(findstring -only, $(MAKECMDGOALS)), )
chegar@1120 342 .NOTPARALLEL:
chegar@1120 343 else
chegar@1223 344 $(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
chegar@1223 345
chegar@1120 346 interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
chegar@1120 347
chegar@1223 348 buildtools-jdk: interim-langtools
chegar@1120 349
chegar@1120 350 $(CORBA_GENSRC_TARGETS): interim-langtools
chegar@1120 351
chegar@1223 352 $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
chegar@1120 353
chegar@1120 354 interim-corba: $(CORBA_GENSRC_TARGETS)
chegar@1120 355
chegar@1223 356 $(GENDATA_TARGETS): interim-langtools buildtools-jdk
chegar@1120 357
chegar@1120 358 interim-rmic: interim-langtools
chegar@1120 359
chegar@1120 360 $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
chegar@1120 361
chegar@1120 362 import-hotspot: hotspot
chegar@1120 363
chegar@1223 364 $(LIBS_TARGETS): import-hotspot
chegar@1120 365
chegar@1120 366 $(LAUNCHER_TARGETS): java.base-libs
chegar@1120 367
erikj@1130 368 # The demos are currently linking to libjvm and libjava, just like all other
erikj@1130 369 # jdk libs, even though they don't need to. To avoid warnings, make sure they
erikj@1130 370 # aren't built until after libjava and libjvm are available to link to.
chegar@1120 371 demos: $(JAVA_TARGETS)
chegar@1120 372
chegar@1120 373 # Declare dependency from <module>-java to <module>-gensrc
chegar@1120 374 $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
chegar@1120 375
chegar@1120 376 # Declare dependencies between java modules
chegar@1120 377 $(foreach m, $(JAVA_MODULES), \
chegar@1120 378 $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
chegar@1120 379 $(call FindDepsForModule,$m)))))
chegar@1120 380
chegar@1120 381 # Declare dependencies between <module>-rmic to <module>-java
chegar@1120 382 $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
chegar@1120 383
chegar@1120 384 # Declare dependencies from <module>-lib to <module>-java
erikj@1324 385 # Skip modules that do not have java source.
erikj@1324 386 $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
chegar@1120 387
chegar@1120 388 # Declare dependencies from all other <module>-lib to java.base-lib
chegar@1223 389 $(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
chegar@1120 390 $(eval $t: java.base-libs))
ihse@1236 391 # Declare the special case dependency for jdk.deploy.osx where libosx
chegar@1120 392 # links against libosxapp.
chegar@1120 393 jdk.deploy.osx-libs: java.desktop-libs
chegar@1120 394
ihse@1236 395 # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
chegar@1223 396 # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
chegar@1223 397 # virtual target.
chegar@1223 398 jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
chegar@1223 399
chegar@1223 400 # Until the module system is in place, jdk.jdi-gensrc needs to combine service
chegar@1223 401 # loader configuration with jdk.hotspot.agent so is dependent on importing
chegar@1223 402 # hotspot.
chegar@1223 403 jdk.jdi-gensrc-jdk: import-hotspot
chegar@1120 404
erikj@1178 405 # The swing beans need to have java base properly generated to avoid errors
erikj@1178 406 # in javadoc.
chegar@1223 407 java.desktop-gensrc-jdk: java.base-gensrc
erikj@1178 408
chegar@1120 409 # Explicitly add dependencies for special targets
chegar@1120 410 java.base-java: unpack-sec
chegar@1120 411
mchung@1147 412 jdk.dev-gendata: java rmic
mchung@1147 413
chegar@1223 414 zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
chegar@1223 415 $(filter jdk.crypto%, $(JAVA_TARGETS))
chegar@1120 416
chegar@1223 417 zip-source: gensrc rmic
chegar@1120 418
chegar@1223 419 strip-binaries: libs launchers gendata copy
chegar@1120 420
chegar@1223 421 jrtfs-jar: buildtools-jdk
chegar@1120 422
chegar@1223 423 jimages: exploded-image zip-source strip-binaries source-tips demos samples \
chegar@1223 424 jrtfs-jar
chegar@1120 425
chegar@1223 426 profiles: exploded-image strip-binaries source-tips
chegar@1120 427
chegar@1223 428 mac-bundles: jimages
chegar@1120 429
chegar@1223 430 bootcycle-images: jimages
chegar@1120 431
chegar@1223 432 docs-javadoc: gensrc rmic
chegar@1120 433
chegar@1120 434 docs-jvmtidoc: hotspot
chegar@1120 435
ihse@1345 436 test: jimages test-image
chegar@1120 437
mchung@1147 438 verify-modules: exploded-image
chegar@1120 439
erikj@1299 440 test-make: clean-test-make
erikj@1299 441
erikj@1348 442 build-test-hotspot-jtreg-native: buildtools-jdk
erikj@1348 443
erikj@1348 444 build-test-jdk-jtreg-native: buildtools-jdk
erikj@1348 445
ihse@1345 446 test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
ihse@1345 447
ihse@1345 448 test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
ihse@1345 449
chegar@1120 450 endif
chegar@1120 451
chegar@1120 452 ################################################################################
chegar@1120 453 # Virtual targets without recipes
chegar@1120 454
chegar@1223 455 buildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
chegar@1223 456 buildtools-jdk
chegar@1223 457
chegar@1120 458 gensrc: $(GENSRC_TARGETS)
chegar@1120 459
chegar@1120 460 gendata: $(GENDATA_TARGETS)
chegar@1120 461
chegar@1120 462 copy: $(COPY_TARGETS)
chegar@1120 463
chegar@1120 464 java: $(JAVA_TARGETS)
chegar@1120 465
chegar@1120 466 rmic: $(RMIC_TARGETS)
chegar@1120 467
chegar@1223 468 libs: $(LIBS_TARGETS)
chegar@1120 469
chegar@1120 470 launchers: $(LAUNCHER_TARGETS)
chegar@1120 471
chegar@1223 472 # Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
chegar@1223 473 # is actually handled by jdk.jdi-gensrc
chegar@1223 474 jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
chegar@1120 475
chegar@1120 476 # Declare dependencies from <module> to all the individual targets specific
chegar@1120 477 # to that module <module>-*.
chegar@1120 478 $(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
chegar@1120 479 $(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
chegar@1120 480 $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
chegar@1120 481 $(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
chegar@1223 482 $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
chegar@1120 483 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
chegar@1120 484 $(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
chegar@1120 485
chegar@1120 486 ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
chegar@1223 487 $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
chegar@1120 488
ihse@1317 489 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
mchung@1147 490 exploded-image: $(ALL_MODULE_TARGETS)
chegar@1120 491
ihse@1345 492 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
ihse@1317 493 # and in line with this, our targets for creating these are named *-image[s].
ihse@1317 494
ihse@1317 495 # This target builds the product images, e.g. the JRE and JDK image
ihse@1317 496 # (and possibly other, more specific versions)
ihse@1317 497 product-images: jimages demos samples zip-security verify-modules
chegar@1120 498
chegar@1223 499 ifeq ($(OPENJDK_TARGET_OS), macosx)
ihse@1317 500 product-images: mac-bundles
chegar@1223 501 endif
chegar@1120 502
ihse@1317 503 # This target builds the documentation image
ihse@1317 504 docs-image: docs-javadoc docs-jvmtidoc
chegar@1120 505
ihse@1317 506 # This target builds the test image
ihse@1345 507 test-image: prepare-test-image test-image-hotspot-jtreg-native \
ihse@1345 508 test-image-jdk-jtreg-native
ihse@1275 509
ihse@1317 510 # all-images is the top-most target, it builds all our deliverables ("images").
ihse@1317 511 all-images: product-images test-image docs-image
ihse@1317 512
chegar@1223 513 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
ihse@1317 514 jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
ihse@1317 515 product-images docs-image test-image all-images
chegar@1120 516
chegar@1120 517 ################################################################################
chegar@1120 518
ihse@1317 519 # Traditional targets typically run by users.
ihse@1317 520 # These can be considered aliases for the targets now named by a more
ihse@1317 521 # "modern" naming scheme.
chegar@1120 522 default: exploded-image
ihse@1317 523 jdk: exploded-image
ihse@1317 524 images: product-images
ihse@1317 525 docs: docs-image
ihse@1317 526 all: all-images
chegar@1120 527
ihse@1317 528 ALL_TARGETS += default jdk images docs all
chegar@1120 529
chegar@1120 530 ################################################################################
chegar@1120 531 ################################################################################
chegar@1120 532 #
chegar@1120 533 # Clean targets
chegar@1120 534 #
chegar@1120 535 ################################################################################
ihse@1236 536 # Clean targets are automatically run serially by the Makefile calling this
erikj@1156 537 # file.
chegar@1120 538
chegar@1223 539 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
erikj@1372 540 images make-support test-make bundles
chegar@1223 541 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
ihse@1345 542 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
ihse@1345 543 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
erikj@1428 544 CLEAN_PHASES := gensrc java native include docs
chegar@1223 545 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
chegar@1223 546 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
chegar@1223 547 # Construct targets of the form clean-$module-$phase
chegar@1223 548 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
chegar@1223 549 $(addprefix $m-, $(CLEAN_PHASES))))
ohair@492 550
ohair@492 551 # Remove everything, except the output from configure.
chegar@1223 552 clean: $(CLEAN_DIR_TARGETS)
erikj@1428 553 ($(CD) $(OUTPUT_ROOT) && $(RM) -r build*.log*)
chegar@1120 554 $(ECHO) Cleaned all build artifacts.
chegar@1120 555
chegar@1223 556 $(CLEAN_DIR_TARGETS):
chegar@1223 557 $(call CleanDir,$(patsubst clean-%, %, $@))
chegar@1223 558
ihse@1345 559 $(CLEAN_TEST_TARGETS):
ihse@1345 560 $(call CleanTest,$(patsubst clean-test-%, %, $@))
ihse@1345 561
chegar@1223 562 $(CLEAN_PHASE_TARGETS):
chegar@1223 563 $(call Clean-$(patsubst clean-%,%, $@))
chegar@1223 564
chegar@1223 565 $(CLEAN_MODULE_TARGETS):
chegar@1223 566 $(call CleanModule,$(patsubst clean-%, %, $@))
chegar@1223 567
chegar@1223 568 $(CLEAN_MODULE_PHASE_TARGETS):
chegar@1223 569 $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
chegar@1223 570 $(word 2, $(subst -,$(SPACE),$@)))
chegar@1223 571
chegar@1223 572 # When removing the support dir, we must also remove jdk. Building classes has
chegar@1223 573 # the side effect of generating native headers. The headers end up in support
chegar@1223 574 # while classes and touch files end up in jdk.
chegar@1223 575 clean-support: clean-jdk
chegar@1120 576
erikj@1428 577 # Remove everything, including configure configuration. If the output
erikj@1428 578 # directory was created by configure and now becomes empty, remove it as well.
ohair@492 579 dist-clean: clean
erikj@1428 580 ($(CD) $(OUTPUT_ROOT) && \
erikj@1428 581 $(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide)
chegar@1120 582 $(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
ihse@837 583 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
ihse@837 584 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
ihse@837 585 else \
chegar@1120 586 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
chegar@1120 587 && $(RM) -r $(OUTPUT_ROOT)) \
ihse@837 588 fi \
ihse@837 589 )
chegar@1120 590 $(ECHO) Cleaned everything, you will have to re-run configure.
ohair@492 591
ihse@1345 592 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \
ihse@1345 593 $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
chegar@1120 594
chegar@1120 595 ################################################################################
chegar@1120 596 # Declare *-only targets for each normal target
chegar@1120 597 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
chegar@1120 598
ihse@1410 599 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
ihse@1410 600
ihse@1410 601 ################################################################################
ihse@1410 602
ihse@1410 603 # Include JPRT targets
ihse@1410 604 include $(SRC_ROOT)/make/Jprt.gmk
ihse@1410 605
ihse@1410 606 ################################################################################
ihse@1410 607
ihse@1426 608 # The following targets are intentionally not added to ALL_TARGETS since they
ihse@1426 609 # are internal only, to support Init.gmk.
ihse@1426 610
ihse@1410 611 print-targets:
ihse@1410 612 @$(ECHO) $(sort $(ALL_TARGETS))
ihse@1410 613
ihse@1410 614 print-modules:
ihse@1410 615 @$(ECHO) $(sort $(ALL_MODULES))
ihse@1410 616
ihse@1426 617 create-main-targets-include:
ihse@1426 618 @$(ECHO) $(LOG_INFO) Generating main target list
ihse@1426 619 @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
ihse@1426 620 $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
chegar@1120 621
chegar@1120 622 ################################################################################
chegar@1120 623
chegar@1120 624 .PHONY: $(ALL_TARGETS)
chegar@1120 625
ohair@492 626 FRC: # Force target