annotate make/Main.gmk @ 933:c3c75eda6606

8029797: Let jprt run configure when building Reviewed-by: tbell
author erikj
date Tue, 17 Dec 2013 11:09:26 +0100
parents a667caba1e84
children
rev   line source
ohair@492 1 #
ksrini@811 2 # Copyright (c) 2011, 2013, 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
ohair@492 26 ### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
ohair@492 27
ohair@492 28 # Now load the spec
ohair@492 29 include $(SPEC)
ohair@492 30
ihse@844 31 # Load the vital tools for all the makefiles.
ihse@919 32 include $(SRC_ROOT)/make/common/MakeBase.gmk
ohair@492 33
ohair@492 34 # Include the corresponding custom file, if present.
ohair@492 35 -include $(CUSTOM_MAKE_DIR)/Main.gmk
ohair@492 36
ohair@492 37 ### Clean up from previous run
ohair@492 38
ohair@492 39 # Remove any build.log from a previous run, if they exist
ohair@492 40 ifneq (,$(BUILD_LOG))
ihse@844 41 ifneq (,$(BUILD_LOG_PREVIOUS))
ihse@844 42 # Rotate old log
ihse@844 43 $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
ihse@844 44 $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
ihse@844 45 else
ihse@844 46 $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
ihse@844 47 endif
ihse@844 48 $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
ohair@492 49 endif
ohair@492 50 # Remove any javac server logs and port files. This
ohair@492 51 # prevents a new make run to reuse the previous servers.
ohair@492 52 ifneq (,$(SJAVAC_SERVER_DIR))
ihse@844 53 $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
ohair@492 54 endif
ohair@492 55
ohair@492 56 # Reset the build timers.
ohair@492 57 $(eval $(call ResetAllTimers))
ohair@492 58
ohair@492 59 # Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
ohair@492 60 # hence this workaround.
ohair@492 61 MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
ohair@492 62
ohair@492 63 ### Main targets
ohair@492 64
erikj@557 65 default: jdk
erikj@557 66 @$(call CheckIfMakeAtEnd)
erikj@557 67
erikj@557 68 all: images docs
erikj@557 69 @$(call CheckIfMakeAtEnd)
ohair@492 70
erikj@607 71 # Setup a rule for SPEC file that fails if executed. This check makes sure the configuration
erikj@607 72 # is up to date after changes to configure
erikj@607 73 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
erikj@607 74 @$(ECHO) ERROR: $(SPEC) is not up to date
erikj@607 75 @$(ECHO) Please rerun configure!
erikj@607 76 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
erikj@607 77
erikj@607 78 start-make: $(SPEC)
ohair@492 79 @$(call AtMakeStart)
ohair@492 80
ohair@492 81 langtools: langtools-only
ohair@492 82 langtools-only: start-make
ohair@492 83 @$(call TargetEnter)
ihse@919 84 @($(CD) $(LANGTOOLS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk)
ohair@492 85 @$(call TargetExit)
ohair@492 86
ohair@492 87 corba: langtools corba-only
ohair@492 88 corba-only: start-make
ohair@492 89 @$(call TargetEnter)
ihse@919 90 @($(CD) $(CORBA_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk)
ohair@492 91 @$(call TargetExit)
ohair@492 92
ohair@492 93 jaxp: langtools jaxp-only
ohair@492 94 jaxp-only: start-make
ohair@492 95 @$(call TargetEnter)
ihse@919 96 @($(CD) $(JAXP_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk)
ohair@492 97 @$(call TargetExit)
ohair@492 98
ohair@492 99 jaxws: langtools jaxp jaxws-only
ohair@492 100 jaxws-only: start-make
ohair@492 101 @$(call TargetEnter)
ihse@919 102 @($(CD) $(JAXWS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk)
ohair@492 103 @$(call TargetExit)
ohair@492 104
tbell@504 105 ifeq ($(BUILD_HOTSPOT),true)
ihse@844 106 hotspot: hotspot-only
ihse@844 107 hotspot-only: start-make
ohair@492 108 @$(call TargetEnter)
ihse@919 109 @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
ohair@492 110 @$(call TargetExit)
tbell@504 111 endif
ohair@492 112
ohair@492 113 jdk: langtools hotspot corba jaxp jaxws jdk-only
ohair@492 114 jdk-only: start-make
ohair@492 115 @$(call TargetEnter)
ihse@919 116 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
ohair@492 117 @$(call TargetExit)
ohair@492 118
jjg@643 119 nashorn: jdk nashorn-only
jjg@643 120 nashorn-only: start-make
jjg@643 121 @$(call TargetEnter)
ihse@919 122 @($(CD) $(NASHORN_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
jjg@643 123 @$(call TargetExit)
jjg@643 124
ohair@492 125 demos: jdk demos-only
ohair@492 126 demos-only: start-make
ohair@492 127 @$(call TargetEnter)
ihse@919 128 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
ohair@492 129 @$(call TargetExit)
ohair@492 130
dholmes@622 131 # Note: This double-colon rule is intentional, to support
dholmes@622 132 # custom make file integration.
jjg@643 133 images:: source-tips demos nashorn images-only
ohair@492 134 images-only: start-make
ohair@492 135 @$(call TargetEnter)
ihse@919 136 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
ohair@492 137 @$(call TargetExit)
ohair@492 138
ohair@492 139 overlay-images: source-tips demos overlay-images-only
ohair@492 140 overlay-images-only: start-make
ohair@492 141 @$(call TargetEnter)
ihse@919 142 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
ohair@492 143 @$(call TargetExit)
ohair@492 144
dholmes@622 145 profiles: profiles-oscheck source-tips jdk hotspot profiles-only
dholmes@622 146 profiles-only: start-make
dholmes@622 147 @$(call TargetEnter)
ihse@919 148 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
dholmes@622 149 @$(call TargetExit)
dholmes@622 150
dholmes@622 151 profiles-oscheck:
ihse@844 152 ifneq ($(OPENJDK_TARGET_OS), linux)
ihse@844 153 @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
ihse@844 154 endif
dholmes@622 155
ohair@492 156 install: images install-only
ohair@492 157 install-only: start-make
ohair@492 158 @$(call TargetEnter)
ihse@919 159 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install)
ohair@492 160 @$(call TargetExit)
ohair@492 161
ohair@492 162 docs: jdk docs-only
ohair@492 163 docs-only: start-make
ohair@492 164 @$(call TargetEnter)
ihse@919 165 @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
ohair@492 166 @$(call TargetExit)
ohair@492 167
erikj@561 168 sign-jars: jdk sign-jars-only
erikj@561 169 sign-jars-only: start-make
erikj@561 170 @$(call TargetEnter)
ihse@919 171 @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars)
erikj@561 172 @$(call TargetExit)
erikj@561 173
erikj@666 174 bootcycle-images: images bootcycle-images-only
erikj@666 175 bootcycle-images-only: start-make
ohair@492 176 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
ihse@919 177 @($(CD) $(SRC_ROOT) && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
ohair@492 178
mduigou@650 179 test: images test-only
mduigou@650 180 test-only: start-make
ohair@492 181 @$(call TargetEnter)
mduigou@781 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@492 183 @$(call TargetExit)
ohair@492 184
ohair@492 185 # Stores the tips for each repository. This file is be used when constructing the jdk image and can be
ohair@492 186 # used to track the exact sources used to build that image.
ohair@492 187 source-tips: $(OUTPUT_ROOT)/source_tips
ohair@492 188 $(OUTPUT_ROOT)/source_tips: FRC
ohair@492 189 @$(MKDIR) -p $(@D)
ohair@492 190 @$(RM) $@
erikj@745 191 @$(call GetSourceTips)
ohair@492 192
ohair@492 193
ohair@492 194 # Remove everything, except the output from configure.
mduigou@675 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@492 196 @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
ohair@492 197 @$(ECHO) Cleaned all build artifacts.
ohair@492 198
ohair@492 199 # Remove everything, including configure configuration.
ohair@492 200 # If the output directory was created by configure and now becomes empty, remove it as well.
ohair@492 201 # FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh!
ohair@492 202 dist-clean: clean
igerasim@770 203 @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers)
ohair@492 204 @$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
ihse@844 205 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
ihse@844 206 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
ihse@844 207 else \
ihse@844 208 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \
ihse@844 209 fi \
ihse@844 210 )
ohair@492 211 @$(ECHO) Cleaned everything, you will have to re-run configure.
ohair@492 212
ohair@492 213 clean-langtools:
ohair@492 214 $(call CleanComponent,langtools)
ohair@492 215 clean-corba:
ohair@492 216 $(call CleanComponent,corba)
ohair@492 217 clean-jaxp:
ohair@492 218 $(call CleanComponent,jaxp)
ohair@492 219 clean-jaxws:
ohair@492 220 $(call CleanComponent,jaxws)
ohair@492 221 clean-hotspot:
ohair@492 222 $(call CleanComponent,hotspot)
ohair@492 223 clean-jdk:
ohair@492 224 $(call CleanComponent,jdk)
jjg@643 225 clean-nashorn:
jjg@643 226 $(call CleanComponent,nashorn)
ohair@492 227 clean-images:
ohair@492 228 $(call CleanComponent,images)
ohair@492 229 clean-overlay-images:
ohair@492 230 $(call CleanComponent,overlay-images)
ohair@492 231 clean-bootcycle-build:
ohair@492 232 $(call CleanComponent,bootcycle-build)
erikj@516 233 clean-docs:
erikj@516 234 $(call CleanComponent,docs)
erikj@516 235 $(call CleanComponent,docstemp)
mduigou@675 236 clean-test:
mduigou@675 237 $(call CleanComponent,testoutput)
ohair@492 238
mduigou@708 239 .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs
mduigou@708 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@788 241 .PHONY: default all clean dist-clean bootcycle-images start-make
mduigou@708 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@622 243 .PHONY: profiles profiles-only profiles-oscheck
ohair@492 244
erikj@933 245 include $(root_dir)/make/Jprt.gmk
erikj@933 246
ohair@492 247 FRC: # Force target