aoqi@0: # aoqi@0: # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: # aoqi@0: # This code is free software; you can redistribute it and/or modify it aoqi@0: # under the terms of the GNU General Public License version 2 only, as aoqi@0: # published by the Free Software Foundation. Oracle designates this aoqi@0: # particular file as subject to the "Classpath" exception as provided aoqi@0: # by Oracle in the LICENSE file that accompanied this code. aoqi@0: # aoqi@0: # This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: # version 2 for more details (a copy is included in the LICENSE file that aoqi@0: # accompanied this code). aoqi@0: # aoqi@0: # You should have received a copy of the GNU General Public License version aoqi@0: # 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: # aoqi@0: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: # or visit www.oracle.com if you need additional information or have any aoqi@0: # questions. aoqi@0: # aoqi@0: aoqi@0: ### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. aoqi@0: aoqi@0: # Now load the spec aoqi@0: include $(SPEC) aoqi@0: aoqi@0: # Load the vital tools for all the makefiles. aoqi@0: include $(SRC_ROOT)/make/common/MakeBase.gmk aoqi@0: aoqi@0: # Include the corresponding custom file, if present. aoqi@0: -include $(CUSTOM_MAKE_DIR)/Main.gmk aoqi@0: aoqi@0: ### Clean up from previous run aoqi@0: aoqi@0: # Remove any build.log from a previous run, if they exist aoqi@0: ifneq (,$(BUILD_LOG)) aoqi@0: ifneq (,$(BUILD_LOG_PREVIOUS)) aoqi@0: # Rotate old log aoqi@0: $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) aoqi@0: $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) aoqi@0: else aoqi@0: $(shell $(RM) $(BUILD_LOG) 2> /dev/null) aoqi@0: endif aoqi@0: $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null) aoqi@0: endif aoqi@0: # Remove any javac server logs and port files. This aoqi@0: # prevents a new make run to reuse the previous servers. aoqi@0: ifneq (,$(SJAVAC_SERVER_DIR)) aoqi@0: $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) aoqi@0: endif aoqi@0: aoqi@0: # Reset the build timers. aoqi@0: $(eval $(call ResetAllTimers)) aoqi@0: aoqi@0: # Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line, aoqi@0: # hence this workaround. aoqi@0: MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS) aoqi@0: aoqi@0: ### Main targets aoqi@0: aoqi@0: default: jdk aoqi@0: @$(call CheckIfMakeAtEnd) aoqi@0: aoqi@0: all: images docs aoqi@0: @$(call CheckIfMakeAtEnd) aoqi@0: aoqi@0: # Setup a rule for SPEC file that fails if executed. This check makes sure the configuration aoqi@0: # is up to date after changes to configure aoqi@0: $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) aoqi@0: @$(ECHO) ERROR: $(SPEC) is not up to date aoqi@0: @$(ECHO) Please rerun configure! aoqi@0: @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi aoqi@0: aoqi@0: start-make: $(SPEC) aoqi@0: @$(call AtMakeStart) aoqi@0: aoqi@0: langtools: langtools-only aoqi@0: langtools-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(LANGTOOLS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: corba: langtools corba-only aoqi@0: corba-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(CORBA_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: jaxp: langtools jaxp-only aoqi@0: jaxp-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JAXP_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: jaxws: langtools jaxp jaxws-only aoqi@0: jaxws-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JAXWS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: ifeq ($(BUILD_HOTSPOT),true) aoqi@0: hotspot: hotspot-only aoqi@0: hotspot-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) aoqi@0: @$(call TargetExit) aoqi@0: endif aoqi@0: aoqi@0: jdk: langtools hotspot corba jaxp jaxws jdk-only aoqi@0: jdk-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET)) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: nashorn: jdk nashorn-only aoqi@0: nashorn-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(NASHORN_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: demos: jdk demos-only aoqi@0: demos-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: # Note: This double-colon rule is intentional, to support aoqi@0: # custom make file integration. aoqi@0: images:: source-tips demos nashorn images-only aoqi@0: images-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: overlay-images: source-tips demos overlay-images-only aoqi@0: overlay-images-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: profiles: profiles-oscheck source-tips jdk hotspot profiles-only aoqi@0: profiles-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: profiles-oscheck: aoqi@0: ifneq ($(OPENJDK_TARGET_OS), linux) aoqi@0: @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 aoqi@0: endif aoqi@0: aoqi@0: install: images install-only aoqi@0: install-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: docs: jdk docs-only aoqi@0: docs-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: sign-jars: jdk sign-jars-only aoqi@0: sign-jars-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars) aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: bootcycle-images: images bootcycle-images-only aoqi@0: bootcycle-images-only: start-make aoqi@0: @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image aoqi@0: @($(CD) $(SRC_ROOT) && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images) aoqi@0: aoqi@0: test: images test-only aoqi@0: test-only: start-make aoqi@0: @$(call TargetEnter) aoqi@0: @($(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 aoqi@0: @$(call TargetExit) aoqi@0: aoqi@0: # Stores the tips for each repository. This file is be used when constructing the jdk image and can be aoqi@0: # used to track the exact sources used to build that image. aoqi@0: source-tips: $(OUTPUT_ROOT)/source_tips aoqi@0: $(OUTPUT_ROOT)/source_tips: FRC aoqi@0: @$(MKDIR) -p $(@D) aoqi@0: @$(RM) $@ aoqi@0: @$(call GetSourceTips) aoqi@0: aoqi@0: aoqi@0: # Remove everything, except the output from configure. aoqi@0: 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 aoqi@0: @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*) aoqi@0: @$(ECHO) Cleaned all build artifacts. aoqi@0: aoqi@0: # Remove everything, including configure configuration. aoqi@0: # If the output directory was created by configure and now becomes empty, remove it as well. aoqi@0: # FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh! aoqi@0: dist-clean: clean aoqi@0: @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers) aoqi@0: @$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ aoqi@0: if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ aoqi@0: $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \ aoqi@0: else \ aoqi@0: ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \ aoqi@0: fi \ aoqi@0: ) aoqi@0: @$(ECHO) Cleaned everything, you will have to re-run configure. aoqi@0: aoqi@0: clean-langtools: aoqi@0: $(call CleanComponent,langtools) aoqi@0: clean-corba: aoqi@0: $(call CleanComponent,corba) aoqi@0: clean-jaxp: aoqi@0: $(call CleanComponent,jaxp) aoqi@0: clean-jaxws: aoqi@0: $(call CleanComponent,jaxws) aoqi@0: clean-hotspot: aoqi@0: $(call CleanComponent,hotspot) aoqi@0: clean-jdk: aoqi@0: $(call CleanComponent,jdk) aoqi@0: clean-nashorn: aoqi@0: $(call CleanComponent,nashorn) aoqi@0: clean-images: aoqi@0: $(call CleanComponent,images) aoqi@0: clean-overlay-images: aoqi@0: $(call CleanComponent,overlay-images) aoqi@0: clean-bootcycle-build: aoqi@0: $(call CleanComponent,bootcycle-build) aoqi@0: clean-docs: aoqi@0: $(call CleanComponent,docs) aoqi@0: $(call CleanComponent,docstemp) aoqi@0: clean-test: aoqi@0: $(call CleanComponent,testoutput) aoqi@0: aoqi@0: .PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs aoqi@0: .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 aoqi@0: .PHONY: default all clean dist-clean bootcycle-images start-make aoqi@0: .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 aoqi@0: .PHONY: profiles profiles-only profiles-oscheck aoqi@0: aoqi@0: FRC: # Force target