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