Makefile revision 91
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# This code is free software; you can redistribute it and/or modify it
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# under the terms of the GNU General Public License version 2 only, as
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# published by the Free Software Foundation.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# This code is distributed in the hope that it will be useful, but WITHOUT
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# accompanied this code).
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You should have received a copy of the GNU General Public License version
f8f37672a57524560fbdde52484e6ae3de1c3354Mark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# CA 95054 USA or visit www.sun.com if you need additional information or
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# have any questions.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# This makefile creates a build tree and lights off a build.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# You can go back into the build tree and perform rebuilds or
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# incremental builds as desired. Be sure to reestablish
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# The make process now relies on java and javac. These can be
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# specified either implicitly on the PATH, by setting the
bac2ed6ec3fbb5420e6ce69dd1218745d4e02b1eMark Andrews# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
ed178efa9ab8f813538fce4ff603b81ded9f1799Mark Andrews# JDK in which bin/java and bin/javac are present and working (e.g.,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
bac2ed6ec3fbb5420e6ce69dd1218745d4e02b1eMark Andrews# default BOOTDIR path value. Note that one of ALT_BOOTDIR
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
4038ab55037184d76153afd3c469aa8c85adf85dMark Andrews# from the PATH.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on
bac2ed6ec3fbb5420e6ce69dd1218745d4e02b1eMark Andrews# an architecture that differs from the target architecture, as long
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# as the bootstrap jdk runs under the same flavor of OS as the target
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# (i.e., if the target is linux, point to a jdk that runs on a linux
ed178efa9ab8f813538fce4ff603b81ded9f1799Mark Andrews# box). In order to use such a bootstrap jdk, set the make variable
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# REMOTE to the desired remote command mechanism, e.g.,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# make REMOTE="rsh -l me myotherlinuxbox"
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# JDI binding on SA produces two binaries:
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# 1. sa-jdi.jar - This is build before building libjvm[_g].so
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Please refer to ./makefiles/sa.make
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# 2. libsa[_g].so - Native library for SA - This is built after
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# libjsig[_g].so (signal interposition library)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Please refer to ./makefiles/vm.make
26a77b80bb7ee886c6fa704348d5e80a011d8811Mark Andrews# If $(GAMMADIR)/agent dir is not present, SA components are not built.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# we need to set up LP64 correctly to satisfy sanity checks in adlc
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews# pass USE_SUNCC further, through MFLAGS
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews# The following renders pathnames in generated Makefiles valid on
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# machines other than the machine containing the build tree.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# For example, let's say my build tree lives on /files12 on
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews# exact.east.sun.com. This logic will cause GAMMADIR to begin with
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# We only do this on SunOS variants, for a couple of reasons:
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# * It is extremely rare that source trees exist on other systems
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# * It has been claimed that the Linux automounter is flakey, so
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# changing GAMMADIR in a way that exercises the automounter could
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# prove to be a source of unreliability in the build process.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Obviously, this Makefile is only relevant on SunOS boxes to begin
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# with, but the SunOS conditionalization will make it easier to
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark Andrews# combine Makefiles in the future (assuming we ever do that).
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # prepend current directory to relative pathnames.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # If NEW_GAMMADIR doesn't already start with "/net/":
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # prepend /net/$(HOST)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # remove /net/$(HOST) if name already began with /home/
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # remove /net/$(HOST) if name already began with /java/
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # remove /net/$(HOST) if name already began with /lab/
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews # Don't use the new value for GAMMADIR unless a file with the new
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews # name actually exists.
ca12f7f4cf72e2368ee946f3eb4915ab73576cdcMark Andrews# There is a (semi-) regular correspondence between make targets and actions:
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Target Tree Type Build Dir
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# debug compiler2 <os>_<arch>_compiler2/debug
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# jvmg compiler2 <os>_<arch>_compiler2/jvmg
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# optimized compiler2 <os>_<arch>_compiler2/optimized
642e0716c8b4ab82ebc8e60f94c9e897ee89f19aMark Andrews# profiled compiler2 <os>_<arch>_compiler2/profiled
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# product compiler2 <os>_<arch>_compiler2/product
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# debug1 compiler1 <os>_<arch>_compiler1/debug
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
ea206aebcafe1ed5d470dd99daab9a1cedc81c7cMark Andrews# optimized1 compiler1 <os>_<arch>_compiler1/optimized
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# profiled1 compiler1 <os>_<arch>_compiler1/profiled
ca12f7f4cf72e2368ee946f3eb4915ab73576cdcMark Andrews# product1 compiler1 <os>_<arch>_compiler1/product
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# debugcore core <os>_<arch>_core/debug
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# fastdebugcore core <os>_<arch>_core/fastdebug
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# jvmgcore core <os>_<arch>_core/jvmg
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# optimizedcore core <os>_<arch>_core/optimized
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# profiledcore core <os>_<arch>_core/profiled
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# productcore core <os>_<arch>_core/product
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# What you get with each target:
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# fastdebug* - optimized compile, but with asserts enabled
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# optimized* - optimized compile, no asserts
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# profiled* - gprof
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# This target list needs to be coordinated with the usage message
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# in the build.sh script:
5752b9e296f14034f103149f18188770c2cc5239Mark AndrewsTARGETS = debug jvmg fastdebug optimized profiled product
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsSUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsSUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsSUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsSUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonBUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonBUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsBUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#-------------------------------------------------------------------------------
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Could make everything by default, but that would take a while.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Solaris 2.5.1, 2.6).
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# jvmti.make requires XSLT (J2SE 1.4.x or newer):
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonXSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# If not found then fail fast.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Just build the tree, and nothing else:
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Doc target. This is the same for all build options.
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# Hence create a docs directory beside ...$(ARCH)_[...]
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# Synonyms for win32-like targets.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonclean: clean_compiler2 clean_compiler1 clean_core clean_docs
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtoninclude $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#-------------------------------------------------------------------------------
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs