Main.gmk revision 1130:dbb964d72f25
13062Sjlahoda# 23464Srfield# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 33062Sjlahoda# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43062Sjlahoda# 53062Sjlahoda# This code is free software; you can redistribute it and/or modify it 63062Sjlahoda# under the terms of the GNU General Public License version 2 only, as 73062Sjlahoda# published by the Free Software Foundation. Oracle designates this 83062Sjlahoda# particular file as subject to the "Classpath" exception as provided 93062Sjlahoda# by Oracle in the LICENSE file that accompanied this code. 103062Sjlahoda# 113062Sjlahoda# This code is distributed in the hope that it will be useful, but WITHOUT 123062Sjlahoda# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 133062Sjlahoda# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 143062Sjlahoda# version 2 for more details (a copy is included in the LICENSE file that 153062Sjlahoda# accompanied this code). 163062Sjlahoda# 173062Sjlahoda# You should have received a copy of the GNU General Public License version 183062Sjlahoda# 2 along with this work; if not, write to the Free Software Foundation, 193062Sjlahoda# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 203062Sjlahoda# 213062Sjlahoda# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 223062Sjlahoda# or visit www.oracle.com if you need additional information or have any 233062Sjlahoda# questions. 243062Sjlahoda# 253062Sjlahoda 263464Srfield################################################################################ 273062Sjlahoda# This is the main makefile containing most actual top level targets. It needs 283062Sjlahoda# to be called with a SPEC file defined. 293062Sjlahoda 303062Sjlahoda# Declare default target 313062Sjlahodadefault: 323062Sjlahoda 333062Sjlahoda# Now load the spec 343062Sjlahodainclude $(SPEC) 353062Sjlahoda 363464Srfieldinclude $(SRC_ROOT)/make/MakeHelpers.gmk 373464Srfield 383464Srfield# Load the vital tools for all the makefiles. 393464Srfieldinclude $(SRC_ROOT)/make/common/MakeBase.gmk 403062Sjlahoda 413062Sjlahoda# Load common profile names definitions 423062Sjlahodainclude $(JDK_TOPDIR)/make/ProfileNames.gmk 433464Srfield 443062Sjlahoda# Declare ALL_TARGETS as an immediate variable. This variable is a list of all 453062Sjlahoda# valid top level targets. It's used to declare them all as PHONY and to 463062Sjlahoda# generate the -only targets. 473062SjlahodaALL_TARGETS := 483062Sjlahoda 493062Sjlahoda# Hook to include the corresponding custom file, if present. 503062Sjlahoda$(eval $(call IncludeCustomExtension, , Main.gmk)) 513062Sjlahoda 523062Sjlahoda# All modules for the current target platform. 533062Sjlahoda# Manually add jdk.hotspot.agent for now. 543062SjlahodaALL_MODULES := $(call FindAllModules) jdk.hotspot.agent 553062Sjlahoda 563062Sjlahoda################################################################################ 573062Sjlahoda################################################################################ 583062Sjlahoda# 593062Sjlahoda# Recipes for all targets. Only recipes, dependencies are declared later. 603062Sjlahoda# 613062Sjlahoda################################################################################ 623062Sjlahoda 633062Sjlahoda################################################################################ 643062Sjlahoda# Interim/build tools targets, compiling tools used during the build 653062Sjlahoda 663062Sjlahodainterim-langtools: 673062Sjlahoda +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk) 683062Sjlahoda 693062Sjlahodainterim-corba: 703062Sjlahoda +($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk) 713062Sjlahoda 723062Sjlahodainterim-rmic: 733062Sjlahoda +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk) 743062Sjlahoda 753062Sjlahodabuild-tools-jdk: 763062Sjlahoda +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools) 773062Sjlahoda 783062SjlahodaALL_TARGETS += interim-langtools interim-corba build-tools-jdk 793062Sjlahoda 803062Sjlahoda################################################################################ 813062Sjlahoda# Special targets for certain modules 823062Sjlahoda 833062Sjlahodaimport-hotspot: 843062Sjlahoda +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk) 853062Sjlahoda 863062Sjlahodaunpack-sec: 873062Sjlahoda +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk) 883062Sjlahoda 893062Sjlahodapolicy-jars: 903062Sjlahoda +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk) 913062Sjlahoda 923062SjlahodaALL_TARGETS += import-hotspot unpack-sec policy-jars 933062Sjlahoda 943062Sjlahoda################################################################################ 953062Sjlahoda# Gensrc targets, generating source before java compilation can be done 963062SjlahodaJDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc) 973062SjlahodaLANGTOOLS_GENSRC_MODULES := jdk.compiler.tools 983062SjlahodaCORBA_GENSRC_MODULES := java.corba 993062SjlahodaGENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \ 1003062Sjlahoda $(CORBA_GENSRC_MODULES) 1013062SjlahodaJDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES)) 1023062SjlahodaLANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES)) 1033062SjlahodaCORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES)) 1043062SjlahodaGENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES)) 1053062Sjlahoda 1063062Sjlahodajdk.compiler.tools-gensrc: 1073062Sjlahoda +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk) 1083062Sjlahoda 1093062Sjlahodajava.corba-gensrc: 1103062Sjlahoda +($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk) 1113062Sjlahoda 1123062Sjlahoda# Declare recipes for all jdk <module>-gensrc targets 1133062Sjlahoda$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 1143062Sjlahoda $m, gensrc, gensrc, Gensrc))) 1153062Sjlahoda 1163062SjlahodaALL_TARGETS += $(GENSRC_TARGETS) 1173062Sjlahoda 1183062Sjlahoda################################################################################ 1193062Sjlahoda# Generate data targets 1203062SjlahodaGENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata) 1213062SjlahodaGENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES)) 1223062Sjlahoda 1233062Sjlahoda# Declare recipes for all <module>-gendata targets 1243062Sjlahoda$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 1253062Sjlahoda $m, gendata, gendata, Gendata))) 1263062Sjlahoda 1273062Sjlahoda$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m))) 1283062Sjlahoda 1293062SjlahodaALL_TARGETS += $(GENDATA_TARGETS) 1303062Sjlahoda 1313062Sjlahoda################################################################################ 1323062Sjlahoda# Copy files targets 1333062SjlahodaCOPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy) 1343062SjlahodaCOPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES)) 1353062Sjlahoda 1363062Sjlahoda# Declare recipes for all <module>-copy targets 1373062Sjlahoda$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 1383062Sjlahoda $m, copy, copy, Copy))) 1393062Sjlahoda 1403062SjlahodaALL_TARGETS += $(COPY_TARGETS) 1413062Sjlahoda 1423062Sjlahoda################################################################################ 1433062Sjlahoda# Targets for compiling all java modules. Nashorn is treated separately. 1443062SjlahodaJAVA_MODULES := $(call FindJavaModules) 1453062SjlahodaJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES)) 1463062Sjlahoda 1473062Sjlahodadefine DeclareCompileJavaRecipe 1483062Sjlahoda $1-java: 1493062Sjlahoda +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \ 1503062Sjlahoda $1 JAVA_MODULES=$1) 1513357Srfieldendef 1523062Sjlahoda 1533062Sjlahoda$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \ 1543062Sjlahoda $(eval $(call DeclareCompileJavaRecipe,$m))) 1553062Sjlahoda 1563464Srfield# Build nashorn. Needs to be compiled separately from the rest of the modules 1573464Srfield# due to nasgen. 1583464Srfieldjdk.scripting.nashorn-java: 1593464Srfield +($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile) 1603464Srfield 1613464SrfieldALL_TARGETS += $(JAVA_TARGETS) 1623464Srfield 1633464Srfield################################################################################ 1643464Srfield# Targets for running rmic. 1653464SrfieldRMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic) 1663464SrfieldRMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES)) 1673464Srfield 1683464Srfield# Declare recipes for all <module>-rmic targets 1693464Srfield$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 1703464Srfield $m, rmic, rmic, Rmic))) 1713464Srfield 1723464SrfieldALL_TARGETS += $(RMIC_TARGETS) 1733464Srfield 1743464Srfield################################################################################ 1753464Srfield# Targets for compiling native libraries 1763464SrfieldALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib) 1773464SrfieldLIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES)) 1783464SrfieldLIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES)) 1793062Sjlahoda 180# Declare recipes for all <module>-libs targets 181$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 182 $m, libs, lib, Lib))) 183 184ALL_TARGETS += $(LIB_TARGETS) 185 186################################################################################ 187# Targets for compiling native executables 188ALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher) 189LAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES)) 190LAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES)) 191 192# Declare recipes for all <module>-launchers targets 193$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \ 194 $m, launchers, launcher, Launcher))) 195 196ALL_TARGETS += $(LAUNCHER_TARGETS) 197 198################################################################################ 199# Build hotspot target 200 201ifeq ($(BUILD_HOTSPOT),true) 202 hotspot: 203 ($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) 204endif 205 206ALL_TARGETS += hotspot 207 208################################################################################ 209# Build demos and samples targets 210 211demos: 212 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk) 213 214samples: 215 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk) 216 217ALL_TARGETS += demos samples 218 219################################################################################ 220# Image targets 221 222# Stores the tips for each repository. This file is be used when constructing the jdk image and can be 223# used to track the exact sources used to build that image. 224source-tips: $(OUTPUT_ROOT)/source_tips 225$(OUTPUT_ROOT)/source_tips: FRC 226 @$(MKDIR) -p $(@D) 227 @$(RM) $@ 228 @$(call GetSourceTips) 229 230security-jars: 231 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk) 232 233nashorn-jar: 234 +($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all) 235 236# Creates the jar files (rt.jar resources.jar etc) 237main-jars: 238 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk) 239 240# Creates the images (j2sdk-image j2re-image etc) 241images: 242 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk) 243 ifeq ($(OPENJDK_TARGET_OS), macosx) 244 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk) 245 endif 246 247# Create Compact Profile jars 248PROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES)) 249$(PROFILE_JARS_TARGETS): 250 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk) 251 252# Create Compact Profile images 253PROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES)) 254$(PROFILE_IMAGES_TARGETS): 255 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \ 256 JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \ 257 -f Images.gmk profile-image) 258 259profiles-oscheck: 260 ifneq ($(OPENJDK_TARGET_OS), linux) 261 @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 262 endif 263 264bootcycle-images: 265 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image 266 +$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images 267 268ALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \ 269 $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \ 270 bootcycle-images 271 272################################################################################ 273# Docs targets 274 275docs-javadoc: 276 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) 277 278docs-jvmtidoc: 279 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs) 280 281ALL_TARGETS += docs-javadoc docs-jvmtidoc 282 283################################################################################ 284# Test target 285 286test: 287 ($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \ 288 JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \ 289 ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true 290 291test-make: 292 ($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET)) 293 294ALL_TARGETS += test test-make 295 296################################################################################ 297# Verification targets 298 299# generate modules.xml in the exploded image 300modules-xml: 301 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk gen-modules-xml) 302 303verify-modules: 304 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk checkdeps) 305 306ALL_TARGETS += modules-xml verify-modules 307 308################################################################################ 309# Install targets 310 311install: 312 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk) 313 314ALL_TARGETS += install 315 316################################################################################ 317# 318# Dependency declarations between targets. 319# 320# These are declared in two groups. First all dependencies between targets that 321# have recipes above as these dependencies may be disabled. Then the aggregator 322# targets that do not have recipes of their own, which will never have their 323# dependencies disabled. 324# 325################################################################################ 326# Targets with recipes above 327 328# If running an *-only target, parallel execution and dependencies between 329# recipe targets are disabled. This makes it possible to run a select set of 330# recipe targets in order. It's the responsibility of the user to make sure 331# all prerequisites are fulfilled. 332ifneq ($(findstring -only, $(MAKECMDGOALS)), ) 333 .NOTPARALLEL: 334else 335 interim-langtools: $(LANGTOOLS_GENSRC_TARGETS) 336 337 build-tools-jdk: interim-langtools 338 339 $(CORBA_GENSRC_TARGETS): interim-langtools 340 341 $(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk 342 343 interim-corba: $(CORBA_GENSRC_TARGETS) 344 345 $(GENDATA_TARGETS): interim-langtools build-tools-jdk 346 347 interim-rmic: interim-langtools 348 349 $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic 350 351 import-hotspot: hotspot 352 353 $(LIB_TARGETS): import-hotspot 354 355 $(LAUNCHER_TARGETS): java.base-libs 356 357 # The demos are currently linking to libjvm and libjava, just like all other 358 # jdk libs, even though they don't need to. To avoid warnings, make sure they 359 # aren't built until after libjava and libjvm are available to link to. 360 demos: $(JAVA_TARGETS) 361 362 # Declare dependency from <module>-java to <module>-gensrc 363 $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc)) 364 365 # Declare dependencies between java modules 366 $(foreach m, $(JAVA_MODULES), \ 367 $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \ 368 $(call FindDepsForModule,$m))))) 369 370 # Declare dependencies between <module>-rmic to <module>-java 371 $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java)) 372 373 # Declare dependencies from <module>-lib to <module>-java 374 # Skip jdk.jdwp.agent as it contains no java code. 375 $(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java)) 376 377 # Declare dependencies from all other <module>-lib to java.base-lib 378 $(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \ 379 $(eval $t: java.base-libs)) 380 # Declare the special case dependency for jdk.deploy.osx where libosx 381 # links against libosxapp. 382 jdk.deploy.osx-libs: java.desktop-libs 383 384 # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 385 # header file used by jdk.jdwp libs. 386 jdk.jdwp.agent-libs: jdk.jdi-gensrc 387 388 # Explicitly add dependencies for special targets 389 java.base-java: unpack-sec 390 391 security-jars: java 392 393 nashorn-jar: jdk.scripting.nashorn-java 394 395 main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot gendata 396 397 # On windows, the jars target needs to wait for jgss libs to be built. 398 # Should ideally split out the sec-bin zip file generation to avoid 399 # this dependency. 400 ifeq ($(OPENJDK_TARGET_OS), windows) 401 main-jars: java.security.jgss-libs 402 endif 403 404 images: jars demos samples exploded-image source-tips 405 406 bootcycle-images: images 407 408 # Need to depend on jars as otherwise there will a race between all the 409 # invocations of CreateJars.gmk. 410 $(PROFILE_JARS_TARGETS): jars profiles-oscheck 411 412 $(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips 413 414 # Declare dependencies from <profile>-images to <profile>-jars 415 $(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars)) 416 417 docs-javadoc: $(GENSRC_TARGETS) rmic 418 419 docs-jvmtidoc: hotspot 420 421 test: exploded-image 422 423 modules-xml: build-tools-jdk java 424 425 verify-modules: exploded-image modules-xml 426 427endif 428 429################################################################################ 430# Virtual targets without recipes 431 432gensrc: $(GENSRC_TARGETS) 433 434gendata: $(GENDATA_TARGETS) 435 436copy: $(COPY_TARGETS) 437 438java: $(JAVA_TARGETS) 439 440rmic: $(RMIC_TARGETS) 441 442libs: $(LIB_TARGETS) 443 444launchers: $(LAUNCHER_TARGETS) 445 446# Explicitly add dependencies for these special targets 447java.base: import-hotspot policy-jars 448 449# Declare dependencies from <module> to all the individual targets specific 450# to that module <module>-*. 451$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc)) 452$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java)) 453$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata)) 454$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic)) 455$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs)) 456$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers)) 457$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy)) 458 459ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \ 460 $(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES)) 461 462exploded-image: $(ALL_MODULE_TARGETS) modules-xml 463 464jars: main-jars nashorn-jar security-jars policy-jars 465 466# Make each profile name a target that depends on it's images target. 467$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars)) 468 469profiles: $(ALL_PROFILES) 470 471docs: docs-javadoc docs-jvmtidoc 472 473ALL_TARGETS += gensrc gendata copy java rmic libs launchers \ 474 $(ALL_MODULE_TARGETS) exploded-image jars \ 475 $(ALL_PROFILES) profiles docs 476 477################################################################################ 478 479all: images docs verify-modules 480default: exploded-image 481 482ALL_TARGETS += default all 483 484################################################################################ 485################################################################################ 486# 487# Clean targets 488# 489################################################################################ 490 491# If running a clean target, disable parallel execution 492ifneq ($(findstring clean, $(MAKECMDGOALS)), ) 493 .NOTPARALLEL: 494endif 495 496CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \ 497 bootcycle-build docs docstemp test 498CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS)) 499 500# Remove everything, except the output from configure. 501clean: $(CLEAN_TARGETS) 502 ($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*) 503 $(ECHO) Cleaned all build artifacts. 504 505$(CLEAN_TARGETS): 506 $(call CleanComponent,$(patsubst clean-%, %, $@)) 507 508clean-docs: clean-docstemp 509 510# Remove everything, including configure configuration. 511# If the output directory was created by configure and now becomes empty, remove it as well. 512dist-clean: clean 513 ($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \ 514 Makefile compare.sh spec.sh tmp javacservers) 515 $(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ 516 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ 517 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \ 518 else \ 519 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \ 520 && $(RM) -r $(OUTPUT_ROOT)) \ 521 fi \ 522 ) 523 $(ECHO) Cleaned everything, you will have to re-run configure. 524 525ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS) 526 527################################################################################ 528 529# Setup a rule for SPEC file that fails if executed. This check makes sure the 530# configuration is up to date after changes to configure. 531ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), ) 532 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) 533 @$(ECHO) "ERROR: $(SPEC) is not up to date." 534 @$(ECHO) "Please rerun configure! Easiest way to do this is by running" 535 @$(ECHO) "'make reconfigure'." 536 @$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true" 537 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi 538endif 539 540reconfigure: 541 ifneq ($(CONFIGURE_COMMAND_LINE), ) 542 @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'" 543 else 544 @$(ECHO) "Re-running configure using default settings" 545 endif 546 @( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) 547 548ALL_TARGETS += reconfigure 549 550################################################################################ 551# Declare *-only targets for each normal target 552$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t))) 553 554ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS)) 555 556################################################################################ 557 558.PHONY: $(ALL_TARGETS) 559 560include $(SRC_ROOT)/make/Jprt.gmk 561 562FRC: # Force target 563