make/defs.make

Mon, 17 Sep 2012 11:46:25 -0700

author
ihse
date
Mon, 17 Sep 2012 11:46:25 -0700
changeset 4085
989cf02ca531
parent 4028
a9fed06c01d2
child 4165
fb19af007ffc
permissions
-rw-r--r--

7172012: Make test-in-build an option (Queens)
Reviewed-by: ohair, dholmes

duke@435 1 #
phh@3492 2 # Copyright (c) 2006, 2012, 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.
duke@435 22 #
duke@435 23 #
duke@435 24
bpittore@4028 25 ifeq ($(HS_ALT_MAKE),)
bpittore@4028 26 ifneq ($(OPENJDK),true)
bpittore@4028 27 HS_ALT_MAKE=$(GAMMADIR)/make/closed
bpittore@4028 28 else
bpittore@4028 29 HS_ALT_MAKE=NO_SUCH_PATH
bpittore@4028 30 endif
bpittore@4028 31 endif
bpittore@4028 32
duke@435 33 # The common definitions for hotspot builds.
duke@435 34
erikj@3600 35 # Optionally include SPEC file generated by configure.
erikj@3600 36 ifneq ($(SPEC),)
erikj@3600 37 include $(SPEC)
erikj@3600 38 endif
erikj@3600 39
duke@435 40 # Default to verbose build logs (show all compile lines):
duke@435 41 MAKE_VERBOSE=y
duke@435 42
duke@435 43 # Make macros for install files or preparing targets
duke@435 44 CD=cd
duke@435 45 CP=cp
duke@435 46 ECHO=echo
duke@435 47 GREP=grep
duke@435 48 MKDIR=mkdir
duke@435 49 MV=mv
duke@435 50 PWD=pwd
duke@435 51 RM=rm -f
duke@435 52 SED=sed
duke@435 53 TAR=tar
duke@435 54 ZIPEXE=zip
duke@435 55
duke@435 56 define install-file
duke@435 57 @$(MKDIR) -p $(@D)
duke@435 58 @$(RM) $@
duke@435 59 $(CP) $< $@
duke@435 60 endef
duke@435 61 define prep-target
duke@435 62 @$(MKDIR) -p $(@D)
duke@435 63 @$(RM) $@
duke@435 64 endef
duke@435 65
erikj@3649 66 # Default values for JVM_VARIANT* variables if configure hasn't set
erikj@3649 67 # it already.
erikj@3649 68 ifeq ($(JVM_VARIANTS),)
erikj@3649 69 ifeq ($(ZERO_BUILD), true)
erikj@3649 70 ifeq ($(SHARK_BUILD), true)
erikj@3649 71 JVM_VARIANTS:=zeroshark
erikj@3649 72 JVM_VARIANT_ZEROSHARK:=true
erikj@3649 73 else
erikj@3649 74 JVM_VARIANTS:=zero
erikj@3649 75 JVM_VARIANT_ZERO:=true
erikj@3649 76 endif
erikj@3649 77 else
erikj@3649 78 # A default is needed
erikj@3649 79 ifeq ($(BUILD_CLIENT_ONLY), true)
erikj@3649 80 JVM_VARIANTS:=client
erikj@3649 81 JVM_VARIANT_CLIENT:=true
erikj@3649 82 endif
erikj@3649 83 # Further defaults are platform and arch specific
erikj@3649 84 endif
erikj@3649 85 endif
erikj@3649 86
duke@435 87 # Directory paths and user name
duke@435 88 # Unless GAMMADIR is set on the command line, search upward from
duke@435 89 # the current directory for a parent directory containing "src/share/vm".
duke@435 90 # If that fails, look for $GAMMADIR in the environment.
duke@435 91 # When the tree of subdirs is built, this setting is stored in each flags.make.
duke@435 92 GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
duke@435 93 HS_SRC_DIR=$(GAMMADIR)/src
kamg@526 94 HS_MAKE_DIR=$(GAMMADIR)/make
duke@435 95 HS_BUILD_DIR=$(GAMMADIR)/build
duke@435 96
duke@435 97 ifeq ($(USER),)
duke@435 98 USER=$(USERNAME)
duke@435 99 endif
duke@435 100
duke@435 101 # hotspot version definitions
duke@435 102 include $(GAMMADIR)/make/hotspot_version
duke@435 103
duke@435 104 # Java versions needed
duke@435 105 ifeq ($(PREVIOUS_JDK_VERSION),)
duke@435 106 PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION)
duke@435 107 endif
duke@435 108 ifeq ($(JDK_MAJOR_VERSION),)
duke@435 109 JDK_MAJOR_VERSION=$(JDK_MAJOR_VER)
duke@435 110 endif
duke@435 111 ifeq ($(JDK_MINOR_VERSION),)
duke@435 112 JDK_MINOR_VERSION=$(JDK_MINOR_VER)
duke@435 113 endif
duke@435 114 ifeq ($(JDK_MICRO_VERSION),)
duke@435 115 JDK_MICRO_VERSION=$(JDK_MICRO_VER)
duke@435 116 endif
duke@435 117 ifeq ($(JDK_MKTG_VERSION),)
duke@435 118 JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
duke@435 119 endif
duke@435 120 ifeq ($(JDK_VERSION),)
duke@435 121 JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
duke@435 122 endif
duke@435 123 ifeq ($(FULL_VERSION),)
duke@435 124 FULL_VERSION="$(JDK_VERSION)"
duke@435 125 endif
duke@435 126
duke@435 127 # FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used
duke@435 128 # as JRE version in VM -Xinternalversion output.
duke@435 129 ifndef JRE_RELEASE_VERSION
duke@435 130 JRE_RELEASE_VERSION=$(FULL_VERSION)
duke@435 131 endif
duke@435 132
duke@435 133 ifndef HOTSPOT_RELEASE_VERSION
duke@435 134 HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)
duke@435 135 endif
duke@435 136
duke@435 137 ifdef HOTSPOT_BUILD_VERSION
ohair@2319 138 # specified in command line
duke@435 139 else
ohair@2319 140 ifdef COOKED_BUILD_NUMBER
ohair@2319 141 # JRE build
ohair@2319 142 HOTSPOT_BUILD_VERSION=
duke@435 143 else
ohair@2319 144 ifdef USER_RELEASE_SUFFIX
ohair@2319 145 HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)
duke@435 146 else
duke@435 147 HOTSPOT_BUILD_VERSION=internal
duke@435 148 endif
duke@435 149 endif
duke@435 150 endif
duke@435 151
duke@435 152 # Windows should have OS predefined
duke@435 153 ifeq ($(OS),)
duke@435 154 OS := $(shell uname -s)
never@3156 155 ifneq ($(findstring BSD,$(OS)),)
never@3156 156 OS=bsd
never@3156 157 endif
never@3156 158 ifeq ($(OS), Darwin)
never@3156 159 OS=bsd
never@3156 160 endif
duke@435 161 HOST := $(shell uname -n)
duke@435 162 endif
duke@435 163
never@3156 164 # If not SunOS, not Linux and not BSD, assume Windows
duke@435 165 ifneq ($(OS), Linux)
duke@435 166 ifneq ($(OS), SunOS)
never@3156 167 ifneq ($(OS), bsd)
never@3156 168 OSNAME=windows
never@3156 169 else
never@3156 170 OSNAME=bsd
never@3156 171 endif
duke@435 172 else
duke@435 173 OSNAME=solaris
duke@435 174 endif
duke@435 175 else
duke@435 176 OSNAME=linux
duke@435 177 endif
duke@435 178
duke@435 179 # Determinations of default make arguments and platform specific settings
duke@435 180 MAKE_ARGS=
duke@435 181
duke@435 182 # ARCH_DATA_MODEL==64 is equivalent to LP64=1
duke@435 183 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 184 ifndef LP64
duke@435 185 LP64 := 1
duke@435 186 endif
duke@435 187 endif
duke@435 188
duke@435 189 # Defaults set for product build
duke@435 190 EXPORT_SUBDIR=
duke@435 191
duke@435 192 # Change default /java path if requested
duke@435 193 ifneq ($(ALT_SLASH_JAVA),)
duke@435 194 SLASH_JAVA=$(ALT_SLASH_JAVA)
duke@435 195 endif
duke@435 196
duke@435 197 # Default OUTPUTDIR
duke@435 198 OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME)
duke@435 199 ifneq ($(ALT_OUTPUTDIR),)
duke@435 200 OUTPUTDIR=$(ALT_OUTPUTDIR)
duke@435 201 endif
duke@435 202
duke@435 203 # Find latest promoted JDK area
duke@435 204 JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM)
duke@435 205 ifneq ($(ALT_JDK_IMPORT_PATH),)
duke@435 206 JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH)
duke@435 207 endif
duke@435 208
dholmes@2544 209 # Other parts of JDK build may require an import JDK that can be executed
dholmes@2544 210 # on the build host. For cross-compile builds we also need an import JDK
dholmes@2544 211 # that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH
dholmes@2544 212 ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),)
dholmes@2544 213 JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH)
dholmes@2544 214 endif
dholmes@2544 215
duke@435 216 # Find JDK used for javac compiles
duke@435 217 BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM)
duke@435 218 ifneq ($(ALT_BOOTDIR),)
duke@435 219 BOOTDIR=$(ALT_BOOTDIR)
duke@435 220 endif
duke@435 221
phh@3492 222 # Select name of the export directory and honor ALT overrides
phh@3492 223 EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR)
phh@3492 224 ifneq ($(ALT_EXPORT_PATH),)
phh@3492 225 EXPORT_PATH=$(ALT_EXPORT_PATH)
phh@3492 226 endif
phh@3492 227
phh@3492 228 # Default jdk image if one is created for you with create_jdk
phh@3492 229 JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM)
twisti@3567 230 ifneq ($(ALT_JDK_IMAGE_DIR),)
twisti@3567 231 JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR)
twisti@3567 232 endif
phh@3492 233
duke@435 234 # The platform dependent defs.make defines platform specific variable such
duke@435 235 # as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined.
kamg@526 236 include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make
duke@435 237
duke@435 238 # We are trying to put platform specific defintions
kamg@526 239 # files to make/$(OSNAME)/makefiles dictory. However
duke@435 240 # some definitions are common for both linux and solaris,
duke@435 241 # so we put them here.
duke@435 242 ifneq ($(OSNAME),windows)
kamg@526 243 ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD))
duke@435 244 ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD))
duke@435 245 ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD))
kamg@526 246 ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile
duke@435 247
duke@435 248 # uname, HotSpot source directory, build directory and JDK use different names
duke@435 249 # for CPU architectures.
duke@435 250 # ARCH - uname output
duke@435 251 # SRCARCH - where to find HotSpot cpu and os_cpu source files
duke@435 252 # BUILDARCH - build directory
duke@435 253 # LIBARCH - directory name in JDK/JRE
duke@435 254
duke@435 255 # Use uname output for SRCARCH, but deal with platform differences. If ARCH
duke@435 256 # is not explicitly listed below, it is treated as x86.
bobv@2036 257 SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
duke@435 258 ARCH/ = x86
duke@435 259 ARCH/sparc = sparc
duke@435 260 ARCH/sparc64= sparc
duke@435 261 ARCH/ia64 = ia64
duke@435 262 ARCH/amd64 = x86
duke@435 263 ARCH/x86_64 = x86
bobv@2036 264 ARCH/ppc64 = ppc
bobv@2036 265 ARCH/ppc = ppc
bobv@2036 266 ARCH/arm = arm
never@1445 267 ARCH/zero = zero
duke@435 268
duke@435 269 # BUILDARCH is usually the same as SRCARCH, except for sparcv9
duke@435 270 BUILDARCH = $(SRCARCH)
duke@435 271 ifeq ($(BUILDARCH), x86)
duke@435 272 ifdef LP64
duke@435 273 BUILDARCH = amd64
duke@435 274 else
duke@435 275 BUILDARCH = i486
duke@435 276 endif
duke@435 277 endif
duke@435 278 ifeq ($(BUILDARCH), sparc)
duke@435 279 ifdef LP64
duke@435 280 BUILDARCH = sparcv9
duke@435 281 endif
duke@435 282 endif
duke@435 283
duke@435 284 # LIBARCH is 1:1 mapping from BUILDARCH
duke@435 285 LIBARCH = $(LIBARCH/$(BUILDARCH))
duke@435 286 LIBARCH/i486 = i386
duke@435 287 LIBARCH/amd64 = amd64
duke@435 288 LIBARCH/sparc = sparc
duke@435 289 LIBARCH/sparcv9 = sparcv9
duke@435 290 LIBARCH/ia64 = ia64
bobv@2036 291 LIBARCH/ppc64 = ppc
bobv@2036 292 LIBARCH/ppc = ppc
bobv@2036 293 LIBARCH/arm = arm
never@1445 294 LIBARCH/zero = $(ZERO_LIBARCH)
duke@435 295
never@1445 296 LP64_ARCH = sparcv9 amd64 ia64 zero
duke@435 297 endif
duke@435 298
duke@435 299 # Required make macro settings for all platforms
duke@435 300 MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR)
xlu@663 301 MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)
duke@435 302 MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
duke@435 303 MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
duke@435 304 MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION)
duke@435 305 MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
duke@435 306
duke@435 307 # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile
duke@435 308 # to overwrite the default definition since OS specific Makefile also
duke@435 309 # includes this make/defs.make file.
duke@435 310 MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION)
duke@435 311
duke@435 312 # Various export sub directories
duke@435 313 EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include
duke@435 314 EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs
duke@435 315 EXPORT_LIB_DIR = $(EXPORT_PATH)/lib
duke@435 316 EXPORT_JRE_DIR = $(EXPORT_PATH)/jre
duke@435 317 EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin
duke@435 318 EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib
duke@435 319 EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH)
duke@435 320
dcubed@3202 321 # non-universal macosx builds need to appear universal
dcubed@3202 322 ifeq ($(OS_VENDOR), Darwin)
dcubed@3202 323 ifneq ($(MACOSX_UNIVERSAL), true)
dcubed@3202 324 EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)
dcubed@3202 325 endif
dcubed@3202 326 endif
dcubed@3202 327
duke@435 328 # Common export list of files
duke@435 329 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h
dcubed@1619 330 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h
duke@435 331 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
duke@435 332 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
duke@435 333 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
phh@3427 334
ihse@4085 335 # By default, run Queens test after building
ihse@4085 336 TEST_IN_BUILD ?= true
ihse@4085 337
phh@3427 338 ifndef JAVASE_EMBEDDED
phh@3427 339 EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
phh@3427 340 endif
bpittore@4028 341

mercurial