Mercurial > hg > truffle
annotate make/bsd/makefiles/buildtree.make @ 4852:6d00795f99a1
Merge
author | dsamersoff |
---|---|
date | Wed, 25 Jan 2012 15:03:42 -0800 |
parents | e8a4934564b2 |
children | 7292cff45988 |
rev | line source |
---|---|
3960 | 1 # |
2 # Copyright (c) 2005, 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 SRCARCH=srcarch 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 | |
4108
8657ec177a14
7117748: SA_APPLE_BOOT_JAVA and ALWAYS_PASS_TEST_GAMMA settings should not be required on MacOS X
dcubed
parents:
4033
diff
changeset
|
58 # needs to be set here since this Makefile doesn't include defs.make |
8657ec177a14
7117748: SA_APPLE_BOOT_JAVA and ALWAYS_PASS_TEST_GAMMA settings should not be required on MacOS X
dcubed
parents:
4033
diff
changeset
|
59 OS_VENDOR:=$(shell uname -s) |
8657ec177a14
7117748: SA_APPLE_BOOT_JAVA and ALWAYS_PASS_TEST_GAMMA settings should not be required on MacOS X
dcubed
parents:
4033
diff
changeset
|
60 |
3960 | 61 include $(GAMMADIR)/make/scm.make |
62 include $(GAMMADIR)/make/altsrc.make | |
63 | |
64 | |
65 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. | |
66 QUIETLY$(MAKE_VERBOSE) = @ | |
67 | |
68 # For now, until the compiler is less wobbly: | |
69 TESTFLAGS = -Xbatch -showversion | |
70 | |
71 ifeq ($(ZERO_BUILD), true) | |
72 PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero | |
73 else | |
74 ifdef USE_SUNCC | |
75 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc | |
76 else | |
77 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH) | |
78 endif | |
79 endif | |
80 | |
81 # Allow overriding of the arch part of the directory but default | |
82 # to BUILDARCH if nothing is specified | |
83 ifeq ($(VARIANTARCH),) | |
84 VARIANTARCH=$(BUILDARCH) | |
85 endif | |
86 | |
87 ifdef FORCE_TIERED | |
88 ifeq ($(VARIANT),tiered) | |
89 PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_compiler2 | |
90 else | |
91 PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT) | |
92 endif | |
93 else | |
94 PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT) | |
95 endif | |
96 | |
97 # | |
98 # We do two levels of exclusion in the shared directory. | |
99 # TOPLEVEL excludes are pruned, they are not recursively searched, | |
100 # but lower level directories can be named without fear of collision. | |
101 # ALWAYS excludes are excluded at any level in the directory tree. | |
102 # | |
103 | |
104 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS) | |
105 | |
106 ifeq ($(VARIANT),tiered) | |
107 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent | |
108 else | |
109 ifeq ($(VARIANT),compiler2) | |
110 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent | |
111 else | |
112 # compiler1 and core use the same exclude list | |
113 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent | |
114 endif | |
115 endif | |
116 | |
117 # Get things from the platform file. | |
118 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE)) | |
119 | |
4006 | 120 # dtracefiles is used on BSD versions that implement Dtrace (like MacOS X) |
3960 | 121 SIMPLE_DIRS = \ |
122 $(PLATFORM_DIR)/generated/dependencies \ | |
123 $(PLATFORM_DIR)/generated/adfiles \ | |
4006 | 124 $(PLATFORM_DIR)/generated/jvmtifiles \ |
125 $(PLATFORM_DIR)/generated/dtracefiles | |
3960 | 126 |
127 TARGETS = debug fastdebug jvmg optimized product profiled | |
128 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) | |
129 | |
130 # For dependencies and recursive makes. | |
131 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make | |
132 | |
4006 | 133 # dtrace.make is used on BSD versions that implement Dtrace (like MacOS X) |
134 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \ | |
135 jvmti.make sa.make dtrace.make \ | |
3960 | 136 env.sh env.csh jdkpath.sh .dbxrc test_gamma |
137 | |
138 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ | |
139 SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) | |
140 | |
141 # Define variables to be set in flags.make. | |
142 # Default values are set in make/defs.make. | |
143 ifeq ($(HOTSPOT_BUILD_VERSION),) | |
144 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION) | |
145 else | |
146 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) | |
147 endif | |
148 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami) | |
149 ifndef HOTSPOT_BUILD_USER | |
150 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME) | |
151 endif | |
152 ifndef HOTSPOT_BUILD_USER | |
153 HOTSPOT_BUILD_USER := $(shell whoami) | |
154 endif | |
155 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro | |
156 # or make/hotspot_distro. | |
157 ifndef HOTSPOT_VM_DISTRO | |
158 ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) | |
159 include $(GAMMADIR)/make/hotspot_distro | |
160 else | |
161 include $(GAMMADIR)/make/openjdk_distro | |
162 endif | |
163 endif | |
164 | |
165 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) | |
166 | |
167 BUILDTREE = \ | |
168 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS) | |
169 | |
170 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)" | |
171 | |
172 all: $(SUBMAKE_DIRS) | |
173 | |
174 # Run make in each subdirectory recursively. | |
175 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE | |
176 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; } | |
177 $(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F) | |
178 $(QUIETLY) touch $@ | |
179 | |
180 $(SIMPLE_DIRS): | |
181 $(QUIETLY) mkdir -p $@ | |
182 | |
183 # Convenience macro which takes a source relative path, applies $(1) to the | |
184 # absolute path, and then replaces $(GAMMADIR) in the result with a | |
185 # literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. | |
186 gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2))) | |
187 | |
188 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst | |
189 @echo Creating $@ ... | |
190 $(QUIETLY) ( \ | |
191 $(BUILDTREE_COMMENT); \ | |
192 echo; \ | |
193 echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ | |
194 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ | |
195 echo; \ | |
196 echo "GAMMADIR = $(GAMMADIR)"; \ | |
197 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ | |
198 echo "SRCARCH = $(SRCARCH)"; \ | |
199 echo "BUILDARCH = $(BUILDARCH)"; \ | |
200 echo "LIBARCH = $(LIBARCH)"; \ | |
201 echo "TARGET = $(TARGET)"; \ | |
202 echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \ | |
203 echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \ | |
204 echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \ | |
205 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ | |
206 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ | |
207 echo; \ | |
208 echo "# Used for platform dispatching"; \ | |
209 echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \ | |
210 echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \ | |
211 echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \ | |
212 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \ | |
213 echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \ | |
214 echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \ | |
215 echo "CFLAGS += \$$(TARGET_DEFINES)"; \ | |
216 echo; \ | |
217 echo "Src_Dirs_V = \\"; \ | |
218 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ | |
219 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ | |
220 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ | |
221 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | |
222 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | |
223 echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ | |
224 echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ | |
225 echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ | |
226 echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ | |
227 echo; \ | |
228 echo "Src_Dirs_I = \\"; \ | |
229 echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \ | |
230 echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \ | |
231 echo "$(call gamma-path,altsrc,share/vm) \\"; \ | |
232 echo "$(call gamma-path,commonsrc,share/vm) \\"; \ | |
4033
95009f678859
7106766: Move the precompiled header from the src/share/vm directory
brutisso
parents:
4006
diff
changeset
|
233 echo "$(call gamma-path,altsrc,share/vm/precompiled) \\"; \ |
95009f678859
7106766: Move the precompiled header from the src/share/vm directory
brutisso
parents:
4006
diff
changeset
|
234 echo "$(call gamma-path,commonsrc,share/vm/precompiled) \\"; \ |
3960 | 235 echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ |
236 echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ | |
237 echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | |
238 echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ | |
239 echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ | |
240 echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ | |
241 echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ | |
242 echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ | |
243 [ -n "$(CFLAGS_BROWSE)" ] && \ | |
244 echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ | |
245 [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ | |
246 echo && \ | |
247 echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ | |
248 echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \ | |
249 echo; \ | |
250 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ | |
251 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ | |
252 ) > $@ | |
253 | |
254 flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst | |
255 @echo Creating $@ ... | |
256 $(QUIETLY) ( \ | |
257 $(BUILDTREE_COMMENT); \ | |
258 echo; \ | |
259 [ "$(TARGET)" = profiled ] && \ | |
260 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \ | |
261 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \ | |
262 ) > $@ | |
263 | |
264 ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm | |
265 @echo Creating directory list $@ | |
266 $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \ | |
267 find $(HS_ALT_SRC)/share/vm/* -prune \ | |
268 -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ | |
269 \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \ | |
270 fi; | |
271 $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \ | |
272 -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ | |
273 \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@ | |
274 | |
275 Makefile: $(BUILDTREE_MAKE) | |
276 @echo Creating $@ ... | |
277 $(QUIETLY) ( \ | |
278 $(BUILDTREE_COMMENT); \ | |
279 echo; \ | |
280 echo include flags.make; \ | |
281 echo; \ | |
282 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/top.make"; \ | |
283 ) > $@ | |
284 | |
285 vm.make: $(BUILDTREE_MAKE) | |
286 @echo Creating $@ ... | |
287 $(QUIETLY) ( \ | |
288 $(BUILDTREE_COMMENT); \ | |
289 echo; \ | |
290 echo include flags.make; \ | |
291 echo include flags_vm.make; \ | |
292 echo; \ | |
293 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | |
294 ) > $@ | |
295 | |
296 adlc.make: $(BUILDTREE_MAKE) | |
297 @echo Creating $@ ... | |
298 $(QUIETLY) ( \ | |
299 $(BUILDTREE_COMMENT); \ | |
300 echo; \ | |
301 echo include flags.make; \ | |
302 echo; \ | |
303 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | |
304 ) > $@ | |
305 | |
306 jvmti.make: $(BUILDTREE_MAKE) | |
307 @echo Creating $@ ... | |
308 $(QUIETLY) ( \ | |
309 $(BUILDTREE_COMMENT); \ | |
310 echo; \ | |
311 echo include flags.make; \ | |
312 echo; \ | |
313 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | |
314 ) > $@ | |
315 | |
316 sa.make: $(BUILDTREE_MAKE) | |
317 @echo Creating $@ ... | |
318 $(QUIETLY) ( \ | |
319 $(BUILDTREE_COMMENT); \ | |
320 echo; \ | |
321 echo include flags.make; \ | |
322 echo; \ | |
323 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | |
324 ) > $@ | |
325 | |
4006 | 326 dtrace.make: $(BUILDTREE_MAKE) |
327 @echo Creating $@ ... | |
328 $(QUIETLY) ( \ | |
329 $(BUILDTREE_COMMENT); \ | |
330 echo; \ | |
331 echo include flags.make; \ | |
332 echo; \ | |
333 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ | |
334 ) > $@ | |
335 | |
3960 | 336 env.sh: $(BUILDTREE_MAKE) |
337 @echo Creating $@ ... | |
338 $(QUIETLY) ( \ | |
339 $(BUILDTREE_COMMENT); \ | |
340 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ | |
341 { \ | |
342 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ | |
343 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ | |
344 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ | |
4846 | 345 echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \ |
3960 | 346 ) > $@ |
347 | |
348 env.csh: env.sh | |
349 @echo Creating $@ ... | |
350 $(QUIETLY) ( \ | |
351 $(BUILDTREE_COMMENT); \ | |
352 [ -n "$$JAVA_HOME" ] && \ | |
353 { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \ | |
354 sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ | |
355 ) > $@ | |
356 | |
357 jdkpath.sh: $(BUILDTREE_MAKE) | |
358 @echo Creating $@ ... | |
359 $(QUIETLY) ( \ | |
360 $(BUILDTREE_COMMENT); \ | |
361 echo "JDK=${JAVA_HOME}"; \ | |
362 ) > $@ | |
363 | |
364 .dbxrc: $(BUILDTREE_MAKE) | |
365 @echo Creating $@ ... | |
366 $(QUIETLY) ( \ | |
367 echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \ | |
368 echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \ | |
369 echo "then"; \ | |
370 echo " source \"\$${HOTSPOT_DBXWARE}\""; \ | |
371 echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \ | |
372 echo "then"; \ | |
373 echo " source \"\$$HOME/.dbxrc\""; \ | |
374 echo "fi"; \ | |
375 ) > $@ | |
376 | |
377 # Skip the test for product builds (which only work when installed in a JDK), to | |
378 # avoid exiting with an error and causing make to halt. | |
379 NO_TEST_MSG = \ | |
380 echo "$@: skipping the test--this build must be tested in a JDK." | |
381 | |
382 NO_JAVA_HOME_MSG = \ | |
383 echo "JAVA_HOME must be set to run this test." | |
384 | |
385 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) | |
386 JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE)) | |
387 | |
388 DATA_MODE/i486 = 32 | |
389 DATA_MODE/sparc = 32 | |
390 DATA_MODE/sparcv9 = 64 | |
391 DATA_MODE/amd64 = 64 | |
392 DATA_MODE/ia64 = 64 | |
393 DATA_MODE/zero = $(ARCH_DATA_MODEL) | |
394 | |
395 JAVA_FLAG/32 = -d32 | |
396 JAVA_FLAG/64 = -d64 | |
397 | |
398 WRONG_DATA_MODE_MSG = \ | |
4846 | 399 echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK." |
3960 | 400 |
401 CROSS_COMPILING_MSG = \ | |
402 echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run." | |
403 | |
404 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java | |
405 @echo Creating $@ ... | |
406 $(QUIETLY) ( \ | |
4846 | 407 echo "#!/bin/sh"; \ |
408 echo ""; \ | |
3960 | 409 $(BUILDTREE_COMMENT); \ |
4846 | 410 echo ""; \ |
411 echo "# Include environment settings for gamma run"; \ | |
412 echo ""; \ | |
413 echo ". ./env.sh"; \ | |
414 echo ""; \ | |
415 echo "# Do not run gamma test for cross compiles"; \ | |
416 echo ""; \ | |
417 echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \ | |
418 echo " $(CROSS_COMPILING_MSG)"; \ | |
419 echo " exit 0"; \ | |
420 echo "fi"; \ | |
421 echo ""; \ | |
422 echo "# Make sure JAVA_HOME is set as it is required for gamma"; \ | |
423 echo ""; \ | |
424 echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \ | |
425 echo " $(NO_JAVA_HOME_MSG)"; \ | |
426 echo " exit 0"; \ | |
427 echo "fi"; \ | |
428 echo ""; \ | |
429 echo "# Check JAVA_HOME version to be used for the test"; \ | |
430 echo ""; \ | |
431 echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \ | |
432 echo "if [ \$$? -ne 0 ]; then "; \ | |
433 echo " $(WRONG_DATA_MODE_MSG)"; \ | |
434 echo " exit 0"; \ | |
3960 | 435 echo "fi"; \ |
4846 | 436 echo ""; \ |
437 echo "# Use gamma_g if it exists"; \ | |
438 echo ""; \ | |
439 echo "GAMMA_PROG=gamma"; \ | |
440 echo "if [ -f gamma_g ]; then "; \ | |
441 echo " GAMMA_PROG=gamma_g"; \ | |
442 echo "fi"; \ | |
443 echo ""; \ | |
444 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \ | |
445 echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \ | |
446 echo " # NOTE: gamma assumes the OpenJDK directory layout."; \ | |
447 echo ""; \ | |
448 echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \ | |
449 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \ | |
450 echo " if [ ! -f \$${JVM_LIB} ]; then"; \ | |
451 echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \ | |
452 echo " fi"; \ | |
453 echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \ | |
454 echo " $(WRONG_DATA_MODE_MSG)"; \ | |
455 echo " exit 0"; \ | |
456 echo " fi"; \ | |
457 echo "fi"; \ | |
458 echo ""; \ | |
459 echo "# Compile Queens program for test"; \ | |
460 echo ""; \ | |
3960 | 461 echo "rm -f Queens.class"; \ |
462 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ | |
4846 | 463 echo ""; \ |
464 echo "# Set library path solely for gamma launcher test run"; \ | |
465 echo ""; \ | |
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}"; \ | |
467 echo "export LD_LIBRARY_PATH"; \ | |
468 echo "unset LD_LIBRARY_PATH_32"; \ | |
469 echo "unset LD_LIBRARY_PATH_64"; \ | |
470 echo ""; \ | |
471 echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \ | |
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}"; \ | |
473 echo " export DYLD_LIBRARY_PATH"; \ | |
474 echo "fi"; \ | |
475 echo ""; \ | |
476 echo "# Use the gamma launcher and JAVA_HOME to run the test"; \ | |
477 echo ""; \ | |
478 echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \ | |
3960 | 479 ) > $@ |
480 $(QUIETLY) chmod +x $@ | |
481 | |
482 FORCE: | |
483 | |
484 .PHONY: all FORCE |