buildtree.make revision 4093
0N/A#
3364N/A# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A# or visit www.oracle.com if you need additional information or have any
1472N/A# questions.
0N/A#
0N/A#
0N/A
0N/A# Usage:
0N/A#
2073N/A# $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch
0N/A# GAMMADIR=dir OS_FAMILY=os VARIANT=variant
0N/A#
0N/A# The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the
0N/A# environment or on the command-line:
0N/A#
0N/A# ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory
0N/A# BUILDARCH - build directory
0N/A# LIBARCH - the corresponding directory in JDK/JRE
0N/A# GAMMADIR - top of workspace
0N/A# OS_FAMILY - operating system
0N/A# VARIANT - core, compiler1, compiler2, or tiered
0N/A# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
1884N/A# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty
0N/A# JRE_RELEASE_VERSION - <major>.<minor>.<micro> (1.7.0)
0N/A#
0N/A# Builds the directory trees with makefiles plus some convenience files in
0N/A# each directory:
0N/A#
0N/A# Makefile - for "make foo"
0N/A# flags.make - with macro settings
0N/A# vm.make - to support making "$(MAKE) -v vm.make" in makefiles
0N/A# adlc.make -
0N/A# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
0N/A# sa.make - generate SA jar file and natives
0N/A# env.[ck]sh - environment settings
0N/A# test_gamma - script to run the Queens program
0N/A#
0N/A# The makefiles are split this way so that "make foo" will run faster by not
0N/A# having to read the dependency files for the vm.
0N/A
3568N/A-include $(SPEC)
0N/Ainclude $(GAMMADIR)/make/scm.make
2080N/Ainclude $(GAMMADIR)/make/altsrc.make
2073N/A
0N/A
0N/A# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
0N/AQUIETLY$(MAKE_VERBOSE) = @
0N/A
0N/A# For now, until the compiler is less wobbly:
0N/ATESTFLAGS = -Xbatch -showversion
0N/A
3617N/Aifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
1010N/A PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
50N/Aelse
1010N/A ifdef USE_SUNCC
1010N/A PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
1010N/A else
1010N/A PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
1010N/A endif
1010N/Aendif
1010N/A
1010N/A# Allow overriding of the arch part of the directory but default
1010N/A# to BUILDARCH if nothing is specified
1010N/Aifeq ($(VARIANTARCH),)
1010N/A VARIANTARCH=$(BUILDARCH)
50N/Aendif
0N/A
0N/Aifdef FORCE_TIERED
0N/Aifeq ($(VARIANT),tiered)
1010N/APLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_compiler2
0N/Aelse
1010N/APLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT)
0N/Aendif
0N/Aelse
1010N/APLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT)
0N/Aendif
0N/A
0N/A#
0N/A# We do two levels of exclusion in the shared directory.
0N/A# TOPLEVEL excludes are pruned, they are not recursively searched,
0N/A# but lower level directories can be named without fear of collision.
0N/A# ALWAYS excludes are excluded at any level in the directory tree.
0N/A#
0N/A
0N/AALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
0N/A
0N/Aifeq ($(VARIANT),tiered)
0N/ATOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
0N/Aelse
0N/Aifeq ($(VARIANT),compiler2)
0N/ATOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
0N/Aelse
0N/A# compiler1 and core use the same exclude list
0N/ATOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
0N/Aendif
0N/Aendif
0N/A
0N/A# Get things from the platform file.
0N/ACOMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
0N/A
0N/ASIMPLE_DIRS = \
1879N/A $(PLATFORM_DIR)/generated/dependencies \
0N/A $(PLATFORM_DIR)/generated/adfiles \
0N/A $(PLATFORM_DIR)/generated/jvmtifiles
0N/A
0N/ATARGETS = debug fastdebug jvmg optimized product profiled
0N/ASUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
0N/A
0N/A# For dependencies and recursive makes.
91N/ABUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
0N/A
0N/ABUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
1934N/A env.sh env.csh jdkpath.sh .dbxrc test_gamma
0N/A
0N/ABUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
2073N/A SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
0N/A
0N/A# Define variables to be set in flags.make.
0N/A# Default values are set in make/defs.make.
0N/Aifeq ($(HOTSPOT_BUILD_VERSION),)
0N/A HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
0N/Aelse
0N/A HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
0N/Aendif
0N/A# Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami)
0N/Aifndef HOTSPOT_BUILD_USER
0N/A HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
0N/Aendif
0N/Aifndef HOTSPOT_BUILD_USER
0N/A HOTSPOT_BUILD_USER := $(shell whoami)
0N/Aendif
91N/A# Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
91N/A# or make/hotspot_distro.
0N/Aifndef HOTSPOT_VM_DISTRO
2080N/A ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
91N/A include $(GAMMADIR)/make/hotspot_distro
0N/A else
91N/A include $(GAMMADIR)/make/openjdk_distro
0N/A endif
0N/Aendif
0N/A
4093N/A# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
4093N/Aifndef OPENJDK
4093N/A ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
4093N/A OPENJDK=true
4093N/A endif
4093N/Aendif
4093N/A
0N/ABUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
0N/A
0N/ABUILDTREE = \
0N/A $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS)
0N/A
0N/ABUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)"
0N/A
0N/Aall: $(SUBMAKE_DIRS)
0N/A
0N/A# Run make in each subdirectory recursively.
0N/A$(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE
0N/A $(QUIETLY) [ -d $@ ] || { mkdir -p $@; }
0N/A $(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F)
0N/A $(QUIETLY) touch $@
0N/A
0N/A$(SIMPLE_DIRS):
0N/A $(QUIETLY) mkdir -p $@
0N/A
2080N/A# Convenience macro which takes a source relative path, applies $(1) to the
2080N/A# absolute path, and then replaces $(GAMMADIR) in the result with a
2080N/A# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.
2080N/Agamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
2080N/A
0N/Aflags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \
0N/A sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
0N/A echo; \
0N/A echo "GAMMADIR = $(GAMMADIR)"; \
0N/A echo "SYSDEFS = \$$(Platform_sysdefs)"; \
2073N/A echo "SRCARCH = $(SRCARCH)"; \
0N/A echo "BUILDARCH = $(BUILDARCH)"; \
0N/A echo "LIBARCH = $(LIBARCH)"; \
0N/A echo "TARGET = $(TARGET)"; \
0N/A echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
0N/A echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
0N/A echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
0N/A echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
0N/A echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
4093N/A echo "OPENJDK = $(OPENJDK)"; \
0N/A echo; \
1879N/A echo "# Used for platform dispatching"; \
1879N/A echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
1879N/A echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
1879N/A echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
1879N/A echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
1879N/A echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
1879N/A echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
1879N/A echo "CFLAGS += \$$(TARGET_DEFINES)"; \
1879N/A echo; \
1879N/A echo "Src_Dirs_V = \\"; \
0N/A sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
2080N/A echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
1879N/A echo; \
1879N/A echo "Src_Dirs_I = \\"; \
2080N/A echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \
2080N/A echo "$(call gamma-path,altsrc,share/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,share/vm) \\"; \
2871N/A echo "$(call gamma-path,altsrc,share/vm/precompiled) \\"; \
2871N/A echo "$(call gamma-path,commonsrc,share/vm/precompiled) \\"; \
2080N/A echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
2080N/A echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
2080N/A echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
0N/A [ -n "$(CFLAGS_BROWSE)" ] && \
0N/A echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
3364N/A [ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
3364N/A echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
2790N/A [ -n "$(OBJCOPY)" ] && \
2790N/A echo && echo "OBJCOPY = $(OBJCOPY)"; \
2790N/A [ -n "$(STRIP_POLICY)" ] && \
2790N/A echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
3364N/A [ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
3364N/A echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
3364N/A [ -n "$(ZIPEXE)" ] && \
3364N/A echo && echo "ZIPEXE = $(ZIPEXE)"; \
0N/A [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
0N/A echo && \
0N/A echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
0N/A echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
0N/A echo; \
3568N/A [ -n "$(SPEC)" ] && \
3568N/A echo "include $(SPEC)"; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
0N/A ) > $@
0N/A
0N/Aflags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A [ "$(TARGET)" = profiled ] && \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
0N/A ) > $@
0N/A
0N/A../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
0N/A @echo Creating directory list $@
2080N/A $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
2080N/A find $(HS_ALT_SRC)/share/vm/* -prune \
2080N/A -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
2080N/A \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \
2080N/A fi;
2080N/A $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \
0N/A -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
2080N/A \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@
0N/A
0N/AMakefile: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo include flags.make; \
0N/A echo; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/top.make"; \
0N/A ) > $@
0N/A
0N/Avm.make: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo include flags.make; \
0N/A echo include flags_vm.make; \
0N/A echo; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
0N/A ) > $@
0N/A
0N/Aadlc.make: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo include flags.make; \
0N/A echo; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
0N/A ) > $@
0N/A
0N/Ajvmti.make: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo include flags.make; \
0N/A echo; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
0N/A ) > $@
0N/A
0N/Asa.make: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A echo; \
0N/A echo include flags.make; \
0N/A echo; \
91N/A echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
0N/A ) > $@
0N/A
0N/Aenv.sh: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
0N/A { \
0N/A echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
0N/A } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
0N/A echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
3129N/A echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \
0N/A ) > $@
0N/A
0N/Aenv.csh: env.sh
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A $(BUILDTREE_COMMENT); \
0N/A [ -n "$$JAVA_HOME" ] && \
0N/A { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
0N/A sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
0N/A ) > $@
0N/A
1934N/Ajdkpath.sh: $(BUILDTREE_MAKE)
1934N/A @echo Creating $@ ...
1934N/A $(QUIETLY) ( \
1934N/A $(BUILDTREE_COMMENT); \
1934N/A echo "JDK=${JAVA_HOME}"; \
1934N/A ) > $@
1934N/A
0N/A.dbxrc: $(BUILDTREE_MAKE)
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
0N/A echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
0N/A echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
0N/A echo "then"; \
0N/A echo " source \"\$${HOTSPOT_DBXWARE}\""; \
0N/A echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
0N/A echo "then"; \
0N/A echo " source \"\$$HOME/.dbxrc\""; \
0N/A echo "fi"; \
0N/A ) > $@
0N/A
0N/A# Skip the test for product builds (which only work when installed in a JDK), to
0N/A# avoid exiting with an error and causing make to halt.
0N/ANO_TEST_MSG = \
0N/A echo "$@: skipping the test--this build must be tested in a JDK."
0N/A
0N/ANO_JAVA_HOME_MSG = \
0N/A echo "JAVA_HOME must be set to run this test."
0N/A
0N/ADATA_MODE = $(DATA_MODE/$(BUILDARCH))
0N/AJAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
0N/A
0N/ADATA_MODE/i486 = 32
0N/ADATA_MODE/sparc = 32
0N/ADATA_MODE/sparcv9 = 64
0N/ADATA_MODE/amd64 = 64
0N/ADATA_MODE/ia64 = 64
1010N/ADATA_MODE/zero = $(ARCH_DATA_MODEL)
0N/A
0N/AJAVA_FLAG/32 = -d32
0N/AJAVA_FLAG/64 = -d64
0N/A
0N/AWRONG_DATA_MODE_MSG = \
3129N/A echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
0N/A
1601N/ACROSS_COMPILING_MSG = \
1601N/A echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
1601N/A
232N/Atest_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
0N/A @echo Creating $@ ...
0N/A $(QUIETLY) ( \
3129N/A echo "#!/bin/sh"; \
3129N/A echo ""; \
0N/A $(BUILDTREE_COMMENT); \
3129N/A echo ""; \
3129N/A echo "# Include environment settings for gamma run"; \
3129N/A echo ""; \
3129N/A echo ". ./env.sh"; \
3129N/A echo ""; \
3129N/A echo "# Do not run gamma test for cross compiles"; \
3129N/A echo ""; \
3129N/A echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
3129N/A echo " $(CROSS_COMPILING_MSG)"; \
3129N/A echo " exit 0"; \
3129N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
3129N/A echo ""; \
3129N/A echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
3129N/A echo " $(NO_JAVA_HOME_MSG)"; \
3129N/A echo " exit 0"; \
3129N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "# Check JAVA_HOME version to be used for the test"; \
3129N/A echo ""; \
3129N/A echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
3129N/A echo "if [ \$$? -ne 0 ]; then "; \
3129N/A echo " $(WRONG_DATA_MODE_MSG)"; \
3129N/A echo " exit 0"; \
0N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "# Use gamma_g if it exists"; \
3129N/A echo ""; \
3129N/A echo "GAMMA_PROG=gamma"; \
3129N/A echo "if [ -f gamma_g ]; then "; \
3129N/A echo " GAMMA_PROG=gamma_g"; \
3129N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
3129N/A echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
3129N/A echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
3129N/A echo ""; \
3129N/A echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
3129N/A echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
3129N/A echo " if [ ! -f \$${JVM_LIB} ]; then"; \
3129N/A echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
3129N/A echo " fi"; \
3129N/A echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
3129N/A echo " $(WRONG_DATA_MODE_MSG)"; \
3129N/A echo " exit 0"; \
3129N/A echo " fi"; \
3129N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "# Compile Queens program for test"; \
3129N/A echo ""; \
232N/A echo "rm -f Queens.class"; \
232N/A echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
3129N/A echo ""; \
3129N/A echo "# Set library path solely for gamma launcher test run"; \
3129N/A echo ""; \
3129N/A echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
3129N/A echo "export LD_LIBRARY_PATH"; \
3129N/A echo "unset LD_LIBRARY_PATH_32"; \
3129N/A echo "unset LD_LIBRARY_PATH_64"; \
3129N/A echo ""; \
3129N/A echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
3129N/A echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
3129N/A echo " export DYLD_LIBRARY_PATH"; \
3129N/A echo "fi"; \
3129N/A echo ""; \
3129N/A echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
3129N/A echo ""; \
3129N/A echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
0N/A ) > $@
0N/A $(QUIETLY) chmod +x $@
0N/A
0N/AFORCE:
0N/A
0N/A.PHONY: all FORCE