Makefile revision 1472
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# 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,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# or visit www.oracle.com if you need additional information or have any
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# questions.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# 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
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# 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)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# default BOOTDIR path value. Note that one of ALT_BOOTDIR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# 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
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# as the bootstrap jdk runs under the same flavor of OS as the target
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# (i.e., if the target is linux, point to a jdk that runs on a linux
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# box). In order to use such a bootstrap jdk, set the make variable
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# REMOTE to the desired remote command mechanism, e.g.,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# make REMOTE="rsh -l me myotherlinuxbox"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# JDI binding on SA produces two binaries:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# 1. sa-jdi.jar - This is build before building libjvm[_g].so
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Please refer to ./makefiles/sa.make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# 2. libsa[_g].so - Native library for SA - This is built after
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# libjsig[_g].so (signal interposition library)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Please refer to ./makefiles/vm.make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# If $(GAMMADIR)/agent dir is not present, SA components are not built.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifeq ($(GAMMADIR),)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntinclude ../../make/defs.make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntelse
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeininclude $(GAMMADIR)/make/defs.make
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifndef LP64
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifndef CC_INTERP
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserFORCE_TIERED=1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifdef LP64
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt _JUNK_ := $(shell echo >&2 \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @exit 1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt endif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# we need to set up LP64 correctly to satisfy sanity checks in adlc
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt MFLAGS += " LP64=1 "
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# pass USE_SUNCC further, through MFLAGS
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifdef USE_SUNCC
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User MFLAGS += " USE_SUNCC=1 "
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox Userendif
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User# The following renders pathnames in generated Makefiles valid on
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User# machines other than the machine containing the build tree.
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User#
dec590a3deb8e87380a8bd3a77d535dba3729bf6Tinderbox User# For example, let's say my build tree lives on /files12 on
c42708dcc8ca18a41152251654d29f0cdd5b9533Tinderbox User# exact.east.sun.com. This logic will cause GAMMADIR to begin with
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# /net/exact/files12/...
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# We only do this on SunOS variants, for a couple of reasons:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# * It is extremely rare that source trees exist on other systems
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# * It has been claimed that the Linux automounter is flakey, so
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# changing GAMMADIR in a way that exercises the automounter could
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# prove to be a source of unreliability in the build process.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Obviously, this Makefile is only relevant on SunOS boxes to begin
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# with, but the SunOS conditionalization will make it easier to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# combine Makefiles in the future (assuming we ever do that).
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifeq ($(OSNAME),solaris)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # prepend current directory to relative pathnames.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User NEW_GAMMADIR := \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(shell echo $(GAMMADIR) | \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt )
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt unexport NEW_GAMMADIR
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # If NEW_GAMMADIR doesn't already start with "/net/":
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # prepend /net/$(HOST)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # remove /net/$(HOST) if name already began with /home/
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # remove /net/$(HOST) if name already began with /java/
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # remove /net/$(HOST) if name already began with /lab/
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User NEW_GAMMADIR := \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(shell echo $(NEW_GAMMADIR) | \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt sed -e "s=^\(.*\)=/net/$(HOST)\1=" \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt -e "s=^/net/$(HOST)/home/=/home/=" \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt -e "s=^/net/$(HOST)/java/=/java/=" \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -e "s=^/net/$(HOST)/lab/=/lab/=" \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt )
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # Don't use the new value for GAMMADIR unless a file with the new
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # name actually exists.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ifneq ($(wildcard $(NEW_GAMMADIR)),)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt GAMMADIR := $(NEW_GAMMADIR)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User endif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt endif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# is used to give the build directories meaningful names.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntVARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# There is a (semi-) regular correspondence between make targets and actions:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Target Tree Type Build Dir
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# debug compiler2 <os>_<arch>_compiler2/debug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# jvmg compiler2 <os>_<arch>_compiler2/jvmg
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# optimized compiler2 <os>_<arch>_compiler2/optimized
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# profiled compiler2 <os>_<arch>_compiler2/profiled
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# product compiler2 <os>_<arch>_compiler2/product
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# debug1 compiler1 <os>_<arch>_compiler1/debug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# optimized1 compiler1 <os>_<arch>_compiler1/optimized
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# profiled1 compiler1 <os>_<arch>_compiler1/profiled
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# product1 compiler1 <os>_<arch>_compiler1/product
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# debugcore core <os>_<arch>_core/debug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fastdebugcore core <os>_<arch>_core/fastdebug
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# jvmgcore core <os>_<arch>_core/jvmg
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# optimizedcore core <os>_<arch>_core/optimized
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# profiledcore core <os>_<arch>_core/profiled
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# productcore core <os>_<arch>_core/product
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# debugzero zero <os>_<arch>_zero/debug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fastdebugzero zero <os>_<arch>_zero/fastdebug
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# jvmgzero zero <os>_<arch>_zero/jvmg
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# optimizedzero zero <os>_<arch>_zero/optimized
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# profiledzero zero <os>_<arch>_zero/profiled
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# productzero zero <os>_<arch>_zero/product
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# What you get with each target:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fastdebug* - optimized compile, but with asserts enabled
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# optimized* - optimized compile, no asserts
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# profiled* - gprof
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# This target list needs to be coordinated with the usage message
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# in the build.sh script:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGETS = debug jvmg fastdebug optimized profiled product
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifeq ($(ZERO_BUILD), true)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntelse
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGETS_C2 = $(TARGETS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGETS_C1 = $(addsuffix 1,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGETS_CORE = $(addsuffix core,$(TARGETS))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserTARGETS_ZERO = $(addsuffix zero,$(TARGETS))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#-------------------------------------------------------------------------------
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Could make everything by default, but that would take a while.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntall:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @echo " $(TARGETS_C2)"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @echo " $(TARGETS_C1)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @echo " $(TARGETS_CORE)"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @echo " $(TARGETS_ZERO)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntchecks: check_os_version check_j2se_version
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Solaris 2.5.1, 2.6).
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7%
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntOS_VERSION := $(shell uname -r)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcheck_os_version:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# jvmti.make requires XSLT (J2SE 1.4.x or newer):
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntXSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# If not found then fail fast.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usercheck_j2se_version:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt if [ $$? -ne 0 ]; then \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(REMOTE) $(RUN.JAVA) -version; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User "to bootstrap this build" 1>&2; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt exit 1; \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User fi
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(BUILDTREE) VARIANT=tiered
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(SUBDIRS_C2): $(BUILDTREE_MAKE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifdef FORCE_TIERED
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntelse
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(BUILDTREE) VARIANT=compiler2
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox Userendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(SUBDIRS_C1): $(BUILDTREE_MAKE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(BUILDTREE) VARIANT=compiler1
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(BUILDTREE) VARIANT=core
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(SUBDIRS_ZERO): $(BUILDTREE_MAKE) platform_zero
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userplatform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(TARGETS_C2): $(SUBDIRS_C2)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifdef INSTALL
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(TARGETS_TIERED): $(SUBDIRS_TIERED)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifdef INSTALL
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(TARGETS_C1): $(SUBDIRS_C1)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifdef INSTALL
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(TARGETS_CORE): $(SUBDIRS_CORE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
e2b184f84e846bbcb764b6f0aef5dcd583d3d7a1Tinderbox Userifdef INSTALL
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt$(TARGETS_ZERO): $(SUBDIRS_ZERO)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifdef INSTALL
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Just build the tree, and nothing else:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttree: $(SUBDIRS_C2)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttree1: $(SUBDIRS_C1)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttreecore: $(SUBDIRS_CORE)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usertreezero: $(SUBDIRS_ZERO)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Doc target. This is the same for all build options.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Hence create a docs directory beside ...$(ARCH)_[...]
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdocs: checks
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) mkdir -p $(SUBDIR_DOCS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Synonyms for win32-like targets.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usercompiler2: jvmg product
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcompiler1: jvmg1 product1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcore: jvmgcore productcore
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userzero: jvmgzero productzero
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntclean_docs:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt rm -rf $(SUBDIR_DOCS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userclean_compiler1 clean_compiler2 clean_core clean_zero:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntclean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_docs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#-------------------------------------------------------------------------------
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt.PHONY: tree tree1 treecore treezero
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt.PHONY: all compiler1 compiler2 core zero
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero docs clean_docs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User.PHONY: checks check_os_version check_j2se_version
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt