1 | #
|
---|
2 | # Copyright (c) 1995, 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. Oracle designates this
|
---|
8 | # particular file as subject to the "Classpath" exception as provided
|
---|
9 | # by Oracle in the LICENSE file that accompanied this code.
|
---|
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 | #
|
---|
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.
|
---|
24 | #
|
---|
25 |
|
---|
26 | BUILD_PARENT_DIRECTORY=.
|
---|
27 |
|
---|
28 | ifndef TOPDIR
|
---|
29 | TOPDIR:=.
|
---|
30 | endif
|
---|
31 |
|
---|
32 | ifndef JDK_TOPDIR
|
---|
33 | JDK_TOPDIR=$(TOPDIR)/jdk
|
---|
34 | endif
|
---|
35 | ifndef JDK_MAKE_SHARED_DIR
|
---|
36 | JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
|
---|
37 | endif
|
---|
38 |
|
---|
39 | # For start and finish echo lines
|
---|
40 | TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
|
---|
41 | DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
|
---|
42 | START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
|
---|
43 | FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
|
---|
44 |
|
---|
45 | default: all
|
---|
46 |
|
---|
47 | include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
|
---|
48 | include ./make/Defs-internal.gmk
|
---|
49 | include ./make/sanity-rules.gmk
|
---|
50 | include ./make/hotspot-rules.gmk
|
---|
51 | include ./make/langtools-rules.gmk
|
---|
52 | include ./make/corba-rules.gmk
|
---|
53 | include ./make/jaxp-rules.gmk
|
---|
54 | include ./make/jaxws-rules.gmk
|
---|
55 | include ./make/jdk-rules.gmk
|
---|
56 |
|
---|
57 | # What "all" means
|
---|
58 | all::
|
---|
59 | @$(START_ECHO)
|
---|
60 |
|
---|
61 | all:: sanity
|
---|
62 |
|
---|
63 | ifeq ($(SKIP_FASTDEBUG_BUILD), false)
|
---|
64 | all:: fastdebug_build
|
---|
65 | endif
|
---|
66 |
|
---|
67 | ifeq ($(SKIP_DEBUG_BUILD), false)
|
---|
68 | all:: debug_build
|
---|
69 | endif
|
---|
70 |
|
---|
71 | all:: all_product_build
|
---|
72 |
|
---|
73 | all::
|
---|
74 | @$(FINISH_ECHO)
|
---|
75 |
|
---|
76 | # Everything for a full product build
|
---|
77 | all_product_build::
|
---|
78 | @$(START_ECHO)
|
---|
79 |
|
---|
80 | ifeq ($(SKIP_PRODUCT_BUILD), false)
|
---|
81 |
|
---|
82 | all_product_build:: product_build
|
---|
83 |
|
---|
84 | ifneq ($(SKIP_COMPARE_IMAGES), true)
|
---|
85 | all_product_build:: compare-image
|
---|
86 | endif
|
---|
87 |
|
---|
88 | endif
|
---|
89 |
|
---|
90 | all_product_build::
|
---|
91 | @$(FINISH_ECHO)
|
---|
92 |
|
---|
93 | # Generis build of basic repo series
|
---|
94 | generic_build_repo_series::
|
---|
95 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
96 | $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
|
---|
97 |
|
---|
98 | ifeq ($(BUILD_LANGTOOLS), true)
|
---|
99 | ifneq ($(SKIP_BUILD_LANGTOOLS), true)
|
---|
100 | generic_build_repo_series:: langtools
|
---|
101 | clobber:: langtools-clobber
|
---|
102 | endif
|
---|
103 | endif
|
---|
104 |
|
---|
105 | ifeq ($(BUILD_CORBA), true)
|
---|
106 | ifneq ($(SKIP_BUILD_CORBA), true)
|
---|
107 | generic_build_repo_series:: corba
|
---|
108 | clobber:: corba-clobber
|
---|
109 | endif
|
---|
110 | endif
|
---|
111 |
|
---|
112 | ifeq ($(BUILD_JAXP), true)
|
---|
113 | ifneq ($(SKIP_BUILD_JAXP), true)
|
---|
114 | generic_build_repo_series:: jaxp
|
---|
115 | clobber:: jaxp-clobber
|
---|
116 | endif
|
---|
117 | endif
|
---|
118 |
|
---|
119 | ifeq ($(BUILD_JAXWS), true)
|
---|
120 | ifneq ($(SKIP_BUILD_JAXWS), true)
|
---|
121 | generic_build_repo_series:: jaxws
|
---|
122 | clobber:: jaxws-clobber
|
---|
123 | endif
|
---|
124 | endif
|
---|
125 |
|
---|
126 | ifeq ($(BUILD_HOTSPOT), true)
|
---|
127 | ifneq ($(SKIP_BUILD_HOTSPOT), true)
|
---|
128 | generic_build_repo_series:: $(HOTSPOT)
|
---|
129 | clobber:: hotspot-clobber
|
---|
130 | endif
|
---|
131 | endif
|
---|
132 |
|
---|
133 | ifeq ($(BUILD_JDK), true)
|
---|
134 | ifneq ($(SKIP_BUILD_JDK), true)
|
---|
135 | generic_build_repo_series:: $(JDK_JAVA_EXE)
|
---|
136 | clobber:: jdk-clobber
|
---|
137 | endif
|
---|
138 | endif
|
---|
139 |
|
---|
140 | # The debug build, fastdebug or debug. Needs special handling.
|
---|
141 | #
|
---|
142 | # DEBUG_NAME is fastdebug or debug
|
---|
143 | # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
|
---|
144 | #
|
---|
145 | # NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
|
---|
146 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may
|
---|
147 | # not be the same location.
|
---|
148 | #
|
---|
149 |
|
---|
150 | # Location of fresh bootdir output
|
---|
151 | ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
|
---|
152 | FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
|
---|
153 | FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
|
---|
154 |
|
---|
155 | create_fresh_product_bootdir: FRC
|
---|
156 | @$(START_ECHO)
|
---|
157 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
|
---|
158 | GENERATE_DOCS=false \
|
---|
159 | BOOT_CYCLE_SETTINGS= \
|
---|
160 | build_product_image
|
---|
161 | @$(FINISH_ECHO)
|
---|
162 |
|
---|
163 | create_fresh_debug_bootdir: FRC
|
---|
164 | @$(START_ECHO)
|
---|
165 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
|
---|
166 | GENERATE_DOCS=false \
|
---|
167 | BOOT_CYCLE_DEBUG_SETTINGS= \
|
---|
168 | build_debug_image
|
---|
169 | @$(FINISH_ECHO)
|
---|
170 |
|
---|
171 | create_fresh_fastdebug_bootdir: FRC
|
---|
172 | @$(START_ECHO)
|
---|
173 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
|
---|
174 | GENERATE_DOCS=false \
|
---|
175 | BOOT_CYCLE_DEBUG_SETTINGS= \
|
---|
176 | build_fastdebug_image
|
---|
177 | @$(FINISH_ECHO)
|
---|
178 |
|
---|
179 | # Create boot image?
|
---|
180 | ifeq ($(SKIP_BOOT_CYCLE),false)
|
---|
181 | ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
|
---|
182 | DO_BOOT_CYCLE=true
|
---|
183 | endif
|
---|
184 | endif
|
---|
185 |
|
---|
186 | ifeq ($(DO_BOOT_CYCLE),true)
|
---|
187 |
|
---|
188 | # Create the bootdir to use in the build
|
---|
189 | product_build:: create_fresh_product_bootdir
|
---|
190 | debug_build:: create_fresh_debug_bootdir
|
---|
191 | fastdebug_build:: create_fresh_fastdebug_bootdir
|
---|
192 |
|
---|
193 | # Define variables to be used now for the boot jdk
|
---|
194 | BOOT_CYCLE_SETTINGS= \
|
---|
195 | ALT_BOOTDIR=$(FRESH_BOOTDIR) \
|
---|
196 | ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
|
---|
197 | BOOT_CYCLE_DEBUG_SETTINGS= \
|
---|
198 | ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
|
---|
199 | ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
|
---|
200 |
|
---|
201 | else
|
---|
202 |
|
---|
203 | # Use the supplied ALT_BOOTDIR as the boot
|
---|
204 | BOOT_CYCLE_SETTINGS=
|
---|
205 | BOOT_CYCLE_DEBUG_SETTINGS=
|
---|
206 |
|
---|
207 | endif
|
---|
208 |
|
---|
209 | build_product_image:
|
---|
210 | @$(START_ECHO)
|
---|
211 | $(MAKE) \
|
---|
212 | SKIP_FASTDEBUG_BUILD=true \
|
---|
213 | SKIP_DEBUG_BUILD=true \
|
---|
214 | $(BOOT_CYCLE_SETTINGS) \
|
---|
215 | generic_build_repo_series
|
---|
216 | @$(FINISH_ECHO)
|
---|
217 |
|
---|
218 | # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
|
---|
219 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may
|
---|
220 | # not be the same location.
|
---|
221 |
|
---|
222 | generic_debug_build:
|
---|
223 | @$(START_ECHO)
|
---|
224 | $(MAKE) \
|
---|
225 | ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
|
---|
226 | DEBUG_NAME=$(DEBUG_NAME) \
|
---|
227 | GENERATE_DOCS=false \
|
---|
228 | $(BOOT_CYCLE_DEBUG_SETTINGS) \
|
---|
229 | generic_build_repo_series
|
---|
230 | @$(FINISH_ECHO)
|
---|
231 |
|
---|
232 | build_debug_image:
|
---|
233 | $(MAKE) DEBUG_NAME=debug generic_debug_build
|
---|
234 |
|
---|
235 | build_fastdebug_image:
|
---|
236 | $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
|
---|
237 |
|
---|
238 | # Build final image
|
---|
239 | product_build:: build_product_image
|
---|
240 | debug_build:: build_debug_image
|
---|
241 | fastdebug_build:: build_fastdebug_image
|
---|
242 |
|
---|
243 | clobber::
|
---|
244 | $(RM) -r $(OUTPUTDIR)/*
|
---|
245 | $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
|
---|
246 | $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
|
---|
247 | -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
|
---|
248 |
|
---|
249 | clean: clobber
|
---|
250 |
|
---|
251 | #
|
---|
252 | # Dev builds
|
---|
253 | #
|
---|
254 |
|
---|
255 | dev : dev-build
|
---|
256 |
|
---|
257 | dev-build:
|
---|
258 | $(MAKE) DEV_ONLY=true all
|
---|
259 | dev-sanity:
|
---|
260 | $(MAKE) DEV_ONLY=true sanity
|
---|
261 | dev-clobber:
|
---|
262 | $(MAKE) DEV_ONLY=true clobber
|
---|
263 |
|
---|
264 | #
|
---|
265 | # Quick jdk verification build
|
---|
266 | #
|
---|
267 | jdk_only:
|
---|
268 | $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
|
---|
269 |
|
---|
270 |
|
---|
271 | #
|
---|
272 | # Quick jdk verification fastdebug build
|
---|
273 | #
|
---|
274 | jdk_fastdebug_only:
|
---|
275 | $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false generic_debug_build
|
---|
276 |
|
---|
277 | #
|
---|
278 | # Product build (skip debug builds)
|
---|
279 | #
|
---|
280 | product_only:
|
---|
281 | $(MAKE) SKIP_FASTDEBUG_BUILD=true all
|
---|
282 |
|
---|
283 | #
|
---|
284 | # Check target
|
---|
285 | #
|
---|
286 |
|
---|
287 | check: variable_check
|
---|
288 |
|
---|
289 | #
|
---|
290 | # Help target
|
---|
291 | #
|
---|
292 | help: intro_help target_help variable_help notes_help examples_help
|
---|
293 |
|
---|
294 | # Intro help message
|
---|
295 | intro_help:
|
---|
296 | @$(ECHO) "\
|
---|
297 | Makefile for the JDK builds (all the JDK). \n\
|
---|
298 | "
|
---|
299 |
|
---|
300 | # Target help
|
---|
301 | target_help:
|
---|
302 | @$(ECHO) "\
|
---|
303 | --- Common Targets --- \n\
|
---|
304 | all -- build the core JDK (default target) \n\
|
---|
305 | help -- Print out help information \n\
|
---|
306 | check -- Check make variable values for correctness \n\
|
---|
307 | sanity -- Perform detailed sanity checks on system and settings \n\
|
---|
308 | fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
|
---|
309 | debug_build -- build the core JDK in 'debug' mode (-g) \n\
|
---|
310 | clean -- remove all built and imported files \n\
|
---|
311 | clobber -- same as clean \n\
|
---|
312 | "
|
---|
313 |
|
---|
314 | # Variable help (only common ones used by this Makefile)
|
---|
315 | variable_help: variable_help_intro variable_list variable_help_end
|
---|
316 | variable_help_intro:
|
---|
317 | @$(ECHO) "--- Common Variables ---"
|
---|
318 | variable_help_end:
|
---|
319 | @$(ECHO) " "
|
---|
320 |
|
---|
321 | # One line descriptions for the variables
|
---|
322 | OUTPUTDIR.desc = Output directory
|
---|
323 | PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
|
---|
324 | SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
|
---|
325 | BOOTDIR.desc = JDK used to boot the build
|
---|
326 | JDK_IMPORT_PATH.desc = JDK used to import components of the build
|
---|
327 | COMPILER_PATH.desc = Compiler install directory
|
---|
328 | CACERTS_FILE.desc = Location of certificates file
|
---|
329 | DEVTOOLS_PATH.desc = Directory containing zip and gnumake
|
---|
330 | CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
|
---|
331 | DXSDK_PATH.desc = Root directory of DirectX SDK
|
---|
332 | MSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
|
---|
333 | MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
|
---|
334 | ODINSDK_HEADERS_PATH.desc = Include directory of Odin32 SDK (OS/2)
|
---|
335 | ODINSDK_LIB_PATH.desc = Library directory of Odin32 SDK (OS/2)
|
---|
336 | ODINSDK_DBGLIB_PATH.desc = Debug Library directory of Odin32 SDK (OS/2, optional)
|
---|
337 |
|
---|
338 | # Make variables to print out (description and value)
|
---|
339 | VARIABLE_PRINTVAL_LIST += \
|
---|
340 | OUTPUTDIR \
|
---|
341 | PARALLEL_COMPILE_JOBS \
|
---|
342 | SLASH_JAVA \
|
---|
343 | BOOTDIR \
|
---|
344 | JDK_IMPORT_PATH \
|
---|
345 | COMPILER_PATH \
|
---|
346 | CACERTS_FILE \
|
---|
347 | DEVTOOLS_PATH
|
---|
348 |
|
---|
349 | # Make variables that should refer to directories that exist
|
---|
350 | VARIABLE_CHECKDIR_LIST += \
|
---|
351 | SLASH_JAVA \
|
---|
352 | BOOTDIR \
|
---|
353 | JDK_IMPORT_PATH \
|
---|
354 | COMPILER_PATH \
|
---|
355 | DEVTOOLS_PATH
|
---|
356 |
|
---|
357 | # Make variables that should refer to files that exist
|
---|
358 | VARIABLE_CHECKFIL_LIST += \
|
---|
359 | CACERTS_FILE
|
---|
360 |
|
---|
361 | # Some are windows specific
|
---|
362 | ifeq ($(PLATFORM), windows)
|
---|
363 |
|
---|
364 | VARIABLE_PRINTVAL_LIST += \
|
---|
365 | DXSDK_PATH \
|
---|
366 | MSDEVTOOLS_PATH \
|
---|
367 | MSVCRT_DLL_PATH
|
---|
368 |
|
---|
369 | VARIABLE_CHECKDIR_LIST += \
|
---|
370 | DXSDK_PATH \
|
---|
371 | MSDEVTOOLS_PATH \
|
---|
372 | MSVCRT_DLL_PATH
|
---|
373 |
|
---|
374 | endif
|
---|
375 |
|
---|
376 | # Some are OS/2 specific
|
---|
377 | ifeq ($(PLATFORM), os2)
|
---|
378 |
|
---|
379 | VARIABLE_PRINTVAL_LIST += \
|
---|
380 | ODINSDK_HEADERS_PATH \
|
---|
381 | ODINSDK_LIB_PATH
|
---|
382 |
|
---|
383 | VARIABLE_CHECKDIR_LIST += \
|
---|
384 | ODINSDK_HEADERS_PATH \
|
---|
385 | ODINSDK_LIB_PATH
|
---|
386 |
|
---|
387 | endif
|
---|
388 |
|
---|
389 | # For pattern rules below, so all are treated the same
|
---|
390 | DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
|
---|
391 | DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
|
---|
392 | DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
|
---|
393 |
|
---|
394 | # Complete variable check
|
---|
395 | variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
|
---|
396 | variable_list: $(DO_PRINTVAL_LIST) variable_check
|
---|
397 |
|
---|
398 | # Pattern rule for printing out a variable
|
---|
399 | %.printval:
|
---|
400 | @$(ECHO) " ALT_$* - $($*.desc)"
|
---|
401 | @$(ECHO) " \t $*=$($*)"
|
---|
402 |
|
---|
403 | # Pattern rule for checking to see if a variable with a directory exists
|
---|
404 | %.checkdir:
|
---|
405 | @if [ ! -d $($*) ] ; then \
|
---|
406 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
|
---|
407 | fi
|
---|
408 |
|
---|
409 | # Pattern rule for checking to see if a variable with a file exists
|
---|
410 | %.checkfil:
|
---|
411 | @if [ ! -f $($*) ] ; then \
|
---|
412 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
|
---|
413 | fi
|
---|
414 |
|
---|
415 | # Misc notes on help
|
---|
416 | notes_help:
|
---|
417 | @$(ECHO) "\
|
---|
418 | --- Notes --- \n\
|
---|
419 | - All builds use same output directory unless overridden with \n\
|
---|
420 | \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
|
---|
421 | \t to use the clean target first. \n\
|
---|
422 | - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
|
---|
423 | \t builds or previous release JDK builds will work. \n\
|
---|
424 | - The fastest builds have been when the sources and the BOOTDIR are on \n\
|
---|
425 | \t local disk. \n\
|
---|
426 | "
|
---|
427 |
|
---|
428 | examples_help:
|
---|
429 | @$(ECHO) "\
|
---|
430 | --- Examples --- \n\
|
---|
431 | $(MAKE) fastdebug_build \n\
|
---|
432 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
|
---|
433 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
|
---|
434 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
|
---|
435 | $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
|
---|
436 | $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
|
---|
437 | "
|
---|
438 |
|
---|
439 | ################################################################
|
---|
440 | # Cycle build. Build the jdk, use it to build the jdk again.
|
---|
441 | ################################################################
|
---|
442 |
|
---|
443 | ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
|
---|
444 |
|
---|
445 | boot_cycle:
|
---|
446 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) product_build
|
---|
447 | $(MAKE) ALT_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image product_build
|
---|
448 |
|
---|
449 | ################################################################
|
---|
450 | # rule to test
|
---|
451 | ################################################################
|
---|
452 |
|
---|
453 | .NOTPARALLEL: test
|
---|
454 |
|
---|
455 | test: test_clean test_start test_summary
|
---|
456 |
|
---|
457 | test_start:
|
---|
458 | @$(ECHO) "Tests started at `$(DATE)`"
|
---|
459 |
|
---|
460 | test_clean:
|
---|
461 | $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
|
---|
462 |
|
---|
463 | test_summary: $(OUTPUTDIR)/test_failures.txt
|
---|
464 | @$(ECHO) "#################################################"
|
---|
465 | @$(ECHO) "Tests completed at `$(DATE)`"
|
---|
466 | @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
|
---|
467 | || $(ECHO) "No TEST STATS seen in log" )
|
---|
468 | @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
|
---|
469 | @$(ECHO) "#################################################"
|
---|
470 | @if [ -s $< ] ; then \
|
---|
471 | $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
|
---|
472 | $(CAT) $<; \
|
---|
473 | exit 1; \
|
---|
474 | else \
|
---|
475 | $(ECHO) "Success! No failures detected"; \
|
---|
476 | fi
|
---|
477 |
|
---|
478 | # Get failure list from log
|
---|
479 | $(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
|
---|
480 | @$(RM) $@
|
---|
481 | @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
|
---|
482 |
|
---|
483 | # Get log file of all tests run
|
---|
484 | JDK_TO_TEST := $(shell \
|
---|
485 | if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
|
---|
486 | $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
|
---|
487 | elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
|
---|
488 | $(ECHO) "$(ABS_OUTPUTDIR)"; \
|
---|
489 | elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
|
---|
490 | $(ECHO) "$(PRODUCT_HOME)"; \
|
---|
491 | fi \
|
---|
492 | )
|
---|
493 | $(OUTPUTDIR)/test_log.txt:
|
---|
494 | $(RM) $@
|
---|
495 | ( $(CD) test && \
|
---|
496 | $(MAKE) NO_STOPPING=- \
|
---|
497 | ALT_OUTPUTDIR=$(ABS_OUTPUTDIR) \
|
---|
498 | ALT_JDK_IMPORT_PATH=$(JDK_TO_TEST) \
|
---|
499 | PRODUCT_HOME=$(JDK_TO_TEST) \
|
---|
500 | LANGTOOLS_PRODUCT_HOME=$(ABS_OUTPUTDIR)/langtools \
|
---|
501 | ) | tee $@
|
---|
502 |
|
---|
503 | ################################################################
|
---|
504 | # JPRT rule to build
|
---|
505 | ################################################################
|
---|
506 |
|
---|
507 | include ./make/jprt.gmk
|
---|
508 |
|
---|
509 | ################################################################
|
---|
510 | # PHONY
|
---|
511 | ################################################################
|
---|
512 |
|
---|
513 | .PHONY: all test test_start test_summary test_clean \
|
---|
514 | generic_build_repo_series \
|
---|
515 | what clobber insane \
|
---|
516 | dev dev-build dev-sanity dev-clobber \
|
---|
517 | product_build \
|
---|
518 | fastdebug_build \
|
---|
519 | debug_build \
|
---|
520 | build_product_image \
|
---|
521 | build_debug_image \
|
---|
522 | build_fastdebug_image \
|
---|
523 | create_fresh_product_bootdir \
|
---|
524 | create_fresh_debug_bootdir \
|
---|
525 | create_fresh_fastdebug_bootdir \
|
---|
526 | generic_debug_build
|
---|
527 |
|
---|
528 | # Force target
|
---|
529 | FRC:
|
---|
530 |
|
---|