1 #
   2 # Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 # Usage:
  26 #
  27 # $(MAKE) -f buildtree.make ARCH=arch BUILDARCH=buildarch LIBARCH=libarch
  28 #         GAMMADIR=dir OS_FAMILY=os VARIANT=variant
  29 #
  30 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the
  31 # environment or on the command-line:
  32 #
  33 # ARCH          - sparc, i486, ... HotSpot cpu and os_cpu source directory
  34 # BUILDARCH     - build directory
  35 # LIBARCH       - the corresponding directory in JDK/JRE
  36 # GAMMADIR      - top of workspace
  37 # OS_FAMILY     - operating system
  38 # VARIANT       - core, compiler1, compiler2, or tiered
  39 # HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
  40 # HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
  41 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
  42 #
  43 # Builds the directory trees with makefiles plus some convenience files in
  44 # each directory:
  45 #
  46 # Makefile      - for "make foo"
  47 # flags.make    - with macro settings
  48 # vm.make       - to support making "$(MAKE) -v vm.make" in makefiles
  49 # adlc.make     - 
  50 # jvmti.make    - generate JVMTI bindings from the spec (JSR-163)
  51 # sa.make       - generate SA jar file and natives
  52 # env.[ck]sh    - environment settings
  53 # test_gamma    - script to run the Queens program
  54 # 
  55 # The makefiles are split this way so that "make foo" will run faster by not
  56 # having to read the dependency files for the vm.
  57 
  58 -include $(SPEC)
  59 include $(GAMMADIR)/make/scm.make
  60 include $(GAMMADIR)/make/altsrc.make
  61 
  62 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
  63 QUIETLY$(MAKE_VERBOSE)  = @
  64 
  65 # For now, until the compiler is less wobbly:
  66 TESTFLAGS       = -Xbatch -Xmx32m -showversion
  67 
  68 ### maye ARCH_XXX instead?
  69 ifdef USE_GCC
  70 PLATFORM_FILE   = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc
  71 GCC_LIB         = /usr/local/lib
  72 else
  73 PLATFORM_FILE   = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
  74 GCC_LIB         = 
  75 endif
  76 
  77 ifdef FORCE_TIERED
  78 ifeq            ($(VARIANT),tiered)
  79 PLATFORM_DIR    = $(OS_FAMILY)_$(BUILDARCH)_compiler2
  80 else
  81 PLATFORM_DIR    = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT)
  82 endif
  83 else
  84 PLATFORM_DIR    = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT)
  85 endif
  86 
  87 #
  88 # We do two levels of exclusion in the shared directory.
  89 # TOPLEVEL excludes are pruned, they are not recursively searched,
  90 # but lower level directories can be named without fear of collision.
  91 # ALWAYS excludes are excluded at any level in the directory tree.
  92 #
  93 
  94 ALWAYS_EXCLUDE_DIRS     = $(SCM_DIRS)
  95 
  96 ifeq            ($(VARIANT),tiered)
  97 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
  98 else
  99 ifeq            ($(VARIANT),compiler2)
 100 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
 101 else
 102 # compiler1 and core use the same exclude list
 103 TOPLEVEL_EXCLUDE_DIRS   = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
 104 endif
 105 endif
 106 
 107 # Get things from the platform file.
 108 COMPILER        = $(shell sed -n 's/^compiler[  ]*=[    ]*//p' $(PLATFORM_FILE))
 109 
 110 SIMPLE_DIRS     = \
 111         $(PLATFORM_DIR)/generated/dependencies \
 112         $(PLATFORM_DIR)/generated/adfiles \
 113         $(PLATFORM_DIR)/generated/jvmtifiles
 114 
 115 TARGETS      = debug fastdebug jvmg optimized product profiled
 116 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
 117 
 118 # For dependencies and recursive makes.
 119 BUILDTREE_MAKE  = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 120 
 121 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
 122         env.sh env.csh jdkpath.sh .dbxrc test_gamma
 123 
 124 BUILDTREE_VARS  = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 125         ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
 126 
 127 # Define variables to be set in flags.make.
 128 # Default values are set in make/defs.make.
 129 ifeq ($(HOTSPOT_BUILD_VERSION),)
 130   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
 131 else
 132   HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
 133 endif
 134 # Set BUILD_USER from system-dependent hints:  $LOGNAME, $(whoami)
 135 ifndef HOTSPOT_BUILD_USER
 136   HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
 137 endif
 138 ifndef HOTSPOT_BUILD_USER
 139   HOTSPOT_BUILD_USER := $(shell whoami)
 140 endif
 141 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
 142 # or make/hotspot_distro.
 143 ifndef HOTSPOT_VM_DISTRO
 144   ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
 145     include $(GAMMADIR)/make/hotspot_distro
 146   else
 147     include $(GAMMADIR)/make/openjdk_distro
 148   endif
 149 endif
 150 
 151 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) 
 152 
 153 BUILDTREE       = \
 154         $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS)
 155 
 156 BUILDTREE_COMMENT       = echo "\# Generated by $(BUILDTREE_MAKE)"
 157 
 158 all:  $(SUBMAKE_DIRS)
 159 
 160 # Run make in each subdirectory recursively.
 161 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE
 162         $(QUIETLY) [ -d $@ ] || { mkdir -p $@; }
 163         $(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F)
 164         $(QUIETLY) touch $@
 165 
 166 $(SIMPLE_DIRS):
 167         $(QUIETLY) mkdir -p $@
 168 
 169 # Convenience macro which takes a source relative path, applies $(1) to the
 170 # absolute path, and then replaces $(GAMMADIR) in the result with a 
 171 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.  
 172 gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
 173 
 174 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
 175         @echo Creating $@ ...
 176         $(QUIETLY) ( \
 177         $(BUILDTREE_COMMENT); \
 178         echo; \
 179         echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \
 180         sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
 181         echo; \
 182         echo "GAMMADIR = $(GAMMADIR)"; \
 183         echo "SYSDEFS = \$$(Platform_sysdefs)"; \
 184         echo "SRCARCH = $(ARCH)"; \
 185         echo "BUILDARCH = $(BUILDARCH)"; \
 186         echo "LIBARCH = $(LIBARCH)"; \
 187         echo "TARGET = $(TARGET)"; \
 188         echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
 189         echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
 190         echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
 191         echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
 192         echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
 193         echo "$(LP64_SETTING/$(DATA_MODE))"; \
 194         echo; \
 195         echo "# Used for platform dispatching"; \
 196         echo "TARGET_DEFINES  = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
 197         echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
 198         echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
 199         echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
 200         echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
 201         echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
 202         echo "CFLAGS += \$$(TARGET_DEFINES)"; \
 203         echo; \
 204         echo "Src_Dirs_V = \\"; \
 205         sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
 206         echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \
 207         echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \
 208         echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
 209         echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
 210         echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
 211         echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
 212         echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
 213         echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 214         echo; \
 215         echo "Src_Dirs_I = \\"; \
 216         echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \
 217         echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \
 218         echo "$(call gamma-path,altsrc,share/vm) \\"; \
 219         echo "$(call gamma-path,commonsrc,share/vm) \\"; \
 220         echo "$(call gamma-path,altsrc,share/vm/precompiled) \\"; \
 221         echo "$(call gamma-path,commonsrc,share/vm/precompiled) \\"; \
 222         echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \
 223         echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \
 224         echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
 225         echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
 226         echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
 227         echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
 228         echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
 229         echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 230         [ -n "$(CFLAGS_BROWSE)" ] && \
 231             echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 232         [ -n "$(OBJCOPY)" ] && \
 233             echo && echo "OBJCOPY = $(OBJCOPY)"; \
 234         [ -n "$(STRIP_POLICY)" ] && \
 235             echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
 236         [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 237             echo && \
 238             echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
 239             echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
 240         echo; \
 241         [ -n "$(SPEC)" ] && \
 242             echo "include $(SPEC)"; \
 243         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
 244         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
 245         ) > $@
 246 
 247 flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
 248         @echo Creating $@ ...
 249         $(QUIETLY) ( \
 250         $(BUILDTREE_COMMENT); \
 251         echo; \
 252         [ "$(TARGET)" = profiled ] && \
 253         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
 254         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
 255         ) > $@
 256 
 257 ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
 258         @echo Creating directory list $@
 259         $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
 260           find $(HS_ALT_SRC)/share/vm/* -prune \
 261           -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
 262           \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \
 263         fi;
 264         $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \
 265         -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
 266         \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@
 267 
 268 Makefile: $(BUILDTREE_MAKE)
 269         @echo Creating $@ ...
 270         $(QUIETLY) ( \
 271         $(BUILDTREE_COMMENT); \
 272         echo; \
 273         echo include flags.make; \
 274         echo; \
 275         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/top.make"; \
 276         ) > $@
 277 
 278 vm.make: $(BUILDTREE_MAKE)
 279         @echo Creating $@ ...
 280         $(QUIETLY) ( \
 281         $(BUILDTREE_COMMENT); \
 282         echo; \
 283         echo include flags.make; \
 284         echo include flags_vm.make; \
 285         echo; \
 286         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 287         ) > $@
 288 
 289 adlc.make: $(BUILDTREE_MAKE)
 290         @echo Creating $@ ...
 291         $(QUIETLY) ( \
 292         $(BUILDTREE_COMMENT); \
 293         echo; \
 294         echo include flags.make; \
 295         echo; \
 296         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 297         ) > $@
 298 
 299 jvmti.make: $(BUILDTREE_MAKE)
 300         @echo Creating $@ ...
 301         $(QUIETLY) ( \
 302         $(BUILDTREE_COMMENT); \
 303         echo; \
 304         echo include flags.make; \
 305         echo; \
 306         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 307         ) > $@
 308 
 309 sa.make: $(BUILDTREE_MAKE)
 310         @echo Creating $@ ...
 311         $(QUIETLY) ( \
 312         $(BUILDTREE_COMMENT); \
 313         echo; \
 314         echo include flags.make; \
 315         echo; \
 316         echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
 317         ) > $@
 318 
 319 env.sh: $(BUILDTREE_MAKE)
 320         @echo Creating $@ ...
 321         $(QUIETLY) ( \
 322         $(BUILDTREE_COMMENT); \
 323         [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
 324         { \
 325         echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
 326         } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
 327         echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
 328         echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \
 329         ) > $@
 330 
 331 env.csh: env.sh
 332         @echo Creating $@ ...
 333         $(QUIETLY) ( \
 334         $(BUILDTREE_COMMENT); \
 335         [ -n "$$JAVA_HOME" ] && \
 336         { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
 337         sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
 338         ) > $@
 339 
 340 jdkpath.sh: $(BUILDTREE_MAKE)
 341         @echo Creating $@ ...
 342         $(QUIETLY) ( \
 343         $(BUILDTREE_COMMENT); \
 344         echo "JDK=${JAVA_HOME}"; \
 345         ) > $@          
 346 
 347 .dbxrc:  $(BUILDTREE_MAKE)
 348         @echo Creating $@ ...
 349         $(QUIETLY) ( \
 350         echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
 351         echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
 352         echo "then"; \
 353         echo "  source \"\$${HOTSPOT_DBXWARE}\""; \
 354         echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
 355         echo "then"; \
 356         echo "  source \"\$$HOME/.dbxrc\""; \
 357         echo "fi"; \
 358         ) > $@
 359 
 360 # Skip the test for product builds (which only work when installed in a JDK), to
 361 # avoid exiting with an error and causing make to halt.
 362 NO_TEST_MSG     = \
 363         echo "$@:  skipping the test--this build must be tested in a JDK."
 364 
 365 NO_JAVA_HOME_MSG        = \
 366         echo "JAVA_HOME must be set to run this test."
 367 
 368 DATA_MODE = $(DATA_MODE/$(BUILDARCH))
 369 JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
 370 
 371 DATA_MODE/i486    = 32
 372 DATA_MODE/sparc   = 32
 373 DATA_MODE/sparcv9 = 64
 374 DATA_MODE/amd64   = 64
 375 DATA_MODE/ia64    = 64
 376 
 377 # This bit is needed to enable local rebuilds.
 378 # Unless the makefile itself sets LP64, any environmental
 379 # setting of LP64 will interfere with the build.
 380 LP64_SETTING/32 = LP64 = \#empty
 381 LP64_SETTING/64 = LP64 = 1
 382 
 383 JAVA_FLAG/32 = -d32
 384 JAVA_FLAG/64 = -d64
 385 
 386 WRONG_DATA_MODE_MSG = \
 387         echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
 388 
 389 CROSS_COMPILING_MSG = \
 390         echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
 391 
 392 test_gamma:  $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
 393         @echo Creating $@ ...
 394         $(QUIETLY) ( \
 395         echo "#!/bin/sh"; \
 396         echo ""; \
 397         $(BUILDTREE_COMMENT); \
 398         echo ""; \
 399         echo "# Include environment settings for gamma run"; \
 400         echo ""; \
 401         echo ". ./env.sh"; \
 402         echo ""; \
 403         echo "# Do not run gamma test for cross compiles"; \
 404         echo ""; \
 405         echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
 406         echo "  $(CROSS_COMPILING_MSG)"; \
 407         echo "  exit 0"; \
 408         echo "fi"; \
 409         echo ""; \
 410         echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
 411         echo ""; \
 412         echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
 413         echo "  $(NO_JAVA_HOME_MSG)"; \
 414         echo "  exit 0"; \
 415         echo "fi"; \
 416         echo ""; \
 417         echo "# Check JAVA_HOME version to be used for the test"; \
 418         echo ""; \
 419         echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
 420         echo "if [ \$$? -ne 0 ]; then "; \
 421         echo "  $(WRONG_DATA_MODE_MSG)"; \
 422         echo "  exit 0"; \
 423         echo "fi"; \
 424         echo ""; \
 425         echo "# Use gamma_g if it exists"; \
 426         echo ""; \
 427         echo "GAMMA_PROG=gamma"; \
 428         echo "if [ -f gamma_g ]; then "; \
 429         echo "  GAMMA_PROG=gamma_g"; \
 430         echo "fi"; \
 431         echo ""; \
 432         echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
 433         echo "  # Ensure architecture for gamma and JAVA_HOME is the same."; \
 434         echo "  # NOTE: gamma assumes the OpenJDK directory layout."; \
 435         echo ""; \
 436         echo "  GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
 437         echo "  JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
 438         echo "  if [ ! -f \$${JVM_LIB} ]; then"; \
 439         echo "    JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
 440         echo "  fi"; \
 441         echo "  if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
 442         echo "    $(WRONG_DATA_MODE_MSG)"; \
 443         echo "    exit 0"; \
 444         echo "  fi"; \
 445         echo "fi"; \
 446         echo ""; \
 447         echo "# Compile Queens program for test"; \
 448         echo ""; \
 449         echo "rm -f Queens.class"; \
 450         echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
 451         echo ""; \
 452         echo "# Set library path solely for gamma launcher test run"; \
 453         echo ""; \
 454         echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
 455         echo "export LD_LIBRARY_PATH"; \
 456         echo "unset LD_LIBRARY_PATH_32"; \
 457         echo "unset LD_LIBRARY_PATH_64"; \
 458         echo ""; \
 459         echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
 460         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}"; \
 461         echo "  export DYLD_LIBRARY_PATH"; \
 462         echo "fi"; \
 463         echo ""; \
 464         echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
 465         echo ""; \
 466         echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
 467         ) > $@
 468         $(QUIETLY) chmod +x $@
 469 
 470 FORCE:
 471 
 472 .PHONY:  all FORCE