Makefile revision 3364
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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#
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#
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#
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#
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# questions.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
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
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#
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.,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# make REMOTE="rsh -l me myotherlinuxbox"
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews
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 Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifeq ($(GAMMADIR),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../make/defs.make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewselse
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude $(GAMMADIR)/make/defs.make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifndef CC_INTERP
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ifndef FORCE_TIERED
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews FORCE_TIERED=1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifdef LP64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews _JUNK_ := $(shell echo >&2 \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @exit 1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# we need to set up LP64 correctly to satisfy sanity checks in adlc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein MFLAGS += " LP64=1 "
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# pass USE_SUNCC further, through MFLAGS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifdef USE_SUNCC
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews MFLAGS += " USE_SUNCC=1 "
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The following renders pathnames in generated Makefiles valid on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# machines other than the machine containing the build tree.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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# /net/exact/files12/...
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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).
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifeq ($(OSNAME),solaris)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # prepend current directory to relative pathnames.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews NEW_GAMMADIR := \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(shell echo $(GAMMADIR) | \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein )
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews unexport NEW_GAMMADIR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
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 NEW_GAMMADIR := \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(shell echo $(NEW_GAMMADIR) | \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sed -e "s=^\(.*\)=/net/$(HOST)\1=" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -e "s=^/net/$(HOST)/home/=/home/=" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -e "s=^/net/$(HOST)/java/=/java/=" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -e "s=^/net/$(HOST)/lab/=/lab/=" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein )
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Don't use the new value for GAMMADIR unless a file with the new
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # name actually exists.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ifneq ($(wildcard $(NEW_GAMMADIR)),)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein GAMMADIR := $(NEW_GAMMADIR)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein endif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews endif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinendif
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# is used to give the build directories meaningful names.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinVARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# There is a (semi-) regular correspondence between make targets and actions:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Target Tree Type Build Dir
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
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#
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#
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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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#
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
7208386cd37a2092c70eddf80cf29519b16c4c80Mark Andrews#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# What you get with each target:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
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
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
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 Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(ZERO_BUILD), true)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewselse
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
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))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS_C2 = $(TARGETS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS_C1 = $(addsuffix 1,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS_CORE = $(addsuffix core,$(TARGETS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTARGETS_ZERO = $(addsuffix zero,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinTARGETS_SHARK = $(addsuffix shark,$(TARGETS))
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
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 Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#-------------------------------------------------------------------------------
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Could make everything by default, but that would take a while.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsall:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo " $(TARGETS_C2)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo " $(TARGETS_C1)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo " $(TARGETS_CORE)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo " $(TARGETS_ZERO)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo " $(TARGETS_SHARK)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewschecks: check_os_version check_j2se_version
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
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 Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsOS_VERSION := $(shell uname -r)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewscheck_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;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
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 Austeincheck_j2se_version:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ $$? -ne 0 ]; then \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(REMOTE) $(RUN.JAVA) -version; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "to bootstrap this build" 1>&2; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein exit 1; \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein fi
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(BUILDTREE) VARIANT=tiered
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(SUBDIRS_C2): $(BUILDTREE_MAKE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinifeq ($(FORCE_TIERED),1)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinelse
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=compiler2
endif
$(SUBDIRS_C1): $(BUILDTREE_MAKE)
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=compiler1
$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=core
$(SUBDIRS_ZERO): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
$(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(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)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
docs: checks
$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
# Synonyms for win32-like targets.
compiler2: jvmg product
compiler1: jvmg1 product1
core: jvmgcore productcore
zero: jvmgzero productzero
shark: jvmgshark productshark
clean_docs:
rm -rf $(SUBDIR_DOCS)
clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
include $(GAMMADIR)/make/cscope.make
#-------------------------------------------------------------------------------
.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version