1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/defs.make Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,262 @@ 1.4 +# 1.5 +# Copyright 2006-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 +# The common definitions for hotspot builds. 1.29 + 1.30 +# Default to verbose build logs (show all compile lines): 1.31 +MAKE_VERBOSE=y 1.32 + 1.33 +# Make macros for install files or preparing targets 1.34 +CD=cd 1.35 +CP=cp 1.36 +ECHO=echo 1.37 +GREP=grep 1.38 +MKDIR=mkdir 1.39 +MV=mv 1.40 +PWD=pwd 1.41 +RM=rm -f 1.42 +SED=sed 1.43 +TAR=tar 1.44 +ZIPEXE=zip 1.45 + 1.46 +define install-file 1.47 +@$(MKDIR) -p $(@D) 1.48 +@$(RM) $@ 1.49 +$(CP) $< $@ 1.50 +endef 1.51 +define prep-target 1.52 +@$(MKDIR) -p $(@D) 1.53 +@$(RM) $@ 1.54 +endef 1.55 + 1.56 +# Directory paths and user name 1.57 +# Unless GAMMADIR is set on the command line, search upward from 1.58 +# the current directory for a parent directory containing "src/share/vm". 1.59 +# If that fails, look for $GAMMADIR in the environment. 1.60 +# When the tree of subdirs is built, this setting is stored in each flags.make. 1.61 +GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) 1.62 +HS_SRC_DIR=$(GAMMADIR)/src 1.63 +HS_BUILD_DIR=$(GAMMADIR)/build 1.64 + 1.65 +ifeq ($(USER),) 1.66 + USER=$(USERNAME) 1.67 +endif 1.68 + 1.69 +# hotspot version definitions 1.70 +include $(GAMMADIR)/make/hotspot_version 1.71 + 1.72 +# Java versions needed 1.73 +ifeq ($(PREVIOUS_JDK_VERSION),) 1.74 + PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION) 1.75 +endif 1.76 +ifeq ($(JDK_MAJOR_VERSION),) 1.77 + JDK_MAJOR_VERSION=$(JDK_MAJOR_VER) 1.78 +endif 1.79 +ifeq ($(JDK_MINOR_VERSION),) 1.80 + JDK_MINOR_VERSION=$(JDK_MINOR_VER) 1.81 +endif 1.82 +ifeq ($(JDK_MICRO_VERSION),) 1.83 + JDK_MICRO_VERSION=$(JDK_MICRO_VER) 1.84 +endif 1.85 +ifeq ($(JDK_MKTG_VERSION),) 1.86 + JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 1.87 +endif 1.88 +ifeq ($(JDK_VERSION),) 1.89 + JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 1.90 +endif 1.91 +ifeq ($(FULL_VERSION),) 1.92 + FULL_VERSION="$(JDK_VERSION)" 1.93 +endif 1.94 + 1.95 +# FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used 1.96 +# as JRE version in VM -Xinternalversion output. 1.97 +ifndef JRE_RELEASE_VERSION 1.98 + JRE_RELEASE_VERSION=$(FULL_VERSION) 1.99 +endif 1.100 + 1.101 +ifndef HOTSPOT_RELEASE_VERSION 1.102 + HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER) 1.103 +endif 1.104 + 1.105 +ifdef HOTSPOT_BUILD_VERSION 1.106 +# specified in command line (PRT build) 1.107 +else 1.108 + ifdef JPRT_BUILD_VERSION 1.109 +# JPR build 1.110 + HOTSPOT_BUILD_VERSION=$(JPRT_BUILD_VERSION) 1.111 + else 1.112 + ifdef COOKED_BUILD_NUMBER 1.113 +# JRE build 1.114 + HOTSPOT_BUILD_VERSION= 1.115 + else 1.116 + HOTSPOT_BUILD_VERSION=internal 1.117 + endif 1.118 + endif 1.119 +endif 1.120 + 1.121 +# Windows should have OS predefined 1.122 +ifeq ($(OS),) 1.123 + OS := $(shell uname -s) 1.124 + HOST := $(shell uname -n) 1.125 +endif 1.126 + 1.127 +# If not SunOS and not Linux, assume Windows 1.128 +ifneq ($(OS), Linux) 1.129 + ifneq ($(OS), SunOS) 1.130 + OSNAME=windows 1.131 + else 1.132 + OSNAME=solaris 1.133 + endif 1.134 +else 1.135 + OSNAME=linux 1.136 +endif 1.137 + 1.138 +# Determinations of default make arguments and platform specific settings 1.139 +MAKE_ARGS= 1.140 + 1.141 +# ARCH_DATA_MODEL==64 is equivalent to LP64=1 1.142 +ifeq ($(ARCH_DATA_MODEL), 64) 1.143 + ifndef LP64 1.144 + LP64 := 1 1.145 + endif 1.146 +endif 1.147 + 1.148 +# Defaults set for product build 1.149 +EXPORT_SUBDIR= 1.150 + 1.151 +# Change default /java path if requested 1.152 +ifneq ($(ALT_SLASH_JAVA),) 1.153 + SLASH_JAVA=$(ALT_SLASH_JAVA) 1.154 +endif 1.155 + 1.156 +# Default OUTPUTDIR 1.157 +OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME) 1.158 +ifneq ($(ALT_OUTPUTDIR),) 1.159 + OUTPUTDIR=$(ALT_OUTPUTDIR) 1.160 +endif 1.161 + 1.162 +# Find latest promoted JDK area 1.163 +JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM) 1.164 +ifneq ($(ALT_JDK_IMPORT_PATH),) 1.165 + JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) 1.166 +endif 1.167 + 1.168 +# Find JDK used for javac compiles 1.169 +BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) 1.170 +ifneq ($(ALT_BOOTDIR),) 1.171 + BOOTDIR=$(ALT_BOOTDIR) 1.172 +endif 1.173 + 1.174 +# The platform dependent defs.make defines platform specific variable such 1.175 +# as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined. 1.176 +include $(GAMMADIR)/build/$(OSNAME)/makefiles/defs.make 1.177 + 1.178 +# We are trying to put platform specific defintions 1.179 +# files to build/$(OSNAME)/makefiles dictory. However 1.180 +# some definitions are common for both linux and solaris, 1.181 +# so we put them here. 1.182 +ifneq ($(OSNAME),windows) 1.183 + ABS_OUTPUTDIR := $(shell $(CD) $(OUTPUTDIR); $(PWD)) 1.184 + ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD)) 1.185 + ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD)) 1.186 + ABS_OS_MAKEFILE := $(shell $(CD) $(HS_BUILD_DIR)/$(OSNAME); $(PWD))/Makefile 1.187 + 1.188 + # uname, HotSpot source directory, build directory and JDK use different names 1.189 + # for CPU architectures. 1.190 + # ARCH - uname output 1.191 + # SRCARCH - where to find HotSpot cpu and os_cpu source files 1.192 + # BUILDARCH - build directory 1.193 + # LIBARCH - directory name in JDK/JRE 1.194 + 1.195 + # Use uname output for SRCARCH, but deal with platform differences. If ARCH 1.196 + # is not explicitly listed below, it is treated as x86. 1.197 + SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64,$(ARCH))) 1.198 + ARCH/ = x86 1.199 + ARCH/sparc = sparc 1.200 + ARCH/sparc64= sparc 1.201 + ARCH/ia64 = ia64 1.202 + ARCH/amd64 = x86 1.203 + ARCH/x86_64 = x86 1.204 + 1.205 + # BUILDARCH is usually the same as SRCARCH, except for sparcv9 1.206 + BUILDARCH = $(SRCARCH) 1.207 + ifeq ($(BUILDARCH), x86) 1.208 + ifdef LP64 1.209 + BUILDARCH = amd64 1.210 + else 1.211 + BUILDARCH = i486 1.212 + endif 1.213 + endif 1.214 + ifeq ($(BUILDARCH), sparc) 1.215 + ifdef LP64 1.216 + BUILDARCH = sparcv9 1.217 + endif 1.218 + endif 1.219 + 1.220 + # LIBARCH is 1:1 mapping from BUILDARCH 1.221 + LIBARCH = $(LIBARCH/$(BUILDARCH)) 1.222 + LIBARCH/i486 = i386 1.223 + LIBARCH/amd64 = amd64 1.224 + LIBARCH/sparc = sparc 1.225 + LIBARCH/sparcv9 = sparcv9 1.226 + LIBARCH/ia64 = ia64 1.227 + 1.228 + LP64_ARCH = sparcv9 amd64 ia64 1.229 +endif 1.230 + 1.231 +# Required make macro settings for all platforms 1.232 +MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR) 1.233 +MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR) 1.234 +MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE) 1.235 +MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) 1.236 +MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 1.237 + 1.238 +# Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile 1.239 +# to overwrite the default definition since OS specific Makefile also 1.240 +# includes this make/defs.make file. 1.241 +MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) 1.242 + 1.243 +# Select name of export directory 1.244 +EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR) 1.245 +ifneq ($(ALT_EXPORT_PATH),) 1.246 + EXPORT_PATH=$(ALT_EXPORT_PATH) 1.247 +endif 1.248 + 1.249 +# Default jdk image if one is created for you with create_jdk 1.250 +JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM) 1.251 + 1.252 +# Various export sub directories 1.253 +EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include 1.254 +EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs 1.255 +EXPORT_LIB_DIR = $(EXPORT_PATH)/lib 1.256 +EXPORT_JRE_DIR = $(EXPORT_PATH)/jre 1.257 +EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin 1.258 +EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib 1.259 +EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) 1.260 + 1.261 +# Common export list of files 1.262 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h 1.263 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h 1.264 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h 1.265 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h