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