annotate make/bsd/makefiles/buildtree.make @ 3038:e8a4934564b2

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