Mercurial > hg > truffle
annotate make/solaris/makefiles/buildtree.make @ 419:0bf25c4807f9
6761594: framesize rounding code rounds using wrong units leading to slightly oversized frames
Reviewed-by: rasbold, kvn
author | never |
---|---|
date | Thu, 06 Nov 2008 20:00:03 -0800 |
parents | 9c2ecc2ffb12 |
children | c18cbe5936b8 |
rev | line source |
---|---|
0 | 1 # |
196 | 2 # Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. |
0 | 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 # CA 95054 USA or visit www.sun.com if you need additional information or | |
21 # have any questions. | |
22 # | |
23 # | |
24 | |
25 # Usage: | |
26 # | |
27 # $(MAKE) -f buildtree.make ARCH=arch 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, PRTjob ID, JPRTjob ID | |
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 | |
60 # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. | |
61 QUIETLY$(MAKE_VERBOSE) = @ | |
62 | |
63 # For now, until the compiler is less wobbly: | |
64 TESTFLAGS = -Xbatch -showversion | |
65 | |
66 ### maye ARCH_XXX instead? | |
67 ifdef USE_GCC | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
68 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc |
0 | 69 GCC_LIB = /usr/local/lib |
70 else | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
71 PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH) |
0 | 72 GCC_LIB = |
73 endif | |
74 | |
75 ifdef FORCE_TIERED | |
76 ifeq ($(VARIANT),tiered) | |
77 PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_compiler2 | |
78 else | |
79 PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT) | |
80 endif | |
81 else | |
82 PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT) | |
83 endif | |
84 | |
85 # | |
86 # We do two levels of exclusion in the shared directory. | |
87 # TOPLEVEL excludes are pruned, they are not recursively searched, | |
88 # but lower level directories can be named without fear of collision. | |
89 # ALWAYS excludes are excluded at any level in the directory tree. | |
90 # | |
91 | |
92 ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS) | |
93 | |
94 ifeq ($(VARIANT),tiered) | |
95 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent | |
96 else | |
97 ifeq ($(VARIANT),compiler2) | |
98 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent | |
99 else | |
100 # compiler1 and core use the same exclude list | |
101 TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent | |
102 endif | |
103 endif | |
104 | |
105 # Get things from the platform file. | |
106 COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE)) | |
107 | |
108 SIMPLE_DIRS = \ | |
109 $(PLATFORM_DIR)/generated/incls \ | |
110 $(PLATFORM_DIR)/generated/adfiles \ | |
111 $(PLATFORM_DIR)/generated/jvmtifiles | |
112 | |
113 TARGETS = debug fastdebug jvmg optimized product profiled | |
114 SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) | |
115 | |
116 # For dependencies and recursive makes. | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
117 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make |
0 | 118 |
119 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ | |
120 env.ksh env.csh .dbxrc test_gamma | |
121 | |
122 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ | |
123 ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) | |
124 | |
125 # Define variables to be set in flags.make. | |
126 # Default values are set in make/defs.make. | |
127 ifeq ($(HOTSPOT_BUILD_VERSION),) | |
128 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION) | |
129 else | |
130 HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) | |
131 endif | |
132 # Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami) | |
133 ifndef HOTSPOT_BUILD_USER | |
134 HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME) | |
135 endif | |
136 ifndef HOTSPOT_BUILD_USER | |
137 HOTSPOT_BUILD_USER := $(shell whoami) | |
138 endif | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
139 # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro |
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
140 # or make/hotspot_distro. |
0 | 141 ifndef HOTSPOT_VM_DISTRO |
142 CLOSED_DIR_EXISTS := $(shell \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
143 if [ -d $(GAMMADIR)/src/closed ] ; then \ |
0 | 144 echo true; \ |
145 else \ | |
146 echo false; \ | |
147 fi) | |
148 ifeq ($(CLOSED_DIR_EXISTS), true) | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
149 include $(GAMMADIR)/make/hotspot_distro |
0 | 150 else |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
151 include $(GAMMADIR)/make/openjdk_distro |
0 | 152 endif |
153 endif | |
154 | |
155 BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) | |
156 | |
157 BUILDTREE = \ | |
158 $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS) | |
159 | |
160 BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)" | |
161 | |
162 all: $(SUBMAKE_DIRS) | |
163 | |
164 # Run make in each subdirectory recursively. | |
165 $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE | |
166 $(QUIETLY) [ -d $@ ] || { mkdir -p $@; } | |
167 $(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F) | |
168 $(QUIETLY) touch $@ | |
169 | |
170 $(SIMPLE_DIRS): | |
171 $(QUIETLY) mkdir -p $@ | |
172 | |
173 flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst | |
174 @echo Creating $@ ... | |
175 $(QUIETLY) ( \ | |
176 $(BUILDTREE_COMMENT); \ | |
177 echo; \ | |
178 echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \ | |
179 sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ | |
180 echo; \ | |
181 echo "GAMMADIR = $(GAMMADIR)"; \ | |
182 echo "SYSDEFS = \$$(Platform_sysdefs)"; \ | |
183 echo "SRCARCH = $(ARCH)"; \ | |
184 echo "BUILDARCH = $(BUILDARCH)"; \ | |
185 echo "LIBARCH = $(LIBARCH)"; \ | |
186 echo "TARGET = $(TARGET)"; \ | |
187 echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \ | |
188 echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \ | |
189 echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \ | |
190 echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \ | |
191 echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \ | |
192 echo "$(LP64_SETTING/$(DATA_MODE))"; \ | |
193 echo; \ | |
194 echo "Src_Dirs = \\"; \ | |
195 sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ | |
196 echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ | |
197 echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ | |
198 echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ | |
199 [ -n "$(CFLAGS_BROWSE)" ] && \ | |
200 echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ | |
201 [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ | |
202 echo && \ | |
203 echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ | |
204 echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \ | |
205 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
206 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ |
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
207 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ |
0 | 208 ) > $@ |
209 | |
210 flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst | |
211 @echo Creating $@ ... | |
212 $(QUIETLY) ( \ | |
213 $(BUILDTREE_COMMENT); \ | |
214 echo; \ | |
215 [ "$(TARGET)" = profiled ] && \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
216 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \ |
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
217 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \ |
0 | 218 ) > $@ |
219 | |
220 ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm | |
221 @echo Creating directory list $@ | |
222 $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \ | |
223 -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ | |
224 \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@ | |
225 | |
226 Makefile: $(BUILDTREE_MAKE) | |
227 @echo Creating $@ ... | |
228 $(QUIETLY) ( \ | |
229 $(BUILDTREE_COMMENT); \ | |
230 echo; \ | |
231 echo include flags.make; \ | |
232 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
233 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/top.make"; \ |
0 | 234 ) > $@ |
235 | |
236 vm.make: $(BUILDTREE_MAKE) | |
237 @echo Creating $@ ... | |
238 $(QUIETLY) ( \ | |
239 $(BUILDTREE_COMMENT); \ | |
240 echo; \ | |
241 echo include flags.make; \ | |
242 echo include flags_vm.make; \ | |
243 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
244 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ |
0 | 245 ) > $@ |
246 | |
247 adlc.make: $(BUILDTREE_MAKE) | |
248 @echo Creating $@ ... | |
249 $(QUIETLY) ( \ | |
250 $(BUILDTREE_COMMENT); \ | |
251 echo; \ | |
252 echo include flags.make; \ | |
253 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
254 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ |
0 | 255 ) > $@ |
256 | |
257 jvmti.make: $(BUILDTREE_MAKE) | |
258 @echo Creating $@ ... | |
259 $(QUIETLY) ( \ | |
260 $(BUILDTREE_COMMENT); \ | |
261 echo; \ | |
262 echo include flags.make; \ | |
263 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
264 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ |
0 | 265 ) > $@ |
266 | |
267 sa.make: $(BUILDTREE_MAKE) | |
268 @echo Creating $@ ... | |
269 $(QUIETLY) ( \ | |
270 $(BUILDTREE_COMMENT); \ | |
271 echo; \ | |
272 echo include flags.make; \ | |
273 echo; \ | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
274 echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ |
0 | 275 ) > $@ |
276 | |
277 env.ksh: $(BUILDTREE_MAKE) | |
278 @echo Creating $@ ... | |
279 $(QUIETLY) ( \ | |
280 $(BUILDTREE_COMMENT); \ | |
281 [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ | |
282 { \ | |
283 echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \ | |
284 echo "unset LD_LIBRARY_PATH_32"; \ | |
285 echo "unset LD_LIBRARY_PATH_64"; \ | |
286 echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ | |
287 } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ | |
288 echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ | |
289 echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ | |
290 ) > $@ | |
291 | |
292 env.csh: env.ksh | |
293 @echo Creating $@ ... | |
294 $(QUIETLY) ( \ | |
295 $(BUILDTREE_COMMENT); \ | |
296 [ -n "$$JAVA_HOME" ] && \ | |
297 { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \ | |
298 sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ | |
299 ) > $@ | |
300 | |
301 .dbxrc: $(BUILDTREE_MAKE) | |
302 @echo Creating $@ ... | |
303 $(QUIETLY) ( \ | |
304 echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \ | |
305 echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \ | |
306 echo "then"; \ | |
307 echo " source \"\$${HOTSPOT_DBXWARE}\""; \ | |
308 echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \ | |
309 echo "then"; \ | |
310 echo " source \"\$$HOME/.dbxrc\""; \ | |
311 echo "fi"; \ | |
312 ) > $@ | |
313 | |
314 # Skip the test for product builds (which only work when installed in a JDK), to | |
315 # avoid exiting with an error and causing make to halt. | |
316 NO_TEST_MSG = \ | |
317 echo "$@: skipping the test--this build must be tested in a JDK." | |
318 | |
319 NO_JAVA_HOME_MSG = \ | |
320 echo "JAVA_HOME must be set to run this test." | |
321 | |
322 DATA_MODE = $(DATA_MODE/$(BUILDARCH)) | |
323 JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE)) | |
324 | |
325 DATA_MODE/i486 = 32 | |
326 DATA_MODE/sparc = 32 | |
327 DATA_MODE/sparcv9 = 64 | |
328 DATA_MODE/amd64 = 64 | |
329 DATA_MODE/ia64 = 64 | |
330 | |
331 # This bit is needed to enable local rebuilds. | |
332 # Unless the makefile itself sets LP64, any environmental | |
333 # setting of LP64 will interfere with the build. | |
334 LP64_SETTING/32 = LP64 = \#empty | |
335 LP64_SETTING/64 = LP64 = 1 | |
336 | |
337 JAVA_FLAG/32 = -d32 | |
338 JAVA_FLAG/64 = -d64 | |
339 | |
340 WRONG_DATA_MODE_MSG = \ | |
341 echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." | |
342 | |
232
551f4309f476
6695777: Queens.class should be built from source, not put in source repo
ohair
parents:
91
diff
changeset
|
343 test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java |
0 | 344 @echo Creating $@ ... |
345 $(QUIETLY) ( \ | |
346 echo '#!/bin/ksh'; \ | |
347 $(BUILDTREE_COMMENT); \ | |
348 echo '. ./env.ksh'; \ | |
349 echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ | |
350 echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ | |
351 echo "then"; \ | |
352 echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ | |
353 echo "fi"; \ | |
232
551f4309f476
6695777: Queens.class should be built from source, not put in source repo
ohair
parents:
91
diff
changeset
|
354 echo "rm -f Queens.class"; \ |
551f4309f476
6695777: Queens.class should be built from source, not put in source repo
ohair
parents:
91
diff
changeset
|
355 echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ |
0 | 356 echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ |
357 echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ | |
358 ) > $@ | |
359 $(QUIETLY) chmod +x $@ | |
360 | |
361 FORCE: | |
362 | |
363 .PHONY: all FORCE |