#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# 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 makefile creates a build tree and lights off a build.
# You can go back into the build tree and perform rebuilds or
# incremental builds as desired. Be sure to reestablish
# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
# The make process now relies on java and javac. These can be
# specified either implicitly on the PATH, by setting the
# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
# default BOOTDIR path value. Note that one of ALT_BOOTDIR
# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
# from the PATH.
#
# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on
# an architecture that differs from the target architecture, as long
# as the bootstrap jdk runs under the same flavor of OS as the target
# (i.e., if the target is linux, point to a jdk that runs on a linux
# box). In order to use such a bootstrap jdk, set the make variable
# REMOTE to the desired remote command mechanism, e.g.,
#
# make REMOTE="rsh -l me myotherlinuxbox"
# JDI binding on SA produces two binaries:
# 1. sa-jdi.jar - This is build before building libjvm[_g].so
# 2. libsa[_g].so - Native library for SA - This is built after
# libjsig[_g].so (signal interposition library)
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
else
@exit 1
# we need to set up LP64 correctly to satisfy sanity checks in adlc
MFLAGS += " LP64=1 "
# pass USE_SUNCC further, through MFLAGS
MFLAGS += " USE_SUNCC=1 "
# The following renders pathnames in generated Makefiles valid on
# machines other than the machine containing the build tree.
#
# For example, let's say my build tree lives on /files12 on
# exact.east.sun.com. This logic will cause GAMMADIR to begin with
#
# We only do this on SunOS variants, for a couple of reasons:
# * It is extremely rare that source trees exist on other systems
# * It has been claimed that the Linux automounter is flakey, so
# changing GAMMADIR in a way that exercises the automounter could
# prove to be a source of unreliability in the build process.
# Obviously, this Makefile is only relevant on SunOS boxes to begin
# with, but the SunOS conditionalization will make it easier to
# combine Makefiles in the future (assuming we ever do that).
# prepend current directory to relative pathnames.
NEW_GAMMADIR := \
)
# If NEW_GAMMADIR doesn't already start with "/net/":
# prepend /net/$(HOST)
# remove /net/$(HOST) if name already began with /home/
# remove /net/$(HOST) if name already began with /java/
# remove /net/$(HOST) if name already began with /lab/
NEW_GAMMADIR := \
)
# Don't use the new value for GAMMADIR unless a file with the new
# name actually exists.
# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
# is used to give the build directories meaningful names.
# There is a (semi-) regular correspondence between make targets and actions:
#
# Target Tree Type Build Dir
#
#
#
#
#
#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
# fastdebug* - optimized compile, but with asserts enabled
# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
# optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
# This target list needs to be coordinated with the usage message
# in the build.sh script:
else
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
#-------------------------------------------------------------------------------
# Could make everything by default, but that would take a while.
all:
# Solaris 2.5.1, 2.6).
# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
# jvmti.make requires XSLT (J2SE 1.4.x or newer):
# If not found then fail fast.
if [ $$? -ne 0 ]; then \
echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
"to bootstrap this build" 1>&2; \
exit 1; \
fi
$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
$(SUBDIRS_C2): $(BUILDTREE_MAKE)
else
$(SUBDIRS_C1): $(BUILDTREE_MAKE)
$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
$(TARGETS_C2): $(SUBDIRS_C2)
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
$(TARGETS_C1): $(SUBDIRS_C1)
$(TARGETS_CORE): $(SUBDIRS_CORE)
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
# We specify 'BUILD_FLAVOR=product' so that the proper
# ENABLE_FULL_DEBUG_SYMBOLS value is used.
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
# Synonyms for win32-like targets.
#-------------------------------------------------------------------------------