8065804: JEP 171: Clarifications/corrections for fence intrinsics
Reviewed-by: dholmes, shade, dl, psandoz
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# 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 makefile containing most actual top level targets. It needs
# to be called with a SPEC file defined.
# Declare default target
default:
# Now load the spec
include $(SPEC)
include $(SRC_ROOT)/make/MakeHelpers.gmk
# Load the vital tools for all the makefiles.
include $(SRC_ROOT)/make/common/MakeBase.gmk
include $(SRC_ROOT)/make/common/Modules.gmk
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
# valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
ALL_TARGETS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, , Main.gmk))
# All modules for the current target platform.
# Manually add jdk.hotspot.agent for now.
ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
################################################################################
################################################################################
#
# Recipes for all targets. Only recipes, dependencies are declared later.
#
################################################################################
################################################################################
# Interim/build tools targets, compiling tools used during the build
buildtools-langtools:
+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
interim-langtools:
+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
interim-corba:
+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
interim-rmic:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
buildtools-jdk:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
ALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
interim-rmic buildtools-jdk
################################################################################
# Special targets for certain modules
import-hotspot:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
unpack-sec:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
ALL_TARGETS += import-hotspot unpack-sec
################################################################################
# Gensrc targets, generating source before java compilation can be done
$(eval $(call DeclareRecipesForPhase, GENSRC, \
TARGET_SUFFIX := gensrc, \
FILE_PREFIX := Gensrc, \
MAKE_SUBDIR := gensrc, \
CHECK_MODULES := $(ALL_MODULES), \
MULTIPLE_MAKEFILES := true))
JDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
LANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
CORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
ALL_TARGETS += $(GENSRC_TARGETS)
################################################################################
# Generate data targets
$(eval $(call DeclareRecipesForPhase, GENDATA, \
TARGET_SUFFIX := gendata, \
FILE_PREFIX := Gendata, \
MAKE_SUBDIR := gendata, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
ALL_TARGETS += $(GENDATA_TARGETS)
################################################################################
# Copy files targets
$(eval $(call DeclareRecipesForPhase, COPY, \
TARGET_SUFFIX := copy, \
FILE_PREFIX := Copy, \
MAKE_SUBDIR := copy, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
ALL_TARGETS += $(COPY_TARGETS)
################################################################################
# Targets for compiling all java modules. Nashorn is treated separately.
JAVA_MODULES := $(call FindJavaModules)
JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
define DeclareCompileJavaRecipe
$1-java:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
$1 JAVA_MODULES=$1)
endef
$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
$(eval $(call DeclareCompileJavaRecipe,$m)))
# Build nashorn. Needs to be compiled separately from the rest of the modules
# due to nasgen.
jdk.scripting.nashorn-java:
+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
ALL_TARGETS += $(JAVA_TARGETS)
################################################################################
# Targets for running rmic.
$(eval $(call DeclareRecipesForPhase, RMIC, \
TARGET_SUFFIX := rmic, \
FILE_PREFIX := Rmic, \
MAKE_SUBDIR := rmic, \
CHECK_MODULES := $(ALL_MODULES)))
ALL_TARGETS += $(RMIC_TARGETS)
################################################################################
# Targets for compiling native libraries
$(eval $(call DeclareRecipesForPhase, LIBS, \
TARGET_SUFFIX := libs, \
FILE_PREFIX := Lib, \
MAKE_SUBDIR := lib, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
ALL_TARGETS += $(LIBS_TARGETS)
################################################################################
# Targets for compiling native executables
$(eval $(call DeclareRecipesForPhase, LAUNCHER, \
TARGET_SUFFIX := launchers, \
FILE_PREFIX := Launcher, \
MAKE_SUBDIR := launcher, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
ALL_TARGETS += $(LAUNCHER_TARGETS)
################################################################################
# Build hotspot target
ifeq ($(BUILD_HOTSPOT),true)
hotspot:
($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
endif
ALL_TARGETS += hotspot
################################################################################
# Build demos and samples targets
demos:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
samples:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
ALL_TARGETS += demos samples
################################################################################
# Image targets
# 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: $(SUPPORT_OUTPUTDIR)/source_tips
$(SUPPORT_OUTPUTDIR)/source_tips: FRC
@$(MKDIR) -p $(@D)
@$(RM) $@
@$(call GetSourceTips)
BOOTCYCLE_TARGET := images
bootcycle-images:
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
zip-security:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
zip-source:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
strip-binaries:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
jrtfs-jar:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
jimages:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
profiles:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
mac-bundles:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
jrtfs-jar jimages profiles mac-bundles
################################################################################
# Docs targets
docs-javadoc:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
docs-jvmtidoc:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
ALL_TARGETS += docs-javadoc docs-jvmtidoc
################################################################################
# Test target
test:
($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUTDIR) \
ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
test-make:
($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
ALL_TARGETS += test test-make
################################################################################
# Verification targets
verify-modules:
@$(call TargetEnter)
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
@$(call TargetExit)
ALL_TARGETS += verify-modules
################################################################################
# Install targets
install:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
ALL_TARGETS += install
################################################################################
#
# Dependency declarations between targets.
#
# These are declared in two groups. First all dependencies between targets that
# have recipes above as these dependencies may be disabled. Then the aggregator
# targets that do not have recipes of their own, which will never have their
# dependencies disabled.
#
################################################################################
# Targets with recipes above
# If running an *-only target, parallel execution and dependencies between
# recipe targets are disabled. This makes it possible to run a select set of
# recipe targets in order. It's the responsibility of the user to make sure
# all prerequisites are fulfilled.
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
.NOTPARALLEL:
else
$(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
buildtools-jdk: interim-langtools
$(CORBA_GENSRC_TARGETS): interim-langtools
$(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
interim-corba: $(CORBA_GENSRC_TARGETS)
$(GENDATA_TARGETS): interim-langtools buildtools-jdk
interim-rmic: interim-langtools
$(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
import-hotspot: hotspot
$(LIBS_TARGETS): import-hotspot
$(LAUNCHER_TARGETS): java.base-libs
# The demos are currently linking to libjvm and libjava, just like all other
# jdk libs, even though they don't need to. To avoid warnings, make sure they
# aren't built until after libjava and libjvm are available to link to.
demos: $(JAVA_TARGETS)
# Declare dependency from <module>-java to <module>-gensrc
$(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
# Declare dependencies between java modules
$(foreach m, $(JAVA_MODULES), \
$(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
$(call FindDepsForModule,$m)))))
# Declare dependencies between <module>-rmic to <module>-java
$(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
# Declare dependencies from <module>-lib to <module>-java
# Skip jdk.jdwp.agent as it contains no java code.
$(foreach m, $(filter-out jdk.jdwp.agent, $(LIBS_MODULES)), $(eval $m-libs: $m-java))
# Declare dependencies from all other <module>-lib to java.base-lib
$(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
$(eval $t: java.base-libs))
# Declare the special case dependency for jdk.deploy.osx where libosx
# links against libosxapp.
jdk.deploy.osx-libs: java.desktop-libs
# This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
# header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
# virtual target.
jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
# Until the module system is in place, jdk.jdi-gensrc needs to combine service
# loader configuration with jdk.hotspot.agent so is dependent on importing
# hotspot.
jdk.jdi-gensrc-jdk: import-hotspot
# The swing beans need to have java base properly generated to avoid errors
# in javadoc.
java.desktop-gensrc-jdk: java.base-gensrc
# Explicitly add dependencies for special targets
java.base-java: unpack-sec
jdk.dev-gendata: java rmic
zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
$(filter jdk.crypto%, $(JAVA_TARGETS))
zip-source: gensrc rmic
strip-binaries: libs launchers gendata copy
jrtfs-jar: buildtools-jdk
jimages: exploded-image zip-source strip-binaries source-tips demos samples \
jrtfs-jar
profiles: exploded-image strip-binaries source-tips
mac-bundles: jimages
bootcycle-images: jimages
docs-javadoc: gensrc rmic
docs-jvmtidoc: hotspot
test: exploded-image
verify-modules: exploded-image
endif
################################################################################
# Virtual targets without recipes
buildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
buildtools-jdk
gensrc: $(GENSRC_TARGETS)
gendata: $(GENDATA_TARGETS)
copy: $(COPY_TARGETS)
java: $(JAVA_TARGETS)
rmic: $(RMIC_TARGETS)
libs: $(LIBS_TARGETS)
launchers: $(LAUNCHER_TARGETS)
# Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
# is actually handled by jdk.jdi-gensrc
jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
# Declare dependencies from <module> to all the individual targets specific
# to that module <module>-*.
$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
$(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
exploded-image: $(ALL_MODULE_TARGETS)
# The old 'jdk' target most closely matches the new exploded-image. Keep an
# alias for ease of use.
jdk: exploded-image
images: jimages demos samples zip-security
ifeq ($(OPENJDK_TARGET_OS), macosx)
images: mac-bundles
endif
docs: docs-javadoc docs-jvmtidoc
ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image jdk images \
docs
################################################################################
all: images
default: exploded-image
ALL_TARGETS += default all
################################################################################
################################################################################
#
# Clean targets
#
################################################################################
# Clean targets are automatically run serially by the Makefile calling this
# file.
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
images make-support
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
CLEAN_PHASES := gensrc java native include
CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
# Construct targets of the form clean-$module-$phase
CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
$(addprefix $m-, $(CLEAN_PHASES))))
# Remove everything, except the output from configure.
clean: $(CLEAN_DIR_TARGETS)
($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
$(ECHO) Cleaned all build artifacts.
$(CLEAN_DIR_TARGETS):
$(call CleanDir,$(patsubst clean-%, %, $@))
$(CLEAN_PHASE_TARGETS):
$(call Clean-$(patsubst clean-%,%, $@))
$(CLEAN_MODULE_TARGETS):
$(call CleanModule,$(patsubst clean-%, %, $@))
$(CLEAN_MODULE_PHASE_TARGETS):
$(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
$(word 2, $(subst -,$(SPACE),$@)))
# When removing the support dir, we must also remove jdk. Building classes has
# the side effect of generating native headers. The headers end up in support
# while classes and touch files end up in jdk.
clean-support: clean-jdk
clean-docs: clean-docstemp
# Remove everything, including configure configuration.
# If the output directory was created by configure and now becomes empty, remove it as well.
dist-clean: clean
($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
Makefile compare.sh tmp javacservers)
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
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 \
)
$(ECHO) Cleaned everything, you will have to re-run configure.
ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_PHASE_TARGETS) \
$(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
################################################################################
# Setup a rule for SPEC file that fails if executed. This check makes sure the
# configuration is up to date after changes to configure.
ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
@$(ECHO) "ERROR: $(SPEC) is not up to date."
@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
@$(ECHO) "'make reconfigure'."
@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
endif
# The reconfigure target is automatically run serially from everything else
# by the Makefile calling this file.
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) )
ALL_TARGETS += reconfigure
################################################################################
# Declare *-only targets for each normal target
$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
ALL_TARGETS += $(addsuffix -only, $(filter-out clean%, $(ALL_TARGETS)))
################################################################################
.PHONY: $(ALL_TARGETS)
include $(SRC_ROOT)/make/Jprt.gmk
FRC: # Force target