author | coffeys |
Fri, 20 Apr 2012 17:34:25 +0100 | |
changeset 12567 | 678660c43433 |
parent 12047 | 320a714614e9 |
child 13353 | a043d6778c4c |
permissions | -rw-r--r-- |
2 | 1 |
# |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
8583
diff
changeset
|
2 |
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
# |
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
# |
|
27 |
# Makefile for building and packaging all of the JDK and the JRE. See |
|
28 |
# also included files. |
|
29 |
# |
|
30 |
||
31 |
BUILDDIR=. |
|
32 |
include $(BUILDDIR)/common/Defs.gmk |
|
33 |
||
34 |
# |
|
35 |
# Make sure we are clear what the default target is |
|
36 |
# |
|
37 |
default_target: all |
|
38 |
||
39 |
# |
|
40 |
# Check target |
|
41 |
# |
|
42 |
||
43 |
check: variable_check |
|
44 |
||
45 |
# |
|
46 |
# Help target |
|
47 |
# |
|
48 |
help: intro_help target_help variable_help notes_help examples_help |
|
49 |
||
50 |
# Intro help message |
|
51 |
intro_help: |
|
52 |
@$(ECHO) "\ |
|
53 |
Makefile for the main JDK workspace. \n\ |
|
54 |
Default behavior is to use the BOOTDIR javac to bootstrap the build and \n\ |
|
55 |
import in pre-built components like the VM from the JDK_IMPORT_PATH. \n\ |
|
56 |
" |
|
57 |
||
58 |
# Target help |
|
59 |
target_help: |
|
60 |
@$(ECHO) "\ |
|
61 |
--- Common Targets --- \n\ |
|
62 |
all -- build the core JDK (default target) \n\ |
|
63 |
help -- Print out help information \n\ |
|
64 |
check -- Check make variable values for correctness \n\ |
|
65 |
sanity -- Perform detailed sanity checks on system and settings \n\ |
|
66 |
openjdk -- synonym for 'OPENJDK=true all' \n\ |
|
67 |
fastdebug -- build the core JDK in 'fastdebug' mode (-g -O) \n\ |
|
68 |
debug -- build the core JDK in 'debug' mode (-g) \n\ |
|
69 |
clean -- remove all built and imported files \n\ |
|
70 |
clobber -- same as clean \n\ |
|
71 |
docs -- run javadoc to generate the JDK documentation \n\ |
|
72 |
images -- build the jdk and jre image directories \n\ |
|
73 |
import -- copy in the pre-built components (e.g. VM) \n\ |
|
74 |
import_product -- copy in the product components \n\ |
|
75 |
import_fastdebug -- copy in the fastdebug components \n\ |
|
76 |
import_debug -- copy in the debug components \n\ |
|
77 |
create_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\ |
|
78 |
" |
|
79 |
||
80 |
# Variable help (only common ones used by this workspace) |
|
81 |
variable_help: variable_help_intro variable_list variable_help_end |
|
82 |
variable_help_intro: |
|
83 |
@$(ECHO) "--- Common Variables ---" |
|
84 |
variable_help_end: |
|
85 |
@$(ECHO) " " |
|
86 |
||
87 |
# One line descriptions for the variables |
|
88 |
OUTPUTDIR.desc = Output directory |
|
89 |
PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count |
|
90 |
SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: |
|
91 |
BOOTDIR.desc = JDK used to boot the build |
|
92 |
LANGTOOLS_DIST.desc = langtools dist area used to build |
|
93 |
CORBA_DIST.desc = corba dist area |
|
94 |
JAXP_DIST.desc = jaxp dist area |
|
95 |
JAXWS_DIST.desc = jaxws dist area |
|
96 |
JDK_IMPORT_PATH.desc = JDK used to import components of the build |
|
97 |
COMPILER_PATH.desc = Compiler install directory |
|
98 |
CACERTS_FILE.desc = Location of certificates file |
|
99 |
DEVTOOLS_PATH.desc = Directory containing zip and unzip |
|
100 |
CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files |
|
101 |
DXSDK_PATH.desc = Root directory of DirectX SDK |
|
102 |
||
103 |
# Make variables to print out (description and value) |
|
104 |
VARIABLE_PRINTVAL_LIST += \ |
|
105 |
OUTPUTDIR \ |
|
106 |
PARALLEL_COMPILE_JOBS \ |
|
107 |
SLASH_JAVA \ |
|
108 |
BOOTDIR \ |
|
109 |
LANGTOOLS_DIST \ |
|
110 |
JAXWS_DIST \ |
|
111 |
CORBA_DIST \ |
|
112 |
JAXP_DIST \ |
|
113 |
JDK_IMPORT_PATH \ |
|
114 |
COMPILER_PATH \ |
|
115 |
CACERTS_FILE \ |
|
116 |
DEVTOOLS_PATH |
|
117 |
||
118 |
# Make variables that should refer to directories that exist |
|
119 |
VARIABLE_CHECKDIR_LIST += \ |
|
120 |
SLASH_JAVA \ |
|
121 |
BOOTDIR \ |
|
122 |
JDK_IMPORT_PATH \ |
|
123 |
COMPILER_PATH \ |
|
124 |
DEVTOOLS_PATH |
|
125 |
||
126 |
# Make variables that should refer to files that exist |
|
127 |
VARIABLE_CHECKFIL_LIST += \ |
|
128 |
CACERTS_FILE |
|
129 |
||
130 |
# Some are windows specific |
|
131 |
ifeq ($(PLATFORM), windows) |
|
132 |
||
133 |
VARIABLE_PRINTVAL_LIST += \ |
|
8018
79ce40b4ab5e
6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents:
7666
diff
changeset
|
134 |
DXSDK_PATH |
2 | 135 |
|
136 |
VARIABLE_CHECKDIR_LIST += \ |
|
8018
79ce40b4ab5e
6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents:
7666
diff
changeset
|
137 |
DXSDK_PATH |
2 | 138 |
|
139 |
endif |
|
140 |
||
141 |
# For pattern rules below, so all are treated the same |
|
142 |
DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval) |
|
143 |
DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir) |
|
144 |
DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil) |
|
145 |
||
146 |
# Complete variable check |
|
147 |
variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST) |
|
148 |
variable_list: $(DO_PRINTVAL_LIST) variable_check |
|
149 |
||
150 |
# Pattern rule for printing out a variable |
|
151 |
%.printval: |
|
152 |
@$(ECHO) " ALT_$* - $($*.desc)" |
|
153 |
@$(ECHO) " \t $*=$($*)" |
|
154 |
||
155 |
# Pattern rule for checking to see if a variable with a directory exists |
|
156 |
%.checkdir: |
|
157 |
@if [ ! -d $($*) ] ; then \ |
|
158 |
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
|
159 |
fi |
|
160 |
||
161 |
# Pattern rule for checking to see if a variable with a file exists |
|
162 |
%.checkfil: |
|
163 |
@if [ ! -f $($*) ] ; then \ |
|
164 |
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
|
165 |
fi |
|
166 |
||
167 |
# Misc notes on help |
|
168 |
notes_help: |
|
169 |
@$(ECHO) "\ |
|
170 |
--- Notes --- \n\ |
|
171 |
- All builds use same output directory unless overridden with \n\ |
|
172 |
\t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\ |
|
173 |
\t to use the clean target first. \n\ |
|
174 |
- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\ |
|
175 |
- CORBA_DIST must refer to a corba dist area. \n\ |
|
176 |
- JAXP_DIST must refer to a jaxp dist area. \n\ |
|
177 |
- JAXWS_DIST must refer to a jaxws dist area. \n\ |
|
178 |
- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\ |
|
179 |
\t builds or previous release JDK builds will work. \n\ |
|
180 |
- The 'debug' target and 'import_debug' only works when a debug promoted \n\ |
|
181 |
\t build is available, and they currently are not. \n\ |
|
182 |
- The fastest builds have been when the workspace and the BOOTDIR are on \n\ |
|
183 |
\t local disk. \n\ |
|
184 |
" |
|
185 |
||
186 |
examples_help: |
|
187 |
@$(ECHO) "\ |
|
188 |
--- Examples --- \n\ |
|
189 |
$(MAKE) fastdebug \n\ |
|
190 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
|
191 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\ |
|
192 |
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\ |
|
193 |
$(MAKE) ALT_BOOTDIR=/opt/java/jdk1.6.0 \n\ |
|
194 |
$(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\ |
|
195 |
" |
|
196 |
||
197 |
# |
|
198 |
# 'all' target intro |
|
199 |
# |
|
11994
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
200 |
all:: |
2 | 201 |
@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M') |
202 |
||
203 |
# Just in case anyone uses this old name, same as 'build' |
|
204 |
optimized: build |
|
205 |
||
206 |
openjdk: |
|
207 |
$(MAKE) OPENJDK=true all |
|
208 |
||
209 |
# |
|
210 |
# Special debug rules (You may also want to set ALT_OUTPUTDIR) |
|
211 |
# |
|
212 |
debug: |
|
213 |
$(MAKE) VARIANT=DBG all |
|
214 |
fastdebug: |
|
215 |
$(MAKE) VARIANT=DBG FASTDEBUG=true all |
|
216 |
||
217 |
# |
|
218 |
# Rules to re-import VM and other JDK files |
|
219 |
# |
|
220 |
import: |
|
221 |
$(CD) java/redist; $(MAKE) clean all |
|
222 |
||
223 |
import_fastdebug: |
|
224 |
$(MAKE) VARIANT=DBG FASTDEBUG=true import |
|
225 |
||
226 |
import_product: |
|
227 |
$(MAKE) VARIANT=OPT FASTDEBUG=false import |
|
228 |
||
229 |
# |
|
230 |
# Core. |
|
231 |
# |
|
232 |
||
233 |
all build:: sanity-all post-sanity-all |
|
234 |
||
4917
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
235 |
SUBDIRS = tools java javax sun com |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11994
diff
changeset
|
236 |
ifeq ($(PLATFORM), macosx) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11994
diff
changeset
|
237 |
SUBDIRS += apple |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11994
diff
changeset
|
238 |
endif |
4917
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
239 |
SUBDIRS_tools = launchers |
11994
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
240 |
SUBDIRS_misc = org sunw jpda |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
241 |
|
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
242 |
# demos |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
243 |
ifndef NO_DEMOS |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
244 |
SUBDIRS_misc += mkdemo |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
245 |
endif |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
246 |
|
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
247 |
# samples |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
248 |
ifndef NO_SAMPLES |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
249 |
SUBDIRS_misc += mksample |
74f1488b7347
7143162: Allow disable building of jdk demos and samples
mduigou
parents:
9035
diff
changeset
|
250 |
endif |
4917
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
251 |
|
7174
5a56e43d896c
6792706: Add JAR file to bootclasspath when using AggressiveOpts
ohair
parents:
6681
diff
changeset
|
252 |
# Alternate classes implementation |
5a56e43d896c
6792706: Add JAR file to bootclasspath when using AggressiveOpts
ohair
parents:
6681
diff
changeset
|
253 |
ifndef OPENJDK |
5a56e43d896c
6792706: Add JAR file to bootclasspath when using AggressiveOpts
ohair
parents:
6681
diff
changeset
|
254 |
SUBDIRS_misc += altclasses |
5a56e43d896c
6792706: Add JAR file to bootclasspath when using AggressiveOpts
ohair
parents:
6681
diff
changeset
|
255 |
endif |
5a56e43d896c
6792706: Add JAR file to bootclasspath when using AggressiveOpts
ohair
parents:
6681
diff
changeset
|
256 |
|
4917
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
257 |
include $(BUILDDIR)/common/Subdirs.gmk |
c98da2209f8c
6915413: Module build: building of specified jdk components instead of all
mchung
parents:
4524
diff
changeset
|
258 |
|
2 | 259 |
all build:: |
260 |
$(SUBDIRS-loop) |
|
261 |
||
262 |
clean clobber:: |
|
263 |
$(RM) -r $(OUTPUTDIR) |
|
264 |
||
265 |
# |
|
266 |
# Docs |
|
267 |
# |
|
268 |
OTHERSUBDIRS = docs |
|
269 |
docs:: sanity-docs post-sanity-docs |
|
270 |
$(OTHERSUBDIRS-loop) |
|
271 |
||
272 |
# |
|
273 |
# Release engineering targets. |
|
274 |
# |
|
275 |
include $(BUILDDIR)/common/Release.gmk |
|
276 |
||
277 |
# |
|
278 |
# Cscope targets. |
|
279 |
# |
|
280 |
include $(BUILDDIR)/common/Cscope.gmk |
|
281 |
||
282 |
# |
|
283 |
# Sanity checks. |
|
284 |
# |
|
285 |
include $(BUILDDIR)/common/Sanity.gmk |
|
286 |
||
287 |
$(OUTPUTDIR) $(TEMPDIR): |
|
288 |
$(MKDIR) -p $@ |
|
289 |
||
290 |
# this should be the last rule in this file: |
|
291 |
all:: |
|
292 |
@if [ -r $(WARNING_FILE) ]; then \ |
|
293 |
$(CAT) $(WARNING_FILE) ; \ |
|
294 |
fi |
|
295 |
@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M') |
|
296 |
||
297 |
# |
|
298 |
# Developer rule that links 32 and 64 bit builds on Solaris by creating |
|
299 |
# softlinks in the 32bit outputdir to the 64bit outputdir. |
|
300 |
# |
|
301 |
ifeq ($(PLATFORM), solaris) |
|
302 |
ifeq ($(ARCH_FAMILY), sparc) |
|
303 |
ARCH32 = sparc |
|
304 |
ARCH64 = sparcv9 |
|
305 |
else |
|
306 |
ARCH32 = i586 |
|
307 |
ARCH64 = amd64 |
|
308 |
endif |
|
309 |
OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32) |
|
310 |
OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64) |
|
311 |
endif |
|
312 |
||
313 |
create_links: |
|
314 |
ifeq ($(PLATFORM), solaris) |
|
315 |
@if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \ |
|
316 |
dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \ |
|
317 |
for sd in $$dirlist ; do \ |
|
318 |
pdir=`$(DIRNAME) $$sd`; \ |
|
319 |
if [ -d $(OUTPUTDIR32)/$$pdir ] ; then \ |
|
320 |
echo "Creating link for $$sd"; \ |
|
321 |
(cd $(OUTPUTDIR32)/$$pdir; $(RM) $(ARCH64); \ |
|
322 |
$(LN) -s $(OUTPUTDIR64)/$$sd ); \ |
|
323 |
fi; \ |
|
324 |
done; \ |
|
325 |
else \ |
|
326 |
$(ECHO) "Build both 32 and 64 bit versions first"; \ |
|
327 |
fi |
|
328 |
else |
|
329 |
$(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)" |
|
330 |
endif |
|
331 |
||
332 |
# |
|
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
333 |
# Test rule |
2 | 334 |
# |
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
335 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
336 |
.NOTPARALLEL: test_run |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
337 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
338 |
test: |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
339 |
$(MAKE) test_run |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
340 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
341 |
test_run: test_clean test_start test_summary |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
342 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
343 |
test_start: |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
344 |
@$(ECHO) "Tests started at `$(DATE)`" |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
345 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
346 |
test_clean: |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
347 |
$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt |
2 | 348 |
|
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
349 |
test_summary: $(OUTPUTDIR)/test_failures.txt |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
350 |
@$(ECHO) "#################################################" |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
351 |
@$(ECHO) "Tests completed at `$(DATE)`" |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
352 |
@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
353 |
|| $(ECHO) "No TEST STATS seen in log" ) |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
354 |
@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt" |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
355 |
@$(ECHO) "#################################################" |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
356 |
@if [ -s $< ] ; then \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
357 |
$(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
358 |
$(CAT) $<; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
359 |
exit 1; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
360 |
else \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
361 |
$(ECHO) "Success! No failures detected"; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
362 |
fi |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
363 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
364 |
# Get failure list from log |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
365 |
$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
366 |
@$(RM) $@ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
367 |
@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
368 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
369 |
# Get log file of all tests run |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
370 |
JDK_TO_TEST := $(shell \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
371 |
if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
372 |
$(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
373 |
elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
374 |
$(ECHO) "$(ABS_OUTPUTDIR)"; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
375 |
elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
376 |
$(ECHO) "$(PRODUCT_HOME)"; \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
377 |
fi \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
378 |
) |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
379 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
380 |
TEST_TARGETS=jdk_all |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
381 |
$(OUTPUTDIR)/test_log.txt: |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
382 |
$(RM) $@ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
383 |
( $(CD) ../test && \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
384 |
$(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
385 |
) | tee $@ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
386 |
|
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
387 |
# |
2 | 388 |
# JPRT rules |
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
389 |
# |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
390 |
|
2 | 391 |
include jprt.gmk |
392 |
||
393 |
# |
|
394 |
# Phonies to avoid accidents. |
|
395 |
# |
|
396 |
.PHONY: all build clean clobber optimized debug fastdebug create_links \ |
|
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
397 |
import import_product import_fastdebug import_debug \ |
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
398 |
test test_run test_start test_clean test_summary |