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