Makefile revision 3364
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# under the terms of the GNU General Public License version 2 only, as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# published by the Free Software Foundation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# version 2 for more details (a copy is included in the LICENSE file that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# accompanied this code).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You should have received a copy of the GNU General Public License version
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2 along with this work; if not, write to the Free Software Foundation,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or visit www.oracle.com if you need additional information or have any
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This makefile creates a build tree and lights off a build.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can go back into the build tree and perform rebuilds or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# incremental builds as desired. Be sure to reestablish
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The make process now relies on java and javac. These can be
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# specified either implicitly on the PATH, by setting the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDK in which bin/java and bin/javac are present and working (e.g.,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# default BOOTDIR path value. Note that one of ALT_BOOTDIR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# from the PATH.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# an architecture that differs from the target architecture, as long
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# as the bootstrap jdk runs under the same flavor of OS as the target
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (i.e., if the target is linux, point to a jdk that runs on a linux
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# box). In order to use such a bootstrap jdk, set the make variable
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# REMOTE to the desired remote command mechanism, e.g.,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# make REMOTE="rsh -l me myotherlinuxbox"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDI binding on SA produces two binaries:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 1. sa-jdi.jar - This is build before building libjvm[_g].so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please refer to ./makefiles/sa.make
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2. libsa[_g].so - Native library for SA - This is built after
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# libjsig[_g].so (signal interposition library)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please refer to ./makefiles/vm.make
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If $(GAMMADIR)/agent dir is not present, SA components are not built.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# we need to set up LP64 correctly to satisfy sanity checks in adlc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# pass USE_SUNCC further, through MFLAGS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The following renders pathnames in generated Makefiles valid on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# machines other than the machine containing the build tree.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# For example, let's say my build tree lives on /files12 on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# exact.east.sun.com. This logic will cause GAMMADIR to begin with
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# We only do this on SunOS variants, for a couple of reasons:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# * It is extremely rare that source trees exist on other systems
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# * It has been claimed that the Linux automounter is flakey, so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# changing GAMMADIR in a way that exercises the automounter could
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# prove to be a source of unreliability in the build process.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Obviously, this Makefile is only relevant on SunOS boxes to begin
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# with, but the SunOS conditionalization will make it easier to
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# combine Makefiles in the future (assuming we ever do that).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # prepend current directory to relative pathnames.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # If NEW_GAMMADIR doesn't already start with "/net/":
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # prepend /net/$(HOST)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # remove /net/$(HOST) if name already began with /home/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # remove /net/$(HOST) if name already began with /java/
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # remove /net/$(HOST) if name already began with /lab/
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Don't use the new value for GAMMADIR unless a file with the new
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # name actually exists.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# is used to give the build directories meaningful names.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# There is a (semi-) regular correspondence between make targets and actions:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Target Tree Type Build Dir
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# debug compiler2 <os>_<arch>_compiler2/debug
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# jvmg compiler2 <os>_<arch>_compiler2/jvmg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# optimized compiler2 <os>_<arch>_compiler2/optimized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# profiled compiler2 <os>_<arch>_compiler2/profiled
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# product compiler2 <os>_<arch>_compiler2/product
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# debug1 compiler1 <os>_<arch>_compiler1/debug
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# optimized1 compiler1 <os>_<arch>_compiler1/optimized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# profiled1 compiler1 <os>_<arch>_compiler1/profiled
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# product1 compiler1 <os>_<arch>_compiler1/product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# debugcore core <os>_<arch>_core/debug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fastdebugcore core <os>_<arch>_core/fastdebug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# jvmgcore core <os>_<arch>_core/jvmg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# optimizedcore core <os>_<arch>_core/optimized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# profiledcore core <os>_<arch>_core/profiled
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# productcore core <os>_<arch>_core/product
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# debugzero zero <os>_<arch>_zero/debug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fastdebugzero zero <os>_<arch>_zero/fastdebug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# jvmgzero zero <os>_<arch>_zero/jvmg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# optimizedzero zero <os>_<arch>_zero/optimized
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# profiledzero zero <os>_<arch>_zero/profiled
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# productzero zero <os>_<arch>_zero/product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# debugshark shark <os>_<arch>_shark/debug
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fastdebugshark shark <os>_<arch>_shark/fastdebug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# jvmgshark shark <os>_<arch>_shark/jvmg
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# optimizedshark shark <os>_<arch>_shark/optimized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# profiledshark shark <os>_<arch>_shark/profiled
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# productshark shark <os>_<arch>_shark/product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# What you get with each target:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fastdebug* - optimized compile, but with asserts enabled
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# optimized* - optimized compile, no asserts
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# profiled* - gprof
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This target list needs to be coordinated with the usage message
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# in the build.sh script:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS = debug jvmg fastdebug optimized profiled product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#-------------------------------------------------------------------------------
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Could make everything by default, but that would take a while.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Solaris 2.5.1, 2.6).
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# jvmti.make requires XSLT (J2SE 1.4.x or newer):
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinXSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If not found then fail fast.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs