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