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