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