annotate make/Main.gmk @ 22672:f0e17ad8d730

Added tag jdk9-b02 for changeset 851ae056cca1
author katleman
date Thu, 06 Feb 2014 13:08:54 -0800
parents e24e22311718
children a752920c4317
rev   line source
ohair@14111 1 #
ksrini@20047 2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
ohair@14111 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@14111 4 #
ohair@14111 5 # This code is free software; you can redistribute it and/or modify it
ohair@14111 6 # under the terms of the GNU General Public License version 2 only, as
ohair@14111 7 # published by the Free Software Foundation. Oracle designates this
ohair@14111 8 # particular file as subject to the "Classpath" exception as provided
ohair@14111 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@14111 10 #
ohair@14111 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@14111 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@14111 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@14111 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@14111 15 # accompanied this code).
ohair@14111 16 #
ohair@14111 17 # You should have received a copy of the GNU General Public License version
ohair@14111 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@14111 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@14111 20 #
ohair@14111 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@14111 22 # or visit www.oracle.com if you need additional information or have any
ohair@14111 23 # questions.
ohair@14111 24 #
ohair@14111 25
ohair@14111 26 ### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
ohair@14111 27
ohair@14111 28 # Now load the spec
ohair@14111 29 include $(SPEC)
ohair@14111 30
ihse@20363 31 # Load the vital tools for all the makefiles.
ihse@21759 32 include $(SRC_ROOT)/make/common/MakeBase.gmk
ohair@14111 33
ohair@14111 34 # Include the corresponding custom file, if present.
ohair@14111 35 -include $(CUSTOM_MAKE_DIR)/Main.gmk
ohair@14111 36
ohair@14111 37 ### Clean up from previous run
ohair@14111 38
ohair@14111 39 # Remove any build.log from a previous run, if they exist
ohair@14111 40 ifneq (,$(BUILD_LOG))
ihse@20363 41 ifneq (,$(BUILD_LOG_PREVIOUS))
ihse@20363 42 # Rotate old log
ihse@20363 43 $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
ihse@20363 44 $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
ihse@20363 45 else
ihse@20363 46 $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
ihse@20363 47 endif
ihse@20363 48 $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
ohair@14111 49 endif
ohair@14111 50 # Remove any javac server logs and port files. This
ohair@14111 51 # prevents a new make run to reuse the previous servers.
ohair@14111 52 ifneq (,$(SJAVAC_SERVER_DIR))
ihse@20363 53 $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
ohair@14111 54 endif
ohair@14111 55
ohair@14111 56 # Reset the build timers.
ohair@14111 57 $(eval $(call ResetAllTimers))
ohair@14111 58
ohair@14111 59 # Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
ohair@14111 60 # hence this workaround.
ohair@14111 61 MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
ohair@14111 62
ohair@14111 63 ### Main targets
ohair@14111 64
erikj@15053 65 default: jdk
erikj@15053 66 @$(call CheckIfMakeAtEnd)
erikj@15053 67
erikj@15053 68 all: images docs
erikj@15053 69 @$(call CheckIfMakeAtEnd)
ohair@14111 70
erikj@15395 71 # Setup a rule for SPEC file that fails if executed. This check makes sure the configuration
erikj@15395 72 # is up to date after changes to configure
erikj@15395 73 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
erikj@15395 74 @$(ECHO) ERROR: $(SPEC) is not up to date
erikj@15395 75 @$(ECHO) Please rerun configure!
erikj@15395 76 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
erikj@15395 77
erikj@15395 78 start-make: $(SPEC)
ohair@14111 79 @$(call AtMakeStart)
ohair@14111 80
ohair@14111 81 langtools: langtools-only
ohair@14111 82 langtools-only: start-make
ohair@14111 83 @$(call TargetEnter)
ihse@21759 84 @($(CD) $(LANGTOOLS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk)
ohair@14111 85 @$(call TargetExit)
ohair@14111 86
ohair@14111 87 corba: langtools corba-only
ohair@14111 88 corba-only: start-make
ohair@14111 89 @$(call TargetEnter)
ihse@21759 90 @($(CD) $(CORBA_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk)
ohair@14111 91 @$(call TargetExit)
ohair@14111 92
ohair@14111 93 jaxp: langtools jaxp-only
ohair@14111 94 jaxp-only: start-make
ohair@14111 95 @$(call TargetEnter)
ihse@21759 96 @($(CD) $(JAXP_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk)
ohair@14111 97 @$(call TargetExit)
ohair@14111 98
ohair@14111 99 jaxws: langtools jaxp jaxws-only
ohair@14111 100 jaxws-only: start-make
ohair@14111 101 @$(call TargetEnter)
ihse@21759 102 @($(CD) $(JAXWS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk)
ohair@14111 103 @$(call TargetExit)
ohair@14111 104
tbell@14378 105 ifeq ($(BUILD_HOTSPOT),true)
ihse@20363 106 hotspot: hotspot-only
ihse@20363 107 hotspot-only: start-make
ohair@14111 108 @$(call TargetEnter)
ihse@21759 109 @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
ohair@14111 110 @$(call TargetExit)
tbell@14378 111 endif
ohair@14111 112
ohair@14111 113 jdk: langtools hotspot corba jaxp jaxws jdk-only
ohair@14111 114 jdk-only: start-make
ohair@14111 115 @$(call TargetEnter)
ihse@21759 116 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
ohair@14111 117 @$(call TargetExit)
ohair@14111 118
jjg@15903 119 nashorn: jdk nashorn-only
jjg@15903 120 nashorn-only: start-make
jjg@15903 121 @$(call TargetEnter)
ihse@21759 122 @($(CD) $(NASHORN_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
jjg@15903 123 @$(call TargetExit)
jjg@15903 124
ohair@14111 125 demos: jdk demos-only
ohair@14111 126 demos-only: start-make
ohair@14111 127 @$(call TargetEnter)
ihse@21759 128 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
ohair@14111 129 @$(call TargetExit)
ohair@14111 130
dholmes@15584 131 # Note: This double-colon rule is intentional, to support
dholmes@15584 132 # custom make file integration.
jjg@15903 133 images:: source-tips demos nashorn images-only
ohair@14111 134 images-only: start-make
ohair@14111 135 @$(call TargetEnter)
ihse@21759 136 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
ohair@14111 137 @$(call TargetExit)
ohair@14111 138
ohair@14111 139 overlay-images: source-tips demos overlay-images-only
ohair@14111 140 overlay-images-only: start-make
ohair@14111 141 @$(call TargetEnter)
ihse@21759 142 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
ohair@14111 143 @$(call TargetExit)
ohair@14111 144
dholmes@15584 145 profiles: profiles-oscheck source-tips jdk hotspot profiles-only
dholmes@15584 146 profiles-only: start-make
dholmes@15584 147 @$(call TargetEnter)
ihse@21759 148 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
dholmes@15584 149 @$(call TargetExit)
dholmes@15584 150
dholmes@15584 151 profiles-oscheck:
ihse@20363 152 ifneq ($(OPENJDK_TARGET_OS), linux)
ihse@20363 153 @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
ihse@20363 154 endif
dholmes@15584 155
ohair@14111 156 install: images install-only
ohair@14111 157 install-only: start-make
ohair@14111 158 @$(call TargetEnter)
ihse@21759 159 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install)
ohair@14111 160 @$(call TargetExit)
ohair@14111 161
ohair@14111 162 docs: jdk docs-only
ohair@14111 163 docs-only: start-make
ohair@14111 164 @$(call TargetEnter)
ihse@21759 165 @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
ohair@14111 166 @$(call TargetExit)
ohair@14111 167
erikj@15057 168 sign-jars: jdk sign-jars-only
erikj@15057 169 sign-jars-only: start-make
erikj@15057 170 @$(call TargetEnter)
ihse@21759 171 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars)
erikj@15057 172 @$(call TargetExit)
erikj@15057 173
erikj@16578 174 bootcycle-images: images bootcycle-images-only
erikj@16578 175 bootcycle-images-only: start-make
ohair@14111 176 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
ihse@21759 177 @($(CD) $(SRC_ROOT) && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
ohair@14111 178
mduigou@15910 179 test: images test-only
mduigou@15910 180 test-only: start-make
ohair@14111 181 @$(call TargetEnter)
mduigou@19520 182 @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
ohair@14111 183 @$(call TargetExit)
ohair@14111 184
ohair@14111 185 # Stores the tips for each repository. This file is be used when constructing the jdk image and can be
ohair@14111 186 # used to track the exact sources used to build that image.
ohair@14111 187 source-tips: $(OUTPUT_ROOT)/source_tips
ohair@14111 188 $(OUTPUT_ROOT)/source_tips: FRC
ohair@14111 189 @$(MKDIR) -p $(@D)
ohair@14111 190 @$(RM) $@
erikj@18052 191 @$(call GetSourceTips)
ohair@14111 192
ohair@14111 193
ohair@14111 194 # Remove everything, except the output from configure.
mduigou@16653 195 clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs clean-test
ohair@14111 196 @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
ohair@14111 197 @$(ECHO) Cleaned all build artifacts.
ohair@14111 198
ohair@14111 199 # Remove everything, including configure configuration.
ohair@14111 200 # If the output directory was created by configure and now becomes empty, remove it as well.
ohair@14111 201 # FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh!
ohair@14111 202 dist-clean: clean
igerasim@19261 203 @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers)
ohair@14111 204 @$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
ihse@20363 205 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
ihse@20363 206 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
ihse@20363 207 else \
ihse@20363 208 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \
ihse@20363 209 fi \
ihse@20363 210 )
ohair@14111 211 @$(ECHO) Cleaned everything, you will have to re-run configure.
ohair@14111 212
ohair@14111 213 clean-langtools:
ohair@14111 214 $(call CleanComponent,langtools)
ohair@14111 215 clean-corba:
ohair@14111 216 $(call CleanComponent,corba)
ohair@14111 217 clean-jaxp:
ohair@14111 218 $(call CleanComponent,jaxp)
ohair@14111 219 clean-jaxws:
ohair@14111 220 $(call CleanComponent,jaxws)
ohair@14111 221 clean-hotspot:
ohair@14111 222 $(call CleanComponent,hotspot)
ohair@14111 223 clean-jdk:
ohair@14111 224 $(call CleanComponent,jdk)
jjg@15903 225 clean-nashorn:
jjg@15903 226 $(call CleanComponent,nashorn)
ohair@14111 227 clean-images:
ohair@14111 228 $(call CleanComponent,images)
ohair@14111 229 clean-overlay-images:
ohair@14111 230 $(call CleanComponent,overlay-images)
ohair@14111 231 clean-bootcycle-build:
ohair@14111 232 $(call CleanComponent,bootcycle-build)
erikj@14466 233 clean-docs:
erikj@14466 234 $(call CleanComponent,docs)
erikj@14466 235 $(call CleanComponent,docstemp)
mduigou@16653 236 clean-test:
mduigou@16653 237 $(call CleanComponent,testoutput)
ohair@14111 238
mduigou@17349 239 .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs
mduigou@17349 240 .PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only
ihse@19527 241 .PHONY: default all clean dist-clean bootcycle-images start-make
mduigou@17349 242 .PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build
dholmes@15584 243 .PHONY: profiles profiles-only profiles-oscheck
ohair@14111 244
erikj@22031 245 include $(root_dir)/make/Jprt.gmk
erikj@22031 246
ohair@14111 247 FRC: # Force target