1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/defs.make Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,360 @@ 1.4 +# 1.5 +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 +# or visit www.oracle.com if you need additional information or have any 1.24 +# questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# The common definitions for hotspot builds. 1.29 + 1.30 +# Optionally include SPEC file generated by configure. 1.31 +ifneq ($(SPEC),) 1.32 + include $(SPEC) 1.33 +endif 1.34 + 1.35 +# Directory paths and user name 1.36 +# Unless GAMMADIR is set on the command line, search upward from 1.37 +# the current directory for a parent directory containing "src/share/vm". 1.38 +# If that fails, look for $GAMMADIR in the environment. 1.39 +# When the tree of subdirs is built, this setting is stored in each flags.make. 1.40 +GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) 1.41 +HS_SRC_DIR=$(GAMMADIR)/src 1.42 +HS_MAKE_DIR=$(GAMMADIR)/make 1.43 +HS_BUILD_DIR=$(GAMMADIR)/build 1.44 + 1.45 +ifeq ($(USER),) 1.46 + USER=$(USERNAME) 1.47 +endif 1.48 + 1.49 +ifeq ($(HS_ALT_MAKE),) 1.50 + ifneq ($(OPENJDK),true) 1.51 + HS_ALT_MAKE=$(GAMMADIR)/make/closed 1.52 + else 1.53 + HS_ALT_MAKE=NO_SUCH_PATH 1.54 + endif 1.55 +endif 1.56 + 1.57 +# 1.58 +# Include alternate defs.make if it exists 1.59 +# 1.60 +-include $(HS_ALT_MAKE)/defs.make 1.61 + 1.62 +# Default to verbose build logs (show all compile lines): 1.63 +MAKE_VERBOSE=y 1.64 + 1.65 +# Make macros for install files or preparing targets 1.66 +CD=cd 1.67 +CP=cp 1.68 +ECHO=echo 1.69 +GREP=grep 1.70 +MKDIR=mkdir 1.71 +MV=mv 1.72 +PWD=pwd 1.73 +RM=rm -f 1.74 +SED=sed 1.75 +TAR=tar 1.76 +ZIPEXE=zip 1.77 + 1.78 +define install-file 1.79 +@$(MKDIR) -p $(@D) 1.80 +@$(RM) $@ 1.81 +$(CP) $< $@ 1.82 +endef 1.83 + 1.84 +# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead. 1.85 +# May need to have a MacOS X specific definition of install-dir 1.86 +# sometime in the future. 1.87 +define install-dir 1.88 +@$(MKDIR) -p $(@D) 1.89 +@$(RM) -r $@ 1.90 +$(CP) -r $< $@ 1.91 +endef 1.92 + 1.93 +define prep-target 1.94 +@$(MKDIR) -p $(@D) 1.95 +@$(RM) $@ 1.96 +endef 1.97 + 1.98 +# Default values for JVM_VARIANT* variables if configure hasn't set 1.99 +# it already. 1.100 +ifeq ($(JVM_VARIANTS),) 1.101 + ifeq ($(ZERO_BUILD), true) 1.102 + ifeq ($(SHARK_BUILD), true) 1.103 + JVM_VARIANTS:=zeroshark 1.104 + JVM_VARIANT_ZEROSHARK:=true 1.105 + else 1.106 + JVM_VARIANTS:=zero 1.107 + JVM_VARIANT_ZERO:=true 1.108 + endif 1.109 + else 1.110 + # A default is needed 1.111 + ifeq ($(BUILD_CLIENT_ONLY), true) 1.112 + JVM_VARIANTS:=client 1.113 + JVM_VARIANT_CLIENT:=true 1.114 + endif 1.115 + # Further defaults are platform and arch specific 1.116 + endif 1.117 +endif 1.118 + 1.119 +# hotspot version definitions 1.120 +include $(GAMMADIR)/make/hotspot_version 1.121 + 1.122 +# Java versions needed 1.123 +ifeq ($(PREVIOUS_JDK_VERSION),) 1.124 + PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION) 1.125 +endif 1.126 +ifeq ($(JDK_MAJOR_VERSION),) 1.127 + JDK_MAJOR_VERSION=$(JDK_MAJOR_VER) 1.128 +endif 1.129 +ifeq ($(JDK_MINOR_VERSION),) 1.130 + JDK_MINOR_VERSION=$(JDK_MINOR_VER) 1.131 +endif 1.132 +ifeq ($(JDK_MICRO_VERSION),) 1.133 + JDK_MICRO_VERSION=$(JDK_MICRO_VER) 1.134 +endif 1.135 +ifeq ($(JDK_MKTG_VERSION),) 1.136 + JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 1.137 +endif 1.138 +ifeq ($(JDK_VERSION),) 1.139 + JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 1.140 +endif 1.141 +ifeq ($(FULL_VERSION),) 1.142 + FULL_VERSION="$(JDK_VERSION)" 1.143 +endif 1.144 + 1.145 +# FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used 1.146 +# as JRE version in VM -Xinternalversion output. 1.147 +ifndef JRE_RELEASE_VERSION 1.148 + JRE_RELEASE_VERSION=$(FULL_VERSION) 1.149 +endif 1.150 + 1.151 +ifndef HOTSPOT_RELEASE_VERSION 1.152 + HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER) 1.153 +endif 1.154 + 1.155 +ifdef HOTSPOT_BUILD_VERSION 1.156 +# specified in command line 1.157 +else 1.158 + ifdef COOKED_BUILD_NUMBER 1.159 +# JRE build 1.160 + HOTSPOT_BUILD_VERSION= 1.161 + else 1.162 + ifdef USER_RELEASE_SUFFIX 1.163 + HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX) 1.164 + else 1.165 + HOTSPOT_BUILD_VERSION=internal 1.166 + endif 1.167 + endif 1.168 +endif 1.169 + 1.170 +# Windows should have OS predefined 1.171 +ifeq ($(OS),) 1.172 + OS := $(shell uname -s) 1.173 + ifneq ($(findstring BSD,$(OS)),) 1.174 + OS=bsd 1.175 + endif 1.176 + ifeq ($(OS), Darwin) 1.177 + OS=bsd 1.178 + endif 1.179 + HOST := $(shell uname -n) 1.180 +endif 1.181 + 1.182 +# If not SunOS, not Linux not BSD and not AIX, assume Windows 1.183 +ifneq ($(OS), Linux) 1.184 + ifneq ($(OS), SunOS) 1.185 + ifneq ($(OS), bsd) 1.186 + ifneq ($(OS), AIX) 1.187 + OSNAME=windows 1.188 + else 1.189 + OSNAME=aix 1.190 + endif 1.191 + else 1.192 + OSNAME=bsd 1.193 + endif 1.194 + else 1.195 + OSNAME=solaris 1.196 + endif 1.197 +else 1.198 + OSNAME=linux 1.199 +endif 1.200 + 1.201 +# Determinations of default make arguments and platform specific settings 1.202 +MAKE_ARGS= 1.203 + 1.204 +# ARCH_DATA_MODEL==64 is equivalent to LP64=1 1.205 +ifeq ($(ARCH_DATA_MODEL), 64) 1.206 + ifndef LP64 1.207 + LP64 := 1 1.208 + endif 1.209 +endif 1.210 + 1.211 +# Defaults set for product build 1.212 +EXPORT_SUBDIR= 1.213 + 1.214 +# Change default /java path if requested 1.215 +ifneq ($(ALT_SLASH_JAVA),) 1.216 + SLASH_JAVA=$(ALT_SLASH_JAVA) 1.217 +endif 1.218 + 1.219 +# Default OUTPUTDIR 1.220 +OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME) 1.221 +ifneq ($(ALT_OUTPUTDIR),) 1.222 + OUTPUTDIR=$(ALT_OUTPUTDIR) 1.223 +endif 1.224 + 1.225 +# Find latest promoted JDK area 1.226 +JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM) 1.227 +ifneq ($(ALT_JDK_IMPORT_PATH),) 1.228 + JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) 1.229 +endif 1.230 + 1.231 +# Other parts of JDK build may require an import JDK that can be executed 1.232 +# on the build host. For cross-compile builds we also need an import JDK 1.233 +# that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH 1.234 +ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),) 1.235 + JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH) 1.236 +endif 1.237 + 1.238 +# Find JDK used for javac compiles 1.239 +BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) 1.240 +ifneq ($(ALT_BOOTDIR),) 1.241 + BOOTDIR=$(ALT_BOOTDIR) 1.242 +endif 1.243 + 1.244 +# Select name of the export directory and honor ALT overrides 1.245 +EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR) 1.246 +ifneq ($(ALT_EXPORT_PATH),) 1.247 + EXPORT_PATH=$(ALT_EXPORT_PATH) 1.248 +endif 1.249 + 1.250 +# Default jdk image if one is created for you with create_jdk 1.251 +JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM) 1.252 +ifneq ($(ALT_JDK_IMAGE_DIR),) 1.253 + JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR) 1.254 +endif 1.255 + 1.256 +# The platform dependent defs.make defines platform specific variable such 1.257 +# as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined. 1.258 +include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make 1.259 + 1.260 +# We are trying to put platform specific defintions 1.261 +# files to make/$(OSNAME)/makefiles dictory. However 1.262 +# some definitions are common for both linux and solaris, 1.263 +# so we put them here. 1.264 +ifneq ($(OSNAME),windows) 1.265 + ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD)) 1.266 + ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD)) 1.267 + ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD)) 1.268 + ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile 1.269 + 1.270 + # uname, HotSpot source directory, build directory and JDK use different names 1.271 + # for CPU architectures. 1.272 + # ARCH - uname output 1.273 + # SRCARCH - where to find HotSpot cpu and os_cpu source files 1.274 + # BUILDARCH - build directory 1.275 + # LIBARCH - directory name in JDK/JRE 1.276 + 1.277 + # Use uname output for SRCARCH, but deal with platform differences. If ARCH 1.278 + # is not explicitly listed below, it is treated as x86. 1.279 + SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc ppc64 zero,$(ARCH))) 1.280 + ARCH/ = x86 1.281 + ARCH/sparc = sparc 1.282 + ARCH/sparc64= sparc 1.283 + ARCH/ia64 = ia64 1.284 + ARCH/amd64 = x86 1.285 + ARCH/x86_64 = x86 1.286 + ARCH/ppc64 = ppc 1.287 + ARCH/ppc = ppc 1.288 + ARCH/arm = arm 1.289 + ARCH/zero = zero 1.290 + 1.291 + # BUILDARCH is usually the same as SRCARCH, except for sparcv9 1.292 + BUILDARCH = $(SRCARCH) 1.293 + ifeq ($(BUILDARCH), x86) 1.294 + ifdef LP64 1.295 + BUILDARCH = amd64 1.296 + else 1.297 + BUILDARCH = i486 1.298 + endif 1.299 + endif 1.300 + ifeq ($(BUILDARCH), sparc) 1.301 + ifdef LP64 1.302 + BUILDARCH = sparcv9 1.303 + endif 1.304 + endif 1.305 + ifeq ($(BUILDARCH), ppc) 1.306 + ifdef LP64 1.307 + BUILDARCH = ppc64 1.308 + endif 1.309 + endif 1.310 + 1.311 + # LIBARCH is 1:1 mapping from BUILDARCH 1.312 + LIBARCH = $(LIBARCH/$(BUILDARCH)) 1.313 + LIBARCH/i486 = i386 1.314 + LIBARCH/amd64 = amd64 1.315 + LIBARCH/sparc = sparc 1.316 + LIBARCH/sparcv9 = sparcv9 1.317 + LIBARCH/ia64 = ia64 1.318 + LIBARCH/ppc64 = ppc64 1.319 + LIBARCH/ppc = ppc 1.320 + LIBARCH/arm = arm 1.321 + LIBARCH/zero = $(ZERO_LIBARCH) 1.322 + 1.323 + LP64_ARCH = sparcv9 amd64 ia64 ppc64 zero 1.324 +endif 1.325 + 1.326 +# Required make macro settings for all platforms 1.327 +MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR) 1.328 +MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR) 1.329 +MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR) 1.330 +MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE) 1.331 +MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) 1.332 +MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 1.333 + 1.334 +# Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile 1.335 +# to overwrite the default definition since OS specific Makefile also 1.336 +# includes this make/defs.make file. 1.337 +MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) 1.338 + 1.339 +# Various export sub directories 1.340 +EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include 1.341 +EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs 1.342 +EXPORT_LIB_DIR = $(EXPORT_PATH)/lib 1.343 +EXPORT_JRE_DIR = $(EXPORT_PATH)/jre 1.344 +EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin 1.345 +EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib 1.346 +EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) 1.347 + 1.348 +# non-universal macosx builds need to appear universal 1.349 +ifeq ($(OS_VENDOR), Darwin) 1.350 + ifneq ($(MACOSX_UNIVERSAL), true) 1.351 + EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR) 1.352 + endif 1.353 +endif 1.354 + 1.355 +# Common export list of files 1.356 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h 1.357 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h 1.358 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h 1.359 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h 1.360 +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h 1.361 + 1.362 +.PHONY: $(HS_ALT_MAKE)/defs.make 1.363 +