Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/defs.make
32278 views
#1# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# The common definitions for hotspot builds.2526# Optionally include SPEC file generated by configure.27ifneq ($(SPEC),)28include $(SPEC)29endif3031# Directory paths and user name32# Unless GAMMADIR is set on the command line, search upward from33# the current directory for a parent directory containing "src/share/vm".34# If that fails, look for $GAMMADIR in the environment.35# When the tree of subdirs is built, this setting is stored in each flags.make.36GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)37HS_SRC_DIR=$(GAMMADIR)/src38HS_MAKE_DIR=$(GAMMADIR)/make39HS_BUILD_DIR=$(GAMMADIR)/build4041ifeq ($(USER),)42USER=$(USERNAME)43endif4445ifeq ($(HS_ALT_MAKE),)46ifneq ($(OPENJDK),true)47HS_ALT_MAKE=$(GAMMADIR)/make/closed48else49HS_ALT_MAKE=NO_SUCH_PATH50endif51endif5253#54# Include alternate defs.make if it exists55#56-include $(HS_ALT_MAKE)/defs.make5758# Default to verbose build logs (show all compile lines):59MAKE_VERBOSE=y6061# Make macros for install files or preparing targets62CD=cd63CP=cp64ECHO=echo65GREP=grep66MKDIR=mkdir67MV=mv68PWD=pwd69RM=rm -f70SED=sed71TAR=tar72ZIPEXE=zip7374define install-file75@$(MKDIR) -p $(@D)76@$(RM) $@77$(CP) $< $@78endef7980# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead.81# May need to have a MacOS X specific definition of install-dir82# sometime in the future.83define install-dir84@$(MKDIR) -p $(@D)85@$(RM) -r $@86$(CP) -r $< $@87endef8889define prep-target90@$(MKDIR) -p $(@D)91@$(RM) $@92endef9394# Default values for JVM_VARIANT* variables if configure hasn't set95# it already.96ifeq ($(JVM_VARIANTS),)97ifeq ($(ZERO_BUILD), true)98ifeq ($(SHARK_BUILD), true)99JVM_VARIANTS:=zeroshark100JVM_VARIANT_ZEROSHARK:=true101else102JVM_VARIANTS:=zero103JVM_VARIANT_ZERO:=true104endif105else106# A default is needed107ifeq ($(BUILD_CLIENT_ONLY), true)108JVM_VARIANTS:=client109JVM_VARIANT_CLIENT:=true110endif111# Further defaults are platform and arch specific112endif113endif114115# hotspot version definitions116include $(GAMMADIR)/make/hotspot_version117118# When config parameter --with-update-version is defined,119# Hotspot minor version should be set to that120ifneq ($(JDK_UPDATE_VERSION),)121HS_MINOR_VER=$(JDK_UPDATE_VERSION)122endif123124# When config parameter --with-build-number is defined,125# Hotspot build number should be set to that126ifneq ($(JDK_BUILD_NUMBER),)127HS_BUILD_NUMBER=$(subst b,,$(JDK_BUILD_NUMBER))128endif129130# Java versions needed131ifeq ($(PREVIOUS_JDK_VERSION),)132PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION)133endif134ifeq ($(JDK_MAJOR_VERSION),)135JDK_MAJOR_VERSION=$(JDK_MAJOR_VER)136endif137ifeq ($(JDK_MINOR_VERSION),)138JDK_MINOR_VERSION=$(JDK_MINOR_VER)139endif140ifeq ($(JDK_MICRO_VERSION),)141JDK_MICRO_VERSION=$(JDK_MICRO_VER)142endif143ifeq ($(JDK_MKTG_VERSION),)144JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)145endif146ifeq ($(JDK_VERSION),)147JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)148endif149ifeq ($(FULL_VERSION),)150FULL_VERSION="$(JDK_VERSION)"151endif152153# FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used154# as JRE version in VM -Xinternalversion output.155ifndef JRE_RELEASE_VERSION156JRE_RELEASE_VERSION=$(FULL_VERSION)157endif158159ifndef HOTSPOT_RELEASE_VERSION160HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)161endif162163ifdef HOTSPOT_BUILD_VERSION164# specified in command line165else166ifdef COOKED_BUILD_NUMBER167# JRE build168HOTSPOT_BUILD_VERSION=169else170ifdef USER_RELEASE_SUFFIX171HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)172else173HOTSPOT_BUILD_VERSION=internal174endif175endif176endif177178# Windows should have OS predefined179ifeq ($(OS),)180OS := $(shell uname -s)181ifneq ($(findstring BSD,$(OS)),)182OS=bsd183endif184ifeq ($(OS), Darwin)185OS=bsd186endif187HOST := $(shell uname -n)188endif189190# If not SunOS, not Linux not BSD and not AIX, assume Windows191ifneq ($(OS), Linux)192ifneq ($(OS), SunOS)193ifneq ($(OS), bsd)194ifneq ($(OS), AIX)195OSNAME=windows196else197OSNAME=aix198endif199else200OSNAME=bsd201endif202else203OSNAME=solaris204endif205else206OSNAME=linux207endif208209# Determinations of default make arguments and platform specific settings210MAKE_ARGS=211212# ARCH_DATA_MODEL==64 is equivalent to LP64=1213ifeq ($(ARCH_DATA_MODEL), 64)214ifndef LP64215LP64 := 1216endif217endif218219# Defaults set for product build220EXPORT_SUBDIR=221222# Change default /java path if requested223ifneq ($(ALT_SLASH_JAVA),)224SLASH_JAVA=$(ALT_SLASH_JAVA)225endif226227# Default OUTPUTDIR228OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME)229ifneq ($(ALT_OUTPUTDIR),)230OUTPUTDIR=$(ALT_OUTPUTDIR)231endif232233# Find latest promoted JDK area234JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM)235ifneq ($(ALT_JDK_IMPORT_PATH),)236JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH)237endif238239# Other parts of JDK build may require an import JDK that can be executed240# on the build host. For cross-compile builds we also need an import JDK241# that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH242ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),)243JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH)244endif245246# Find JDK used for javac compiles247BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM)248ifneq ($(ALT_BOOTDIR),)249BOOTDIR=$(ALT_BOOTDIR)250endif251252# Select name of the export directory and honor ALT overrides253EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR)254ifneq ($(ALT_EXPORT_PATH),)255EXPORT_PATH=$(ALT_EXPORT_PATH)256endif257258# Default jdk image if one is created for you with create_jdk259JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM)260ifneq ($(ALT_JDK_IMAGE_DIR),)261JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR)262endif263264# The platform dependent defs.make defines platform specific variable such265# as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined.266include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make267268# We are trying to put platform specific defintions269# files to make/$(OSNAME)/makefiles dictory. However270# some definitions are common for both linux and solaris,271# so we put them here.272ifneq ($(OSNAME),windows)273ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD))274ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD))275ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD))276ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile277278# uname, HotSpot source directory, build directory and JDK use different names279# for CPU architectures.280# ARCH - uname output281# SRCARCH - where to find HotSpot cpu and os_cpu source files282# BUILDARCH - build directory283# LIBARCH - directory name in JDK/JRE284285# Use uname output for SRCARCH, but deal with platform differences. If ARCH286# is not explicitly listed below, it is treated as x86.287SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 ppc64le zero aarch32 aarch64,$(ARCH)))288ARCH/ = x86289ARCH/sparc = sparc290ARCH/sparc64= sparc291ARCH/ia64 = ia64292ARCH/amd64 = x86293ARCH/x86_64 = x86294ARCH/ppc64 = ppc295ARCH/ppc64le= ppc296ARCH/ppc = ppc297ARCH/zero = zero298ARCH/aarch32 = aarch32299ARCH/aarch64 = aarch64300301# BUILDARCH is usually the same as SRCARCH, except for sparcv9302BUILDARCH ?= $(SRCARCH)303ifeq ($(BUILDARCH), x86)304ifdef LP64305BUILDARCH = amd64306else307BUILDARCH = i486308endif309endif310ifeq ($(BUILDARCH), sparc)311ifdef LP64312BUILDARCH = sparcv9313endif314endif315ifeq ($(BUILDARCH), ppc)316ifdef LP64317BUILDARCH = ppc64318endif319endif320321# LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le322ifeq ($(ARCH),ppc64le)323LIBARCH ?= ppc64le324else325LIBARCH ?= $(LIBARCH/$(BUILDARCH))326endif327LIBARCH ?= $(LIBARCH/$(BUILDARCH))328LIBARCH/i486 = i386329LIBARCH/amd64 = amd64330LIBARCH/aarch32 = aarch32331LIBARCH/aarch64 = aarch64332LIBARCH/sparc = sparc333LIBARCH/sparcv9 = sparcv9334LIBARCH/ia64 = ia64335LIBARCH/ppc64 = ppc64336LIBARCH/zero = $(ZERO_LIBARCH)337338LP64_ARCH += sparcv9 amd64 ia64 ppc64 aarch64 zero339endif340341# Required make macro settings for all platforms342MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR)343MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)344MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)345MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)346MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION)347MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)348349# Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile350# to overwrite the default definition since OS specific Makefile also351# includes this make/defs.make file.352MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION)353354# Various export sub directories355EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include356EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs357EXPORT_LIB_DIR = $(EXPORT_PATH)/lib358EXPORT_JRE_DIR = $(EXPORT_PATH)/jre359EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin360EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib361EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH)362363# non-universal macosx builds need to appear universal364ifeq ($(OS_VENDOR), Darwin)365ifneq ($(MACOSX_UNIVERSAL), true)366EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)367endif368endif369370# Common export list of files371EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h372EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h373EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h374EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h375EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h376377ifeq ($(ENABLE_JFR), true)378EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/jdk/jfr/internal/types/metadata.xml379endif380381.PHONY: $(HS_ALT_MAKE)/defs.make382383384385