1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/linux/Makefile Wed Apr 09 14:22:48 2008 -0400 1.3 @@ -0,0 +1,312 @@ 1.4 +# 1.5 +# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.24 +# have any questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# This makefile creates a build tree and lights off a build. 1.29 +# You can go back into the build tree and perform rebuilds or 1.30 +# incremental builds as desired. Be sure to reestablish 1.31 +# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME. 1.32 + 1.33 +# The make process now relies on java and javac. These can be 1.34 +# specified either implicitly on the PATH, by setting the 1.35 +# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a 1.36 +# JDK in which bin/java and bin/javac are present and working (e.g., 1.37 +# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited) 1.38 +# default BOOTDIR path value. Note that one of ALT_BOOTDIR 1.39 +# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc. 1.40 +# from the PATH. 1.41 +# 1.42 +# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on 1.43 +# an architecture that differs from the target architecture, as long 1.44 +# as the bootstrap jdk runs under the same flavor of OS as the target 1.45 +# (i.e., if the target is linux, point to a jdk that runs on a linux 1.46 +# box). In order to use such a bootstrap jdk, set the make variable 1.47 +# REMOTE to the desired remote command mechanism, e.g., 1.48 +# 1.49 +# make REMOTE="rsh -l me myotherlinuxbox" 1.50 + 1.51 +# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding. 1.52 +# JDI binding on SA produces two binaries: 1.53 +# 1. sa-jdi.jar - This is build before building libjvm[_g].so 1.54 +# Please refer to ./makefiles/sa.make 1.55 +# 2. libsa[_g].so - Native library for SA - This is built after 1.56 +# libjsig[_g].so (signal interposition library) 1.57 +# Please refer to ./makefiles/vm.make 1.58 +# If $(GAMMADIR)/agent dir is not present, SA components are not built. 1.59 + 1.60 +ifeq ($(GAMMADIR),) 1.61 +include ../../make/defs.make 1.62 +else 1.63 +include $(GAMMADIR)/make/defs.make 1.64 +endif 1.65 +include $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make 1.66 + 1.67 +ifndef LP64 1.68 +ifndef CC_INTERP 1.69 +FORCE_TIERED=1 1.70 +endif 1.71 +endif 1.72 + 1.73 +ifdef LP64 1.74 + ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") 1.75 + _JUNK_ := $(shell echo >&2 \ 1.76 + $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!") 1.77 + @exit 1 1.78 + endif 1.79 +endif 1.80 + 1.81 +# we need to set up LP64 correctly to satisfy sanity checks in adlc 1.82 +ifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") 1.83 + MFLAGS += " LP64=1 " 1.84 +endif 1.85 + 1.86 +# pass USE_SUNCC further, through MFLAGS 1.87 +ifdef USE_SUNCC 1.88 + MFLAGS += " USE_SUNCC=1 " 1.89 +endif 1.90 + 1.91 +# The following renders pathnames in generated Makefiles valid on 1.92 +# machines other than the machine containing the build tree. 1.93 +# 1.94 +# For example, let's say my build tree lives on /files12 on 1.95 +# exact.east.sun.com. This logic will cause GAMMADIR to begin with 1.96 +# /net/exact/files12/... 1.97 +# 1.98 +# We only do this on SunOS variants, for a couple of reasons: 1.99 +# * It is extremely rare that source trees exist on other systems 1.100 +# * It has been claimed that the Linux automounter is flakey, so 1.101 +# changing GAMMADIR in a way that exercises the automounter could 1.102 +# prove to be a source of unreliability in the build process. 1.103 +# Obviously, this Makefile is only relevant on SunOS boxes to begin 1.104 +# with, but the SunOS conditionalization will make it easier to 1.105 +# combine Makefiles in the future (assuming we ever do that). 1.106 + 1.107 +ifeq ($(OSNAME),solaris) 1.108 + 1.109 + # prepend current directory to relative pathnames. 1.110 + NEW_GAMMADIR := \ 1.111 + $(shell echo $(GAMMADIR) | \ 1.112 + sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \ 1.113 + ) 1.114 + unexport NEW_GAMMADIR 1.115 + 1.116 + # If NEW_GAMMADIR doesn't already start with "/net/": 1.117 + ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),) 1.118 + # prepend /net/$(HOST) 1.119 + # remove /net/$(HOST) if name already began with /home/ 1.120 + # remove /net/$(HOST) if name already began with /java/ 1.121 + # remove /net/$(HOST) if name already began with /lab/ 1.122 + NEW_GAMMADIR := \ 1.123 + $(shell echo $(NEW_GAMMADIR) | \ 1.124 + sed -e "s=^\(.*\)=/net/$(HOST)\1=" \ 1.125 + -e "s=^/net/$(HOST)/home/=/home/=" \ 1.126 + -e "s=^/net/$(HOST)/java/=/java/=" \ 1.127 + -e "s=^/net/$(HOST)/lab/=/lab/=" \ 1.128 + ) 1.129 + # Don't use the new value for GAMMADIR unless a file with the new 1.130 + # name actually exists. 1.131 + ifneq ($(wildcard $(NEW_GAMMADIR)),) 1.132 + GAMMADIR := $(NEW_GAMMADIR) 1.133 + endif 1.134 + endif 1.135 + 1.136 +endif 1.137 + 1.138 + 1.139 +# There is a (semi-) regular correspondence between make targets and actions: 1.140 +# 1.141 +# Target Tree Type Build Dir 1.142 +# 1.143 +# debug compiler2 <os>_<arch>_compiler2/debug 1.144 +# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug 1.145 +# jvmg compiler2 <os>_<arch>_compiler2/jvmg 1.146 +# optimized compiler2 <os>_<arch>_compiler2/optimized 1.147 +# profiled compiler2 <os>_<arch>_compiler2/profiled 1.148 +# product compiler2 <os>_<arch>_compiler2/product 1.149 +# 1.150 +# debug1 compiler1 <os>_<arch>_compiler1/debug 1.151 +# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug 1.152 +# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg 1.153 +# optimized1 compiler1 <os>_<arch>_compiler1/optimized 1.154 +# profiled1 compiler1 <os>_<arch>_compiler1/profiled 1.155 +# product1 compiler1 <os>_<arch>_compiler1/product 1.156 +# 1.157 +# debugcore core <os>_<arch>_core/debug 1.158 +# fastdebugcore core <os>_<arch>_core/fastdebug 1.159 +# jvmgcore core <os>_<arch>_core/jvmg 1.160 +# optimizedcore core <os>_<arch>_core/optimized 1.161 +# profiledcore core <os>_<arch>_core/profiled 1.162 +# productcore core <os>_<arch>_core/product 1.163 +# 1.164 +# What you get with each target: 1.165 +# 1.166 +# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher 1.167 +# fastdebug* - optimized compile, but with asserts enabled 1.168 +# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so 1.169 +# optimized* - optimized compile, no asserts 1.170 +# profiled* - gprof 1.171 +# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT 1.172 + 1.173 +# This target list needs to be coordinated with the usage message 1.174 +# in the build.sh script: 1.175 +TARGETS = debug jvmg fastdebug optimized profiled product 1.176 + 1.177 +SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs 1.178 +SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS)) 1.179 +SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS)) 1.180 +SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS)) 1.181 +SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS)) 1.182 + 1.183 +TARGETS_C2 = $(TARGETS) 1.184 +TARGETS_C1 = $(addsuffix 1,$(TARGETS)) 1.185 +TARGETS_TIERED = $(addsuffix tiered,$(TARGETS)) 1.186 +TARGETS_CORE = $(addsuffix core,$(TARGETS)) 1.187 + 1.188 +BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make 1.189 +BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) 1.190 +BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 1.191 + 1.192 +BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS) 1.193 + 1.194 +#------------------------------------------------------------------------------- 1.195 + 1.196 +# Could make everything by default, but that would take a while. 1.197 +all: 1.198 + @echo "Try '$(MAKE) <target> ...' where <target> is one or more of" 1.199 + @echo " $(TARGETS_C2)" 1.200 + @echo " $(TARGETS_C1)" 1.201 + @echo " $(TARGETS_CORE)" 1.202 + 1.203 +checks: check_os_version check_j2se_version 1.204 + 1.205 +# We do not want people accidentally building on old systems (e.g. Linux 2.2.x, 1.206 +# Solaris 2.5.1, 2.6). 1.207 +# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok. 1.208 + 1.209 +SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7% 1.210 +OS_VERSION := $(shell uname -r) 1.211 +EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION)) 1.212 + 1.213 +check_os_version: 1.214 +ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),) 1.215 + $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1; 1.216 +endif 1.217 + 1.218 +# jvmti.make requires XSLT (J2SE 1.4.x or newer): 1.219 +XSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory 1.220 +# If not found then fail fast. 1.221 +check_j2se_version: 1.222 + $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \ 1.223 + if [ $$? -ne 0 ]; then \ 1.224 + $(REMOTE) $(RUN.JAVA) -version; \ 1.225 + echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ 1.226 + "to bootstrap this build" 1>&2; \ 1.227 + exit 1; \ 1.228 + fi 1.229 + 1.230 +$(SUBDIRS_TIERED): $(BUILDTREE_MAKE) 1.231 + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks 1.232 + $(BUILDTREE) VARIANT=tiered 1.233 + 1.234 +$(SUBDIRS_C2): $(BUILDTREE_MAKE) 1.235 +ifdef FORCE_TIERED 1.236 + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks 1.237 + $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1 1.238 +else 1.239 + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks 1.240 + $(BUILDTREE) VARIANT=compiler2 1.241 +endif 1.242 + 1.243 +$(SUBDIRS_C1): $(BUILDTREE_MAKE) 1.244 + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks 1.245 + $(BUILDTREE) VARIANT=compiler1 1.246 + 1.247 +$(SUBDIRS_CORE): $(BUILDTREE_MAKE) 1.248 + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks 1.249 + $(BUILDTREE) VARIANT=core 1.250 + 1.251 +# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME 1.252 + 1.253 +$(TARGETS_C2): $(SUBDIRS_C2) 1.254 + cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) 1.255 + cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma 1.256 +ifdef INSTALL 1.257 + cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install 1.258 +endif 1.259 + 1.260 +$(TARGETS_TIERED): $(SUBDIRS_TIERED) 1.261 + cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) 1.262 + cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma 1.263 +ifdef INSTALL 1.264 + cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install 1.265 +endif 1.266 + 1.267 +$(TARGETS_C1): $(SUBDIRS_C1) 1.268 + cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) 1.269 + cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma 1.270 +ifdef INSTALL 1.271 + cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install 1.272 +endif 1.273 + 1.274 +$(TARGETS_CORE): $(SUBDIRS_CORE) 1.275 + cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) 1.276 + cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma 1.277 +ifdef INSTALL 1.278 + cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install 1.279 +endif 1.280 + 1.281 +# Just build the tree, and nothing else: 1.282 +tree: $(SUBDIRS_C2) 1.283 +tree1: $(SUBDIRS_C1) 1.284 +treecore: $(SUBDIRS_CORE) 1.285 + 1.286 +# Doc target. This is the same for all build options. 1.287 +# Hence create a docs directory beside ...$(ARCH)_[...] 1.288 +docs: checks 1.289 + $(QUIETLY) mkdir -p $(SUBDIR_DOCS) 1.290 + $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs 1.291 + 1.292 +# Synonyms for win32-like targets. 1.293 +compiler2: jvmg product 1.294 + 1.295 +compiler1: jvmg1 product1 1.296 + 1.297 +core: jvmgcore productcore 1.298 + 1.299 +clean_docs: 1.300 + rm -rf $(SUBDIR_DOCS) 1.301 + 1.302 +clean_compiler1 clean_compiler2 clean_core: 1.303 + rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@) 1.304 + 1.305 +clean: clean_compiler2 clean_compiler1 clean_core clean_docs 1.306 + 1.307 +include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make 1.308 + 1.309 +#------------------------------------------------------------------------------- 1.310 + 1.311 +.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) 1.312 +.PHONY: tree tree1 treecore 1.313 +.PHONY: all compiler1 compiler2 core 1.314 +.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs 1.315 +.PHONY: checks check_os_version check_j2se_version