make/defs.make

Mon, 10 Oct 2016 20:28:13 -0700

author
iris
date
Mon, 10 Oct 2016 20:28:13 -0700
changeset 8636
f973811078b9
parent 8212
c649dde41041
child 8604
04d83ba48607
child 9493
882a55369341
permissions
-rw-r--r--

8166799: ASSEMBLY_EXCEPTION contains historical company name
Reviewed-by: mchung, tbell

duke@435 1 #
simonis@8212 2 # Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
sla@5237 22 #
duke@435 23 #
duke@435 24
jprovino@4165 25 # The common definitions for hotspot builds.
jprovino@4165 26
jprovino@4165 27 # Optionally include SPEC file generated by configure.
jprovino@4165 28 ifneq ($(SPEC),)
jprovino@4165 29 include $(SPEC)
jprovino@4165 30 endif
jprovino@4165 31
jprovino@4165 32 # Directory paths and user name
jprovino@4165 33 # Unless GAMMADIR is set on the command line, search upward from
jprovino@4165 34 # the current directory for a parent directory containing "src/share/vm".
jprovino@4165 35 # If that fails, look for $GAMMADIR in the environment.
jprovino@4165 36 # When the tree of subdirs is built, this setting is stored in each flags.make.
jprovino@4165 37 GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
jprovino@4165 38 HS_SRC_DIR=$(GAMMADIR)/src
jprovino@4165 39 HS_MAKE_DIR=$(GAMMADIR)/make
jprovino@4165 40 HS_BUILD_DIR=$(GAMMADIR)/build
jprovino@4165 41
jprovino@4165 42 ifeq ($(USER),)
jprovino@4165 43 USER=$(USERNAME)
jprovino@4165 44 endif
jprovino@4165 45
bpittore@4028 46 ifeq ($(HS_ALT_MAKE),)
bpittore@4028 47 ifneq ($(OPENJDK),true)
bpittore@4028 48 HS_ALT_MAKE=$(GAMMADIR)/make/closed
bpittore@4028 49 else
bpittore@4028 50 HS_ALT_MAKE=NO_SUCH_PATH
bpittore@4028 51 endif
bpittore@4028 52 endif
bpittore@4028 53
jprovino@4165 54 #
jprovino@4165 55 # Include alternate defs.make if it exists
jprovino@4165 56 #
jprovino@4165 57 -include $(HS_ALT_MAKE)/defs.make
erikj@3600 58
duke@435 59 # Default to verbose build logs (show all compile lines):
duke@435 60 MAKE_VERBOSE=y
duke@435 61
duke@435 62 # Make macros for install files or preparing targets
duke@435 63 CD=cd
duke@435 64 CP=cp
duke@435 65 ECHO=echo
duke@435 66 GREP=grep
duke@435 67 MKDIR=mkdir
duke@435 68 MV=mv
duke@435 69 PWD=pwd
duke@435 70 RM=rm -f
duke@435 71 SED=sed
duke@435 72 TAR=tar
duke@435 73 ZIPEXE=zip
duke@435 74
duke@435 75 define install-file
duke@435 76 @$(MKDIR) -p $(@D)
duke@435 77 @$(RM) $@
duke@435 78 $(CP) $< $@
duke@435 79 endef
dcubed@5898 80
dcubed@5898 81 # MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead.
dcubed@5898 82 # May need to have a MacOS X specific definition of install-dir
dcubed@5898 83 # sometime in the future.
dcubed@5898 84 define install-dir
dcubed@5898 85 @$(MKDIR) -p $(@D)
dcubed@5898 86 @$(RM) -r $@
dcubed@5898 87 $(CP) -r $< $@
dcubed@5898 88 endef
dcubed@5898 89
duke@435 90 define prep-target
duke@435 91 @$(MKDIR) -p $(@D)
duke@435 92 @$(RM) $@
duke@435 93 endef
duke@435 94
erikj@3649 95 # Default values for JVM_VARIANT* variables if configure hasn't set
erikj@3649 96 # it already.
erikj@3649 97 ifeq ($(JVM_VARIANTS),)
erikj@3649 98 ifeq ($(ZERO_BUILD), true)
erikj@3649 99 ifeq ($(SHARK_BUILD), true)
erikj@3649 100 JVM_VARIANTS:=zeroshark
erikj@3649 101 JVM_VARIANT_ZEROSHARK:=true
erikj@3649 102 else
erikj@3649 103 JVM_VARIANTS:=zero
erikj@3649 104 JVM_VARIANT_ZERO:=true
erikj@3649 105 endif
erikj@3649 106 else
erikj@3649 107 # A default is needed
erikj@3649 108 ifeq ($(BUILD_CLIENT_ONLY), true)
erikj@3649 109 JVM_VARIANTS:=client
erikj@3649 110 JVM_VARIANT_CLIENT:=true
erikj@3649 111 endif
erikj@3649 112 # Further defaults are platform and arch specific
erikj@3649 113 endif
erikj@3649 114 endif
erikj@3649 115
duke@435 116 # hotspot version definitions
duke@435 117 include $(GAMMADIR)/make/hotspot_version
duke@435 118
amurillo@8056 119 # When config parameter --with-update-version is defined,
amurillo@8056 120 # Hotspot minor version should be set to that
amurillo@8056 121 ifneq ($(JDK_UPDATE_VERSION),)
amurillo@8056 122 HS_MINOR_VER=$(JDK_UPDATE_VERSION)
amurillo@8056 123 endif
amurillo@8056 124
amurillo@8056 125 # When config parameter --with-build-number is defined,
amurillo@8056 126 # Hotspot build number should be set to that
amurillo@8056 127 ifneq ($(JDK_BUILD_NUMBER),)
amurillo@8056 128 HS_BUILD_NUMBER=$(subst b,,$(JDK_BUILD_NUMBER))
amurillo@8056 129 endif
amurillo@8056 130
duke@435 131 # Java versions needed
duke@435 132 ifeq ($(PREVIOUS_JDK_VERSION),)
duke@435 133 PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION)
duke@435 134 endif
duke@435 135 ifeq ($(JDK_MAJOR_VERSION),)
duke@435 136 JDK_MAJOR_VERSION=$(JDK_MAJOR_VER)
duke@435 137 endif
duke@435 138 ifeq ($(JDK_MINOR_VERSION),)
duke@435 139 JDK_MINOR_VERSION=$(JDK_MINOR_VER)
duke@435 140 endif
duke@435 141 ifeq ($(JDK_MICRO_VERSION),)
duke@435 142 JDK_MICRO_VERSION=$(JDK_MICRO_VER)
duke@435 143 endif
duke@435 144 ifeq ($(JDK_MKTG_VERSION),)
duke@435 145 JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
duke@435 146 endif
duke@435 147 ifeq ($(JDK_VERSION),)
duke@435 148 JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
duke@435 149 endif
duke@435 150 ifeq ($(FULL_VERSION),)
duke@435 151 FULL_VERSION="$(JDK_VERSION)"
duke@435 152 endif
duke@435 153
duke@435 154 # FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used
duke@435 155 # as JRE version in VM -Xinternalversion output.
duke@435 156 ifndef JRE_RELEASE_VERSION
duke@435 157 JRE_RELEASE_VERSION=$(FULL_VERSION)
duke@435 158 endif
duke@435 159
duke@435 160 ifndef HOTSPOT_RELEASE_VERSION
duke@435 161 HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
duke@435 162 endif
duke@435 163
duke@435 164 ifdef HOTSPOT_BUILD_VERSION
ohair@2319 165 # specified in command line
duke@435 166 else
ohair@2319 167 ifdef COOKED_BUILD_NUMBER
ohair@2319 168 # JRE build
ohair@2319 169 HOTSPOT_BUILD_VERSION=
duke@435 170 else
ohair@2319 171 ifdef USER_RELEASE_SUFFIX
ohair@2319 172 HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)
duke@435 173 else
duke@435 174 HOTSPOT_BUILD_VERSION=internal
duke@435 175 endif
duke@435 176 endif
duke@435 177 endif
duke@435 178
duke@435 179 # Windows should have OS predefined
duke@435 180 ifeq ($(OS),)
duke@435 181 OS := $(shell uname -s)
never@3156 182 ifneq ($(findstring BSD,$(OS)),)
never@3156 183 OS=bsd
never@3156 184 endif
never@3156 185 ifeq ($(OS), Darwin)
never@3156 186 OS=bsd
never@3156 187 endif
duke@435 188 HOST := $(shell uname -n)
duke@435 189 endif
duke@435 190
simonis@6464 191 # If not SunOS, not Linux not BSD and not AIX, assume Windows
duke@435 192 ifneq ($(OS), Linux)
duke@435 193 ifneq ($(OS), SunOS)
never@3156 194 ifneq ($(OS), bsd)
simonis@6464 195 ifneq ($(OS), AIX)
simonis@6464 196 OSNAME=windows
simonis@6464 197 else
simonis@6464 198 OSNAME=aix
simonis@6464 199 endif
never@3156 200 else
never@3156 201 OSNAME=bsd
never@3156 202 endif
duke@435 203 else
duke@435 204 OSNAME=solaris
duke@435 205 endif
duke@435 206 else
duke@435 207 OSNAME=linux
duke@435 208 endif
duke@435 209
duke@435 210 # Determinations of default make arguments and platform specific settings
duke@435 211 MAKE_ARGS=
duke@435 212
duke@435 213 # ARCH_DATA_MODEL==64 is equivalent to LP64=1
duke@435 214 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 215 ifndef LP64
duke@435 216 LP64 := 1
duke@435 217 endif
duke@435 218 endif
duke@435 219
duke@435 220 # Defaults set for product build
duke@435 221 EXPORT_SUBDIR=
duke@435 222
duke@435 223 # Change default /java path if requested
duke@435 224 ifneq ($(ALT_SLASH_JAVA),)
duke@435 225 SLASH_JAVA=$(ALT_SLASH_JAVA)
duke@435 226 endif
duke@435 227
duke@435 228 # Default OUTPUTDIR
duke@435 229 OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME)
duke@435 230 ifneq ($(ALT_OUTPUTDIR),)
duke@435 231 OUTPUTDIR=$(ALT_OUTPUTDIR)
duke@435 232 endif
duke@435 233
duke@435 234 # Find latest promoted JDK area
duke@435 235 JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM)
duke@435 236 ifneq ($(ALT_JDK_IMPORT_PATH),)
duke@435 237 JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH)
duke@435 238 endif
duke@435 239
dholmes@2544 240 # Other parts of JDK build may require an import JDK that can be executed
dholmes@2544 241 # on the build host. For cross-compile builds we also need an import JDK
dholmes@2544 242 # that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH
dholmes@2544 243 ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),)
dholmes@2544 244 JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH)
dholmes@2544 245 endif
dholmes@2544 246
duke@435 247 # Find JDK used for javac compiles
duke@435 248 BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM)
duke@435 249 ifneq ($(ALT_BOOTDIR),)
duke@435 250 BOOTDIR=$(ALT_BOOTDIR)
duke@435 251 endif
duke@435 252
phh@3492 253 # Select name of the export directory and honor ALT overrides
phh@3492 254 EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR)
phh@3492 255 ifneq ($(ALT_EXPORT_PATH),)
phh@3492 256 EXPORT_PATH=$(ALT_EXPORT_PATH)
phh@3492 257 endif
phh@3492 258
phh@3492 259 # Default jdk image if one is created for you with create_jdk
phh@3492 260 JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM)
twisti@3567 261 ifneq ($(ALT_JDK_IMAGE_DIR),)
twisti@3567 262 JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR)
twisti@3567 263 endif
phh@3492 264
sla@5237 265 # The platform dependent defs.make defines platform specific variable such
duke@435 266 # as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined.
kamg@526 267 include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make
duke@435 268
duke@435 269 # We are trying to put platform specific defintions
kamg@526 270 # files to make/$(OSNAME)/makefiles dictory. However
duke@435 271 # some definitions are common for both linux and solaris,
duke@435 272 # so we put them here.
duke@435 273 ifneq ($(OSNAME),windows)
kamg@526 274 ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD))
duke@435 275 ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD))
duke@435 276 ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD))
kamg@526 277 ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile
duke@435 278
duke@435 279 # uname, HotSpot source directory, build directory and JDK use different names
duke@435 280 # for CPU architectures.
duke@435 281 # ARCH - uname output
duke@435 282 # SRCARCH - where to find HotSpot cpu and os_cpu source files
duke@435 283 # BUILDARCH - build directory
duke@435 284 # LIBARCH - directory name in JDK/JRE
duke@435 285
duke@435 286 # Use uname output for SRCARCH, but deal with platform differences. If ARCH
sla@5237 287 # is not explicitly listed below, it is treated as x86.
simonis@8212 288 SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 zero,$(ARCH)))
duke@435 289 ARCH/ = x86
duke@435 290 ARCH/sparc = sparc
duke@435 291 ARCH/sparc64= sparc
duke@435 292 ARCH/ia64 = ia64
duke@435 293 ARCH/amd64 = x86
duke@435 294 ARCH/x86_64 = x86
bobv@2036 295 ARCH/ppc64 = ppc
simonis@8212 296 ARCH/ppc = ppc
never@1445 297 ARCH/zero = zero
duke@435 298
duke@435 299 # BUILDARCH is usually the same as SRCARCH, except for sparcv9
dlong@7598 300 BUILDARCH ?= $(SRCARCH)
duke@435 301 ifeq ($(BUILDARCH), x86)
duke@435 302 ifdef LP64
duke@435 303 BUILDARCH = amd64
duke@435 304 else
duke@435 305 BUILDARCH = i486
duke@435 306 endif
duke@435 307 endif
duke@435 308 ifeq ($(BUILDARCH), sparc)
duke@435 309 ifdef LP64
duke@435 310 BUILDARCH = sparcv9
duke@435 311 endif
duke@435 312 endif
simonis@6452 313 ifeq ($(BUILDARCH), ppc)
simonis@6452 314 ifdef LP64
simonis@6452 315 BUILDARCH = ppc64
simonis@6452 316 endif
simonis@6452 317 endif
duke@435 318
duke@435 319 # LIBARCH is 1:1 mapping from BUILDARCH
dlong@7598 320 LIBARCH ?= $(LIBARCH/$(BUILDARCH))
duke@435 321 LIBARCH/i486 = i386
duke@435 322 LIBARCH/amd64 = amd64
duke@435 323 LIBARCH/sparc = sparc
duke@435 324 LIBARCH/sparcv9 = sparcv9
duke@435 325 LIBARCH/ia64 = ia64
simonis@6452 326 LIBARCH/ppc64 = ppc64
never@1445 327 LIBARCH/zero = $(ZERO_LIBARCH)
duke@435 328
dlong@7598 329 LP64_ARCH += sparcv9 amd64 ia64 ppc64 zero
duke@435 330 endif
duke@435 331
duke@435 332 # Required make macro settings for all platforms
twisti@4780 333 MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR)
xlu@663 334 MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)
duke@435 335 MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
duke@435 336 MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
duke@435 337 MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION)
duke@435 338 MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
duke@435 339
duke@435 340 # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile
duke@435 341 # to overwrite the default definition since OS specific Makefile also
duke@435 342 # includes this make/defs.make file.
duke@435 343 MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION)
duke@435 344
duke@435 345 # Various export sub directories
duke@435 346 EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include
duke@435 347 EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs
duke@435 348 EXPORT_LIB_DIR = $(EXPORT_PATH)/lib
duke@435 349 EXPORT_JRE_DIR = $(EXPORT_PATH)/jre
duke@435 350 EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin
duke@435 351 EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib
duke@435 352 EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH)
duke@435 353
dcubed@3202 354 # non-universal macosx builds need to appear universal
dcubed@3202 355 ifeq ($(OS_VENDOR), Darwin)
dcubed@3202 356 ifneq ($(MACOSX_UNIVERSAL), true)
dcubed@3202 357 EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)
dcubed@3202 358 endif
dcubed@3202 359 endif
dcubed@3202 360
duke@435 361 # Common export list of files
duke@435 362 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h
dcubed@1619 363 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h
duke@435 364 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
duke@435 365 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
duke@435 366 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
phh@3427 367
sla@5237 368 .PHONY: $(HS_ALT_MAKE)/defs.make
bpittore@4028 369

mercurial