make/Main.gmk

Mon, 14 Sep 2020 16:42:03 +0100

author
andrew
date
Mon, 14 Sep 2020 16:42:03 +0100
changeset 2554
7f60c2d9823e
parent 2542
741aff26fe61
child 2556
76a0f827e163
permissions
-rw-r--r--

Added tag jdk8u272-b08 for changeset 34c6baf21464

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

mercurial