make/defs.make

Fri, 29 Apr 2016 00:06:10 +0800

author
aoqi
date
Fri, 29 Apr 2016 00:06:10 +0800
changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Added MIPS 64-bit port.

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

mercurial