Makefile

changeset 912
a667caba1e84
parent 796
b1e9396fb8af
child 919
cd3825b29830
equal deleted inserted replaced
906:40e892e2a4f2 912:a667caba1e84
1 # 1 #
2 # Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # 4 #
5 # This code is free software; you can redistribute it and/or modify it 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 6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this 7 # published by the Free Software Foundation. Oracle designates this
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 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 22 # or visit www.oracle.com if you need additional information or have any
23 # questions. 23 # questions.
24 # 24 #
25 25
26 # If NEWBUILD is defined, use the new build-infra Makefiles and configure. 26 # This must be the first rule
27 # See NewMakefile.gmk for more information. 27 default:
28 28
29 # If not specified, select what the default build is 29 # Inclusion of this pseudo-target will cause make to execute this file
30 ifndef NEWBUILD 30 # serially, regardless of -j. Recursively called makefiles will not be
31 NEWBUILD=true 31 # affected, however. This is required for correct dependency management.
32 .NOTPARALLEL:
33
34 # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
35 # /usr/ccs/bin/make lacks basically every other flow control mechanism.
36 TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
37
38 # Assume we have GNU make, but check version.
39 ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
40 $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
32 endif 41 endif
33 42
34 ifeq ($(NEWBUILD),true) 43 # Locate this Makefile
44 ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
45 makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
46 else
47 makefile_path:=$(lastword $(MAKEFILE_LIST))
48 endif
49 root_dir:=$(dir $(makefile_path))
35 50
36 # The new top level Makefile 51 # ... and then we can include our helper functions
37 include NewMakefile.gmk 52 include $(root_dir)/make/MakeHelpers.gmk
38 53
39 else # Original Makefile logic 54 $(eval $(call ParseLogLevel))
55 $(eval $(call ParseConfAndSpec))
40 56
41 BUILD_PARENT_DIRECTORY=. 57 # Now determine if we have zero, one or several configurations to build.
58 ifeq ($(SPEC),)
59 # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
60 else
61 ifeq ($(words $(SPEC)),1)
62 # We are building a single configuration. This is the normal case. Execute the Main.gmk file.
63 include $(root_dir)/make/Main.gmk
64 else
65 # We are building multiple configurations.
66 # First, find out the valid targets
67 # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
68 # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
69 all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
70 $(MAKE) -p -q -f make/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
71 grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
42 72
43 # Basename of any originally supplied ALT_OUTPUTDIR directory 73 $(all_phony_targets):
44 ifndef ORIG_OUTPUTDIR_BASENAME 74 @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
45 ifdef ALT_OUTPUTDIR 75 $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
46 ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
47 else
48 ORIG_OUTPUTDIR_BASENAME = $(PLATFORM)-$(ARCH)
49 endif
50 endif
51 export ORIG_OUTPUTDIR_BASENAME
52 76
53 # The three possible directories created for output (3 build flavors) 77 .PHONY: $(all_phony_targets)
54 OUTPUTDIR_BASENAME- = $(ORIG_OUTPUTDIR_BASENAME)
55 OUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug
56 OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
57 78
58 # Relative path to a debug output area
59 REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
60
61 # The created jdk image directory
62 JDK_IMAGE_DIRNAME = j2sdk-image
63 JDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
64 ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
65
66 # Relative path from an output directory to the image directory
67 REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
68 REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
69 REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
70
71 ifndef TOPDIR
72 TOPDIR:=.
73 endif
74
75 ifndef JDK_TOPDIR
76 JDK_TOPDIR=$(TOPDIR)/jdk
77 endif
78 ifndef JDK_MAKE_SHARED_DIR
79 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
80 endif
81
82 default: all
83
84 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
85 include ./make/Defs-internal.gmk
86 include ./make/sanity-rules.gmk
87 include ./make/hotspot-rules.gmk
88 include ./make/langtools-rules.gmk
89 include ./make/corba-rules.gmk
90 include ./make/jaxp-rules.gmk
91 include ./make/jaxws-rules.gmk
92 include ./make/jdk-rules.gmk
93 include ./make/nashorn-rules.gmk
94 include ./make/install-rules.gmk
95 include ./make/sponsors-rules.gmk
96 include ./make/deploy-rules.gmk
97
98 all:: sanity
99
100 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
101 all:: fastdebug_build
102 endif
103
104 ifeq ($(SKIP_DEBUG_BUILD), false)
105 all:: debug_build
106 endif
107
108 all:: all_product_build
109
110 all_product_build::
111
112 # Everything for a full product build
113 ifeq ($(SKIP_PRODUCT_BUILD), false)
114
115 all_product_build:: product_build
116
117 ifeq ($(BUILD_INSTALL), true)
118 all_product_build:: $(INSTALL)
119 clobber:: install-clobber
120 endif
121
122 ifeq ($(BUILD_SPONSORS), true)
123 all_product_build:: $(SPONSORS)
124 clobber:: sponsors-clobber
125 endif
126
127 ifneq ($(SKIP_COMPARE_IMAGES), true)
128 all_product_build:: compare-image
129 endif
130
131 endif
132
133 define StartTimer
134 $(MKDIR) -p $(BUILDTIMESDIR)
135 $(RM) $(BUILDTIMESDIR)/build_time_*
136 $(call RecordStartTime,TOTAL)
137 endef
138
139 define StopTimer
140 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
141 endef
142
143 # Generic build of basic repo series
144 generic_build_repo_series:: $(SOURCE_TIPS)
145 $(MKDIR) -p $(JDK_IMAGE_DIR)
146 @$(call StartTimer)
147
148 ifeq ($(BUILD_LANGTOOLS), true)
149 generic_build_repo_series:: langtools
150 clobber:: langtools-clobber
151 endif
152
153 ifeq ($(BUILD_CORBA), true)
154 generic_build_repo_series:: corba
155 clobber:: corba-clobber
156 endif
157
158 ifeq ($(BUILD_JAXP), true)
159 generic_build_repo_series:: jaxp
160 clobber:: jaxp-clobber
161 endif
162
163 ifeq ($(BUILD_JAXWS), true)
164 generic_build_repo_series:: jaxws
165 clobber:: jaxws-clobber
166 endif
167
168 ifeq ($(BUILD_HOTSPOT), true)
169 generic_build_repo_series:: $(HOTSPOT)
170 clobber:: hotspot-clobber
171 endif
172
173 ifeq ($(BUILD_JDK), true)
174 generic_build_repo_series:: $(JDK_JAVA_EXE)
175 clobber:: jdk-clobber
176 endif
177
178 ifeq ($(BUILD_NASHORN), true)
179 generic_build_repo_series:: $(NASHORN)
180 clobber:: nashorn-clobber
181 endif
182
183 ifeq ($(BUILD_DEPLOY), true)
184 generic_build_repo_series:: $(DEPLOY)
185 clobber:: deploy-clobber
186 endif
187
188 generic_build_repo_series::
189 @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
190
191 # The debug build, fastdebug or debug. Needs special handling.
192 # Note that debug builds do NOT do INSTALL steps, but must be done
193 # after the product build and before the INSTALL step of the product build.
194 #
195 # DEBUG_NAME is fastdebug or debug
196 # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
197 # The resulting image directory (j2sdk-image) is used by the install makefiles
198 # to create a debug install bundle jdk-*-debug-** bundle (tar or zip)
199 # which will install in the debug or fastdebug subdirectory of the
200 # normal product install area.
201 # The install process needs to know what the DEBUG_NAME is, so
202 # look for INSTALL_DEBUG_NAME in the install rules.
203 #
204 # NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
205 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may
206 # not be the same location.
207 #
208
209 # Location of fresh bootdir output
210 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
211 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
212 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
213
214 create_fresh_product_bootdir: FRC
215 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
216 GENERATE_DOCS=false \
217 BOOT_CYCLE_SETTINGS= \
218 build_product_image
219
220 create_fresh_debug_bootdir: FRC
221 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
222 GENERATE_DOCS=false \
223 BOOT_CYCLE_DEBUG_SETTINGS= \
224 build_debug_image
225
226 create_fresh_fastdebug_bootdir: FRC
227 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
228 GENERATE_DOCS=false \
229 BOOT_CYCLE_DEBUG_SETTINGS= \
230 build_fastdebug_image
231
232 # Create boot image?
233 ifeq ($(SKIP_BOOT_CYCLE),false)
234 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
235 DO_BOOT_CYCLE=true
236 endif 79 endif
237 endif 80 endif
238 81
82 # Include this after a potential spec file has been included so that the bundles target
83 # has access to the spec variables.
84 include $(root_dir)/make/Jprt.gmk
239 85
86 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
87 # If you addd more global targets, please update the variable global_targets in MakeHelpers.
240 88
241 ifeq ($(DO_BOOT_CYCLE),true) 89 help:
242 90 $(info )
243 # Create the bootdir to use in the build 91 $(info OpenJDK Makefile help)
244 product_build:: create_fresh_product_bootdir 92 $(info =====================)
245 debug_build:: create_fresh_debug_bootdir 93 $(info )
246 fastdebug_build:: create_fresh_fastdebug_bootdir 94 $(info Common make targets)
95 $(info . make [default] # Compile all product in langtools, hotspot, jaxp, jaxws,)
96 $(info . # corba and jdk)
97 $(info . make all # Compile everything, all repos and images)
98 $(info . make images # Create complete j2sdk and j2re images)
99 $(info . make docs # Create javadocs)
100 $(info . make overlay-images # Create limited images for sparc 64 bit platforms)
101 $(info . make profiles # Create complete j2re compact profile images)
102 $(info . make bootcycle-images # Build images twice, second time with newly build JDK)
103 $(info . make install # Install the generated images locally)
104 $(info . make clean # Remove all files generated by make, but not those)
105 $(info . # generated by configure)
106 $(info . make dist-clean # Remove all files, including configuration)
107 $(info . make help # Give some help on using make)
108 $(info . make test # Run tests, default is all tests (see TEST below))
109 $(info )
110 $(info Targets for specific components)
111 $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test))
112 $(info . make <component> # Build <component> and everything it depends on. )
113 $(info . make <component>-only # Build <component> only, without dependencies. This)
114 $(info . # is faster but can result in incorrect build results!)
115 $(info . make clean-<component> # Remove files generated by make for <component>)
116 $(info )
117 $(info Useful make variables)
118 $(info . make CONF= # Build all configurations (note, assignment is empty))
119 $(info . make CONF=<substring> # Build the configuration(s) with a name matching)
120 $(info . # <substring>)
121 $(info )
122 $(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
123 $(info . # Available log levels are:)
124 $(info . # 'warn' (default), 'info', 'debug' and 'trace')
125 $(info . # To see executed command lines, use LOG=debug)
126 $(info )
127 $(info . make JOBS=<n> # Run <n> parallel make jobs)
128 $(info . # Note that -jN does not work as expected!)
129 $(info )
130 $(info . make test TEST=<test> # Only run the given test or tests, e.g.)
131 $(info . # make test TEST="jdk_lang jdk_net")
132 $(info )
247 133
248 # Define variables to be used now for the boot jdk 134 .PHONY: help
249 BOOT_CYCLE_SETTINGS= \
250 ALT_BOOTDIR=$(FRESH_BOOTDIR) \
251 ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
252 BOOT_CYCLE_DEBUG_SETTINGS= \
253 ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
254 ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
255
256 else
257
258 # Use the supplied ALT_BOOTDIR as the boot
259 BOOT_CYCLE_SETTINGS=
260 BOOT_CYCLE_DEBUG_SETTINGS=
261
262 endif
263
264 build_product_image:
265 $(MAKE) \
266 SKIP_FASTDEBUG_BUILD=true \
267 SKIP_DEBUG_BUILD=true \
268 $(BOOT_CYCLE_SETTINGS) \
269 generic_build_repo_series
270
271 # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
272 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may
273 # not be the same location.
274
275 generic_debug_build:
276 $(MAKE) \
277 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
278 DEBUG_NAME=$(DEBUG_NAME) \
279 GENERATE_DOCS=false \
280 $(BOOT_CYCLE_DEBUG_SETTINGS) \
281 generic_build_repo_series
282
283 build_debug_image:
284 $(MAKE) DEBUG_NAME=debug generic_debug_build
285
286 build_fastdebug_image:
287 $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
288
289 # Build final image
290 product_build:: build_product_image
291 debug_build:: build_debug_image
292 fastdebug_build:: build_fastdebug_image
293
294 # The source tips are stored with the relative path to the repo.
295 # This file will be used when constructing the jdk image.
296 source_tips: $(SOURCE_TIPS)
297 $(CAT) $<
298 $(SOURCE_TIPS): FRC
299 @$(prep-target)
300 @$(call GetSourceTips)
301
302 clobber:: REPORT_BUILD_TIMES=
303 clobber::
304 $(RM) -r $(OUTPUTDIR)/*
305 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
306
307 clean: clobber
308
309 #
310 # Dev builds
311 #
312
313 dev : dev-build
314
315 dev-build:
316 $(MAKE) DEV_ONLY=true all
317 dev-sanity:
318 $(MAKE) DEV_ONLY=true sanity
319 dev-clobber:
320 $(MAKE) DEV_ONLY=true clobber
321
322 #
323 # Quick jdk verification build
324 #
325 jdk_only:
326 $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
327
328
329 #
330 # Quick jdk verification fastdebug build
331 #
332 jdk_fastdebug_only:
333 $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
334 BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
335
336 #
337 # Quick deploy verification fastdebug build
338 #
339 deploy_fastdebug_only:
340 $(MAKE) \
341 DEBUG_NAME=fastdebug \
342 BUILD_HOTSPOT=false \
343 BUILD_JDK=false \
344 BUILD_LANGTOOLS=false \
345 BUILD_NASHORN=false \
346 BUILD_CORBA=false \
347 BUILD_JAXP=false \
348 BUILD_JAXWS=false \
349 BUILD_INSTALL=false \
350 BUILD_SPONSORS=false \
351 generic_debug_build
352
353 #
354 # Product build (skip debug builds)
355 #
356 product_only:
357 $(MAKE) SKIP_FASTDEBUG_BUILD=true all
358
359 #
360 # Check target
361 #
362
363 check: variable_check
364
365 #
366 # Help target
367 #
368 help: intro_help target_help variable_help notes_help examples_help
369
370 # Intro help message
371 intro_help:
372 @$(ECHO) "\
373 Makefile for the JDK builds (all the JDK). \n\
374 "
375
376 # Target help
377 target_help:
378 @$(ECHO) "\
379 --- Common Targets --- \n\
380 all -- build the core JDK (default target) \n\
381 help -- Print out help information \n\
382 check -- Check make variable values for correctness \n\
383 sanity -- Perform detailed sanity checks on system and settings \n\
384 fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
385 debug_build -- build the core JDK in 'debug' mode (-g) \n\
386 clean -- remove all built and imported files \n\
387 clobber -- same as clean \n\
388 "
389
390 # Variable help (only common ones used by this Makefile)
391 variable_help: variable_help_intro variable_list variable_help_end
392 variable_help_intro:
393 @$(ECHO) "--- Common Variables ---"
394 variable_help_end:
395 @$(ECHO) " "
396
397 # One line descriptions for the variables
398 OUTPUTDIR.desc = Output directory
399 PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
400 SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
401 BOOTDIR.desc = JDK used to boot the build
402 JDK_IMPORT_PATH.desc = JDK used to import components of the build
403 COMPILER_PATH.desc = Compiler install directory
404 CACERTS_FILE.desc = Location of certificates file
405 DEVTOOLS_PATH.desc = Directory containing zip and gnumake
406 CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
407
408 # Make variables to print out (description and value)
409 VARIABLE_PRINTVAL_LIST += \
410 OUTPUTDIR \
411 PARALLEL_COMPILE_JOBS \
412 SLASH_JAVA \
413 BOOTDIR \
414 JDK_IMPORT_PATH \
415 COMPILER_PATH \
416 CACERTS_FILE \
417 DEVTOOLS_PATH
418
419 # Make variables that should refer to directories that exist
420 VARIABLE_CHECKDIR_LIST += \
421 SLASH_JAVA \
422 BOOTDIR \
423 JDK_IMPORT_PATH \
424 COMPILER_PATH \
425 DEVTOOLS_PATH
426
427 # Make variables that should refer to files that exist
428 VARIABLE_CHECKFIL_LIST += \
429 CACERTS_FILE
430
431 # For pattern rules below, so all are treated the same
432 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
433 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
434 DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
435
436 # Complete variable check
437 variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
438 variable_list: $(DO_PRINTVAL_LIST) variable_check
439
440 # Pattern rule for printing out a variable
441 %.printval:
442 @$(ECHO) " ALT_$* - $($*.desc)"
443 @$(ECHO) " \t $*=$($*)"
444
445 # Pattern rule for checking to see if a variable with a directory exists
446 %.checkdir:
447 @if [ ! -d $($*) ] ; then \
448 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
449 fi
450
451 # Pattern rule for checking to see if a variable with a file exists
452 %.checkfil:
453 @if [ ! -f $($*) ] ; then \
454 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
455 fi
456
457 # Misc notes on help
458 notes_help:
459 @$(ECHO) "\
460 --- Notes --- \n\
461 - All builds use same output directory unless overridden with \n\
462 \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
463 \t to use the clean target first. \n\
464 - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
465 \t builds or previous release JDK builds will work. \n\
466 - The fastest builds have been when the sources and the BOOTDIR are on \n\
467 \t local disk. \n\
468 "
469
470 examples_help:
471 @$(ECHO) "\
472 --- Examples --- \n\
473 $(MAKE) fastdebug_build \n\
474 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
475 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
476 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
477 $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
478 $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
479 "
480
481 ################################################################
482 # Source bundling
483 ################################################################
484 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
485 include $(BUNDLE_RULES)
486 endif
487
488 ################################################################
489 # rule to test
490 ################################################################
491
492 .NOTPARALLEL: test_run
493
494 test:
495 $(MAKE) test_run
496
497 test_run: test_clean test_start test_summary
498
499 test_start:
500 @$(ECHO) "Tests started at `$(DATE)`"
501
502 test_clean:
503 $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
504
505 test_summary: $(OUTPUTDIR)/test_failures.txt
506 @$(ECHO) "#################################################"
507 @$(ECHO) "Tests completed at `$(DATE)`"
508 @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
509 || $(ECHO) "No TEST STATS seen in log" )
510 @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
511 @$(ECHO) "#################################################"
512 @if [ -s $< ] ; then \
513 $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
514 $(CAT) $<; \
515 exit 1; \
516 else \
517 $(ECHO) "Success! No failures detected"; \
518 fi
519
520 # Get failure list from log
521 $(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
522 @$(RM) $@
523 @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
524
525 # Get log file of all tests run
526 JDK_TO_TEST := $(shell \
527 if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then \
528 $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; \
529 elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
530 $(ECHO) "$(ABS_OUTPUTDIR)"; \
531 elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
532 $(ECHO) "$(PRODUCT_HOME)"; \
533 fi \
534 )
535 TEST_TARGETS=all
536 $(OUTPUTDIR)/test_log.txt:
537 $(RM) $@
538 ( $(CD) test && \
539 $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
540 ) | tee $@
541
542 ################################################################
543 # JPRT rule to build
544 ################################################################
545
546 include ./make/jprt.gmk
547
548 ################################################################
549 # PHONY
550 ################################################################
551
552 .PHONY: all test test_run test_start test_summary test_clean \
553 generic_build_repo_series \
554 what clobber insane \
555 dev dev-build dev-sanity dev-clobber \
556 product_build \
557 fastdebug_build \
558 debug_build \
559 build_product_image \
560 build_debug_image \
561 build_fastdebug_image \
562 create_fresh_product_bootdir \
563 create_fresh_debug_bootdir \
564 create_fresh_fastdebug_bootdir \
565 generic_debug_build
566
567 # Force target
568 FRC:
569
570 endif # Original Makefile logic
571

mercurial