aoqi@0: # aoqi@0: # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: # aoqi@0: # This code is free software; you can redistribute it and/or modify it aoqi@0: # under the terms of the GNU General Public License version 2 only, as aoqi@0: # published by the Free Software Foundation. aoqi@0: # aoqi@0: # This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: # version 2 for more details (a copy is included in the LICENSE file that aoqi@0: # accompanied this code). aoqi@0: # aoqi@0: # You should have received a copy of the GNU General Public License version aoqi@0: # 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: # aoqi@0: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: # or visit www.oracle.com if you need additional information or have any aoqi@0: # questions. aoqi@0: # aoqi@0: # aoqi@0: aoqi@1: # aoqi@1: # This file has been modified by Loongson Technology in 2015. These aoqi@1: # modifications are Copyright (c) 2015 Loongson Technology, and are made aoqi@1: # available on the same license terms set forth above. aoqi@1: # aoqi@1: aoqi@0: # The common definitions for hotspot builds. aoqi@0: aoqi@0: # Optionally include SPEC file generated by configure. aoqi@0: ifneq ($(SPEC),) aoqi@0: include $(SPEC) aoqi@0: endif aoqi@0: aoqi@0: # Directory paths and user name aoqi@0: # Unless GAMMADIR is set on the command line, search upward from aoqi@0: # the current directory for a parent directory containing "src/share/vm". aoqi@0: # If that fails, look for $GAMMADIR in the environment. aoqi@0: # When the tree of subdirs is built, this setting is stored in each flags.make. aoqi@0: GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) aoqi@0: HS_SRC_DIR=$(GAMMADIR)/src aoqi@0: HS_MAKE_DIR=$(GAMMADIR)/make aoqi@0: HS_BUILD_DIR=$(GAMMADIR)/build aoqi@0: aoqi@0: ifeq ($(USER),) aoqi@0: USER=$(USERNAME) aoqi@0: endif aoqi@0: aoqi@0: ifeq ($(HS_ALT_MAKE),) aoqi@0: ifneq ($(OPENJDK),true) aoqi@0: HS_ALT_MAKE=$(GAMMADIR)/make/closed aoqi@0: else aoqi@0: HS_ALT_MAKE=NO_SUCH_PATH aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # aoqi@0: # Include alternate defs.make if it exists aoqi@0: # aoqi@0: -include $(HS_ALT_MAKE)/defs.make aoqi@0: aoqi@0: # Default to verbose build logs (show all compile lines): aoqi@0: MAKE_VERBOSE=y aoqi@0: aoqi@0: # Make macros for install files or preparing targets aoqi@0: CD=cd aoqi@0: CP=cp aoqi@0: ECHO=echo aoqi@0: GREP=grep aoqi@0: MKDIR=mkdir aoqi@0: MV=mv aoqi@0: PWD=pwd aoqi@0: RM=rm -f aoqi@0: SED=sed aoqi@0: TAR=tar aoqi@0: ZIPEXE=zip aoqi@0: aoqi@0: define install-file aoqi@0: @$(MKDIR) -p $(@D) aoqi@0: @$(RM) $@ aoqi@0: $(CP) $< $@ aoqi@0: endef aoqi@0: aoqi@0: # MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead. aoqi@0: # May need to have a MacOS X specific definition of install-dir aoqi@0: # sometime in the future. aoqi@0: define install-dir aoqi@0: @$(MKDIR) -p $(@D) aoqi@0: @$(RM) -r $@ aoqi@0: $(CP) -r $< $@ aoqi@0: endef aoqi@0: aoqi@0: define prep-target aoqi@0: @$(MKDIR) -p $(@D) aoqi@0: @$(RM) $@ aoqi@0: endef aoqi@0: aoqi@0: # Default values for JVM_VARIANT* variables if configure hasn't set aoqi@0: # it already. aoqi@0: ifeq ($(JVM_VARIANTS),) aoqi@0: ifeq ($(ZERO_BUILD), true) aoqi@0: ifeq ($(SHARK_BUILD), true) aoqi@0: JVM_VARIANTS:=zeroshark aoqi@0: JVM_VARIANT_ZEROSHARK:=true aoqi@0: else aoqi@0: JVM_VARIANTS:=zero aoqi@0: JVM_VARIANT_ZERO:=true aoqi@0: endif aoqi@0: else aoqi@0: # A default is needed aoqi@0: ifeq ($(BUILD_CLIENT_ONLY), true) aoqi@0: JVM_VARIANTS:=client aoqi@0: JVM_VARIANT_CLIENT:=true aoqi@0: endif aoqi@0: # Further defaults are platform and arch specific aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # hotspot version definitions aoqi@0: include $(GAMMADIR)/make/hotspot_version aoqi@0: aoqi@0: # Java versions needed aoqi@0: ifeq ($(PREVIOUS_JDK_VERSION),) aoqi@0: PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION) aoqi@0: endif aoqi@0: ifeq ($(JDK_MAJOR_VERSION),) aoqi@0: JDK_MAJOR_VERSION=$(JDK_MAJOR_VER) aoqi@0: endif aoqi@0: ifeq ($(JDK_MINOR_VERSION),) aoqi@0: JDK_MINOR_VERSION=$(JDK_MINOR_VER) aoqi@0: endif aoqi@0: ifeq ($(JDK_MICRO_VERSION),) aoqi@0: JDK_MICRO_VERSION=$(JDK_MICRO_VER) aoqi@0: endif aoqi@0: ifeq ($(JDK_MKTG_VERSION),) aoqi@0: JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) aoqi@0: endif aoqi@0: ifeq ($(JDK_VERSION),) aoqi@0: JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) aoqi@0: endif aoqi@0: ifeq ($(FULL_VERSION),) aoqi@0: FULL_VERSION="$(JDK_VERSION)" aoqi@0: endif aoqi@0: aoqi@0: # FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used aoqi@0: # as JRE version in VM -Xinternalversion output. aoqi@0: ifndef JRE_RELEASE_VERSION aoqi@0: JRE_RELEASE_VERSION=$(FULL_VERSION) aoqi@0: endif aoqi@0: aoqi@0: ifndef HOTSPOT_RELEASE_VERSION aoqi@0: HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER) aoqi@0: endif aoqi@0: aoqi@0: ifdef HOTSPOT_BUILD_VERSION aoqi@0: # specified in command line aoqi@0: else aoqi@0: ifdef COOKED_BUILD_NUMBER aoqi@0: # JRE build aoqi@0: HOTSPOT_BUILD_VERSION= aoqi@0: else aoqi@0: ifdef USER_RELEASE_SUFFIX aoqi@0: HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX) aoqi@0: else aoqi@0: HOTSPOT_BUILD_VERSION=internal aoqi@0: endif aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # Windows should have OS predefined aoqi@0: ifeq ($(OS),) aoqi@0: OS := $(shell uname -s) aoqi@0: ifneq ($(findstring BSD,$(OS)),) aoqi@0: OS=bsd aoqi@0: endif aoqi@0: ifeq ($(OS), Darwin) aoqi@0: OS=bsd aoqi@0: endif aoqi@0: HOST := $(shell uname -n) aoqi@0: endif aoqi@0: aoqi@0: # If not SunOS, not Linux not BSD and not AIX, assume Windows aoqi@0: ifneq ($(OS), Linux) aoqi@0: ifneq ($(OS), SunOS) aoqi@0: ifneq ($(OS), bsd) aoqi@0: ifneq ($(OS), AIX) aoqi@0: OSNAME=windows aoqi@0: else aoqi@0: OSNAME=aix aoqi@0: endif aoqi@0: else aoqi@0: OSNAME=bsd aoqi@0: endif aoqi@0: else aoqi@0: OSNAME=solaris aoqi@0: endif aoqi@0: else aoqi@0: OSNAME=linux aoqi@0: endif aoqi@0: aoqi@0: # Determinations of default make arguments and platform specific settings aoqi@0: MAKE_ARGS= aoqi@0: aoqi@0: # ARCH_DATA_MODEL==64 is equivalent to LP64=1 aoqi@0: ifeq ($(ARCH_DATA_MODEL), 64) aoqi@0: ifndef LP64 aoqi@0: LP64 := 1 aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # Defaults set for product build aoqi@0: EXPORT_SUBDIR= aoqi@0: aoqi@0: # Change default /java path if requested aoqi@0: ifneq ($(ALT_SLASH_JAVA),) aoqi@0: SLASH_JAVA=$(ALT_SLASH_JAVA) aoqi@0: endif aoqi@0: aoqi@0: # Default OUTPUTDIR aoqi@0: OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME) aoqi@0: ifneq ($(ALT_OUTPUTDIR),) aoqi@0: OUTPUTDIR=$(ALT_OUTPUTDIR) aoqi@0: endif aoqi@0: aoqi@0: # Find latest promoted JDK area aoqi@0: JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM) aoqi@0: ifneq ($(ALT_JDK_IMPORT_PATH),) aoqi@0: JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) aoqi@0: endif aoqi@0: aoqi@0: # Other parts of JDK build may require an import JDK that can be executed aoqi@0: # on the build host. For cross-compile builds we also need an import JDK aoqi@0: # that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH aoqi@0: ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),) aoqi@0: JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH) aoqi@0: endif aoqi@0: aoqi@0: # Find JDK used for javac compiles aoqi@0: BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) aoqi@0: ifneq ($(ALT_BOOTDIR),) aoqi@0: BOOTDIR=$(ALT_BOOTDIR) aoqi@0: endif aoqi@0: aoqi@0: # Select name of the export directory and honor ALT overrides aoqi@0: EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR) aoqi@0: ifneq ($(ALT_EXPORT_PATH),) aoqi@0: EXPORT_PATH=$(ALT_EXPORT_PATH) aoqi@0: endif aoqi@0: aoqi@0: # Default jdk image if one is created for you with create_jdk aoqi@0: JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM) aoqi@0: ifneq ($(ALT_JDK_IMAGE_DIR),) aoqi@0: JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR) aoqi@0: endif aoqi@0: aoqi@0: # The platform dependent defs.make defines platform specific variable such aoqi@0: # as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined. aoqi@0: include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make aoqi@0: aoqi@0: # We are trying to put platform specific defintions aoqi@0: # files to make/$(OSNAME)/makefiles dictory. However aoqi@0: # some definitions are common for both linux and solaris, aoqi@0: # so we put them here. aoqi@0: ifneq ($(OSNAME),windows) aoqi@0: ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD)) aoqi@0: ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD)) aoqi@0: ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD)) aoqi@0: ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile aoqi@0: aoqi@0: # uname, HotSpot source directory, build directory and JDK use different names aoqi@0: # for CPU architectures. aoqi@0: # ARCH - uname output aoqi@0: # SRCARCH - where to find HotSpot cpu and os_cpu source files aoqi@0: # BUILDARCH - build directory aoqi@0: # LIBARCH - directory name in JDK/JRE aoqi@0: aoqi@0: # Use uname output for SRCARCH, but deal with platform differences. If ARCH aoqi@0: # is not explicitly listed below, it is treated as x86. aoqi@1: SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 mips64 arm ppc ppc64 zero,$(ARCH))) aoqi@0: ARCH/ = x86 aoqi@0: ARCH/sparc = sparc aoqi@0: ARCH/sparc64= sparc aoqi@0: ARCH/ia64 = ia64 aoqi@0: ARCH/amd64 = x86 aoqi@0: ARCH/x86_64 = x86 aoqi@1: ARCH/mips64 = mips aoqi@0: ARCH/ppc64 = ppc aoqi@0: ARCH/ppc = ppc aoqi@0: ARCH/arm = arm aoqi@0: ARCH/zero = zero aoqi@0: aoqi@0: # BUILDARCH is usually the same as SRCARCH, except for sparcv9 aoqi@0: BUILDARCH = $(SRCARCH) aoqi@0: ifeq ($(BUILDARCH), x86) aoqi@0: ifdef LP64 aoqi@0: BUILDARCH = amd64 aoqi@0: else aoqi@0: BUILDARCH = i486 aoqi@0: endif aoqi@0: endif aoqi@0: ifeq ($(BUILDARCH), sparc) aoqi@0: ifdef LP64 aoqi@0: BUILDARCH = sparcv9 aoqi@0: endif aoqi@0: endif aoqi@1: ifeq ($(BUILDARCH), mips) aoqi@1: BUILDARCH = mips64 aoqi@1: endif aoqi@0: ifeq ($(BUILDARCH), ppc) aoqi@0: ifdef LP64 aoqi@0: BUILDARCH = ppc64 aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # LIBARCH is 1:1 mapping from BUILDARCH aoqi@0: LIBARCH = $(LIBARCH/$(BUILDARCH)) aoqi@0: LIBARCH/i486 = i386 aoqi@0: LIBARCH/amd64 = amd64 aoqi@0: LIBARCH/sparc = sparc aoqi@0: LIBARCH/sparcv9 = sparcv9 aoqi@0: LIBARCH/ia64 = ia64 aoqi@1: LIBARCH/mips64 = mips64 aoqi@0: LIBARCH/ppc64 = ppc64 aoqi@0: LIBARCH/ppc = ppc aoqi@0: LIBARCH/arm = arm aoqi@0: LIBARCH/zero = $(ZERO_LIBARCH) aoqi@0: aoqi@1: LP64_ARCH = sparcv9 amd64 ia64 mips64 ppc64 zero aoqi@0: endif aoqi@0: aoqi@0: # Required make macro settings for all platforms aoqi@0: MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR) aoqi@0: MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR) aoqi@0: MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR) aoqi@0: MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE) aoqi@0: MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) aoqi@0: MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) aoqi@0: aoqi@0: # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile aoqi@0: # to overwrite the default definition since OS specific Makefile also aoqi@0: # includes this make/defs.make file. aoqi@0: MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) aoqi@0: aoqi@0: # Various export sub directories aoqi@0: EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include aoqi@0: EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs aoqi@0: EXPORT_LIB_DIR = $(EXPORT_PATH)/lib aoqi@0: EXPORT_JRE_DIR = $(EXPORT_PATH)/jre aoqi@0: EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin aoqi@0: EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib aoqi@0: EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) aoqi@0: aoqi@0: # non-universal macosx builds need to appear universal aoqi@0: ifeq ($(OS_VENDOR), Darwin) aoqi@0: ifneq ($(MACOSX_UNIVERSAL), true) aoqi@0: EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR) aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # Common export list of files aoqi@0: EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h aoqi@0: EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h aoqi@0: EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h aoqi@0: EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h aoqi@0: EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h aoqi@0: aoqi@0: .PHONY: $(HS_ALT_MAKE)/defs.make aoqi@0: