Makefile revision 1703
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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# 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,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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.
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# 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# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDI binding on SA produces two binaries:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# 1. sa-jdi.jar - This is build before building libjvm[_g].so
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Please refer to ./makefiles/sa.make
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# 2. libsaproc[_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
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# If $(GAMMADIR)/agent dir is not present, SA components are not built.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# 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:
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# * It is extremely rare that source trees exist on other systems
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# * It has been claimed that the Linux automounter is flakey, so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# changing GAMMADIR in a way that exercises the automounter could
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# prove to be a source of unreliability in the build process.
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Obviously, this Makefile is only relevant on SunOS boxes to begin
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# with, but the SunOS conditionalization will make it easier to
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# combine Makefiles in the future (assuming we ever do that).
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User # prepend current directory to relative pathnames.
77dccf2a5d9327d16b4374a135cdb99bdd48620eAutomatic Updater # If NEW_GAMMADIR doesn't already start with "/net/":
77dccf2a5d9327d16b4374a135cdb99bdd48620eAutomatic Updater ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews # prepend /net/$(HOST)
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews # remove /net/$(HOST) if name already began with /home/
ac93437301f55ed69bf85883a497a75598c628f9Automatic Updater # remove /net/$(HOST) if name already began with /java/
ac93437301f55ed69bf85883a497a75598c628f9Automatic Updater # remove /net/$(HOST) if name already began with /lab/
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce # Don't use the new value for GAMMADIR unless a file with the new
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce # name actually exists.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# There is a (semi-) regular correspondence between make targets and actions:
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Target Tree Type Build Dir
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# debug compiler2 <os>_<arch>_compiler2/debug
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# jvmg compiler2 <os>_<arch>_compiler2/jvmg
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# optimized compiler2 <os>_<arch>_compiler2/optimized
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# profiled compiler2 <os>_<arch>_compiler2/profiled
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# product compiler2 <os>_<arch>_compiler2/product
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# debug1 compiler1 <os>_<arch>_compiler1/debug
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# optimized1 compiler1 <os>_<arch>_compiler1/optimized
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# profiled1 compiler1 <os>_<arch>_compiler1/profiled
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# product1 compiler1 <os>_<arch>_compiler1/product
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# debugcore core <os>_<arch>_core/debug
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# fastdebugcore core <os>_<arch>_core/fastdebug
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# jvmgcore core <os>_<arch>_core/jvmg
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# optimizedcore core <os>_<arch>_core/optimized
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# profiledcore core <os>_<arch>_core/profiled
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# productcore core <os>_<arch>_core/product
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# What you get with each target:
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# fastdebug* - optimized compile, but with asserts enabled
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# optimized* - optimized compile, no asserts
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# profiled* - gprof
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# This target list needs to be coordinated with the usage message
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# in the build.sh script:
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserTARGETS = debug jvmg fastdebug optimized profiled product
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserSUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserSUBDIRS_KERNEL = $(addprefix $(OSNAME)_$(BUILDARCH)_kernel/,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserTARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserTARGETS_KERNEL = $(addsuffix kernel,$(TARGETS))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User#-------------------------------------------------------------------------------
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Could make everything by default, but that would take a while.
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Solaris 2.5.1, 2.6).
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox Userifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# jvmti.make requires XSLT (J2SE 1.4.x or newer):
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox UserXSLT_CHECK = $(RUN.JAVAP) javax.xml.transform.TransformerFactory
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# If not found then fail fast.
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
aa1905addf2f33d90aa020080e4e77a8651e829aTinderbox User cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && ./test_gamma
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS) install
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Just build the tree, and nothing else:
56bd026e6c96482dccab83778bf8f9c92c36bf11Tinderbox User# Doc target. This is the same for all build options.
56bd026e6c96482dccab83778bf8f9c92c36bf11Tinderbox User# Hence create a docs directory beside ...$(ARCH)_[...]
56bd026e6c96482dccab83778bf8f9c92c36bf11Tinderbox User $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
56bd026e6c96482dccab83778bf8f9c92c36bf11Tinderbox User# Synonyms for win32-like targets.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinclean_compiler1 clean_compiler2 clean_core clean_kernel:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinclean: clean_compiler2 clean_compiler1 clean_core clean_docs clean_kernel
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userinclude $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#-------------------------------------------------------------------------------
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs