make/defs.make

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 1
2d8a650513c2
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

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

mercurial