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