blob: 79c159e9e5cac9fd826a4cd7c796c852d3fa1c50 [file] [log] [blame]
J. Duke686d76f2007-12-01 00:00:00 +00001#
Kelly O'Hair228c2162012-09-18 11:29:16 -07002# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
J. Duke686d76f2007-12-01 00:00:00 +00003# 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
Kelly O'Hair136614e2010-05-25 15:51:26 -07007# published by the Free Software Foundation. Oracle designates this
J. Duke686d76f2007-12-01 00:00:00 +00008# particular file as subject to the "Classpath" exception as provided
Kelly O'Hair136614e2010-05-25 15:51:26 -07009# by Oracle in the LICENSE file that accompanied this code.
J. Duke686d76f2007-12-01 00:00:00 +000010#
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#
Kelly O'Hair136614e2010-05-25 15:51:26 -070021# 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.
J. Duke686d76f2007-12-01 00:00:00 +000024#
25
Kelly O'Hair228c2162012-09-18 11:29:16 -070026# If NEWBUILD is defined, use the new build-infra Makefiles and configure.
27# See NewMakefile.gmk for more information.
28
29ifeq ($(NEWBUILD),true)
30
31 # The new top level Makefile
32 include NewMakefile.gmk
33
34else # Original Makefile logic
35
Kelly O'Hair6377bd62008-03-09 15:47:58 -070036BUILD_PARENT_DIRECTORY=.
37
Kelly O'Haireebc4b12011-05-16 08:40:01 -070038# Basename of any originally supplied ALT_OUTPUTDIR directory
39ifndef ORIG_OUTPUTDIR_BASENAME
40 ifdef ALT_OUTPUTDIR
41 ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
42 else
43 ORIG_OUTPUTDIR_BASENAME = $(PLATFORM)-$(ARCH)
44 endif
45endif
46export ORIG_OUTPUTDIR_BASENAME
47
48# The three possible directories created for output (3 build flavors)
49OUTPUTDIR_BASENAME- = $(ORIG_OUTPUTDIR_BASENAME)
50OUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug
51OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
52
53# Relative path to a debug output area
54REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
55
56# The created jdk image directory
57JDK_IMAGE_DIRNAME = j2sdk-image
58JDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
59ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
60
61# Relative path from an output directory to the image directory
62REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
63REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
64REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
65
J. Duke686d76f2007-12-01 00:00:00 +000066ifndef TOPDIR
Kelly O'Hairfb56a9a2008-03-25 14:38:56 -070067 TOPDIR:=.
J. Duke686d76f2007-12-01 00:00:00 +000068endif
69
J. Duke686d76f2007-12-01 00:00:00 +000070ifndef JDK_TOPDIR
71 JDK_TOPDIR=$(TOPDIR)/jdk
72endif
73ifndef JDK_MAKE_SHARED_DIR
74 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
75endif
76
Kelly O'Hairfa892cf2008-08-06 14:57:13 -070077default: all
78
J. Duke686d76f2007-12-01 00:00:00 +000079include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
J. Duke686d76f2007-12-01 00:00:00 +000080include ./make/Defs-internal.gmk
J. Duke686d76f2007-12-01 00:00:00 +000081include ./make/sanity-rules.gmk
J. Duke686d76f2007-12-01 00:00:00 +000082include ./make/hotspot-rules.gmk
83include ./make/langtools-rules.gmk
84include ./make/corba-rules.gmk
85include ./make/jaxp-rules.gmk
86include ./make/jaxws-rules.gmk
87include ./make/jdk-rules.gmk
88include ./make/install-rules.gmk
89include ./make/sponsors-rules.gmk
90include ./make/deploy-rules.gmk
91
Kelly O'Hair88990fd2011-01-05 17:24:58 -080092all:: sanity
Kelly O'Hairfa892cf2008-08-06 14:57:13 -070093
94ifeq ($(SKIP_FASTDEBUG_BUILD), false)
95 all:: fastdebug_build
96endif
97
98ifeq ($(SKIP_DEBUG_BUILD), false)
99 all:: debug_build
100endif
101
Kelly O'Hair179908e2008-08-17 09:56:25 -0700102all:: all_product_build
103
Kelly O'Hairc64ee492011-03-09 16:26:38 -0800104all_product_build::
105
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700106# Everything for a full product build
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700107ifeq ($(SKIP_PRODUCT_BUILD), false)
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100108
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700109 all_product_build:: product_build
110
111 ifeq ($(BUILD_INSTALL), true)
112 all_product_build:: $(INSTALL)
113 clobber:: install-clobber
114 endif
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100115
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700116 ifeq ($(BUILD_SPONSORS), true)
117 all_product_build:: $(SPONSORS)
118 clobber:: sponsors-clobber
119 endif
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100120
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700121 ifneq ($(SKIP_COMPARE_IMAGES), true)
122 all_product_build:: compare-image
123 endif
124
125endif
126
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100127define StartTimer
128 $(MKDIR) -p $(BUILDTIMESDIR)
129 $(RM) $(BUILDTIMESDIR)/build_time_*
130 $(call RecordStartTime,TOTAL)
131endef
132
133define StopTimer
134 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
135endef
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700136
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700137# Generic build of basic repo series
Kelly O'Hair4231fbb2011-04-26 16:30:00 -0700138generic_build_repo_series:: $(SOURCE_TIPS)
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700139 $(MKDIR) -p $(JDK_IMAGE_DIR)
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100140 @$(call StartTimer)
J. Duke686d76f2007-12-01 00:00:00 +0000141
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700142ifeq ($(BUILD_LANGTOOLS), true)
143 generic_build_repo_series:: langtools
144 clobber:: langtools-clobber
145endif
146
147ifeq ($(BUILD_CORBA), true)
148 generic_build_repo_series:: corba
149 clobber:: corba-clobber
150endif
151
152ifeq ($(BUILD_JAXP), true)
153 generic_build_repo_series:: jaxp
154 clobber:: jaxp-clobber
155endif
156
157ifeq ($(BUILD_JAXWS), true)
158 generic_build_repo_series:: jaxws
159 clobber:: jaxws-clobber
160endif
161
162ifeq ($(BUILD_HOTSPOT), true)
163 generic_build_repo_series:: $(HOTSPOT)
164 clobber:: hotspot-clobber
165endif
166
167ifeq ($(BUILD_JDK), true)
168 generic_build_repo_series:: $(JDK_JAVA_EXE)
169 clobber:: jdk-clobber
170endif
171
172ifeq ($(BUILD_DEPLOY), true)
173 generic_build_repo_series:: $(DEPLOY)
174 clobber:: deploy-clobber
175endif
176
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100177generic_build_repo_series::
178 @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
179
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700180# The debug build, fastdebug or debug. Needs special handling.
181# Note that debug builds do NOT do INSTALL steps, but must be done
182# after the product build and before the INSTALL step of the product build.
183#
184# DEBUG_NAME is fastdebug or debug
185# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700186# The resulting image directory (j2sdk-image) is used by the install makefiles
187# to create a debug install bundle jdk-*-debug-** bundle (tar or zip)
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700188# which will install in the debug or fastdebug subdirectory of the
189# normal product install area.
190# The install process needs to know what the DEBUG_NAME is, so
191# look for INSTALL_DEBUG_NAME in the install rules.
192#
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700193# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
194# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
195# not be the same location.
196#
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700197
198# Location of fresh bootdir output
199ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700200FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
201FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700202
203create_fresh_product_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700204 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800205 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700206 BOOT_CYCLE_SETTINGS= \
207 build_product_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700208
209create_fresh_debug_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700210 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800211 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700212 BOOT_CYCLE_DEBUG_SETTINGS= \
213 build_debug_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700214
215create_fresh_fastdebug_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700216 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800217 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700218 BOOT_CYCLE_DEBUG_SETTINGS= \
219 build_fastdebug_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700220
221# Create boot image?
222ifeq ($(SKIP_BOOT_CYCLE),false)
223 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
224 DO_BOOT_CYCLE=true
225 endif
226endif
227
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100228
229
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700230ifeq ($(DO_BOOT_CYCLE),true)
231
232 # Create the bootdir to use in the build
233 product_build:: create_fresh_product_bootdir
234 debug_build:: create_fresh_debug_bootdir
235 fastdebug_build:: create_fresh_fastdebug_bootdir
236
237 # Define variables to be used now for the boot jdk
238 BOOT_CYCLE_SETTINGS= \
239 ALT_BOOTDIR=$(FRESH_BOOTDIR) \
240 ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
241 BOOT_CYCLE_DEBUG_SETTINGS= \
242 ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
243 ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
244
245else
246
247 # Use the supplied ALT_BOOTDIR as the boot
248 BOOT_CYCLE_SETTINGS=
249 BOOT_CYCLE_DEBUG_SETTINGS=
250
251endif
252
253build_product_image:
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700254 $(MAKE) \
255 SKIP_FASTDEBUG_BUILD=true \
256 SKIP_DEBUG_BUILD=true \
257 $(BOOT_CYCLE_SETTINGS) \
258 generic_build_repo_series
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700259
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700260# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
261# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
262# not be the same location.
263
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700264generic_debug_build:
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700265 $(MAKE) \
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700266 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700267 DEBUG_NAME=$(DEBUG_NAME) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800268 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700269 $(BOOT_CYCLE_DEBUG_SETTINGS) \
270 generic_build_repo_series
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700271
272build_debug_image:
273 $(MAKE) DEBUG_NAME=debug generic_debug_build
274
275build_fastdebug_image:
276 $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
277
278# Build final image
279product_build:: build_product_image
280debug_build:: build_debug_image
281fastdebug_build:: build_fastdebug_image
282
Kelly O'Hair4231fbb2011-04-26 16:30:00 -0700283# The source tips are stored with the relative path to the repo.
284# This file will be used when constructing the jdk image.
285source_tips: $(SOURCE_TIPS)
286 $(CAT) $<
287$(SOURCE_TIPS): FRC
288 @$(prep-target)
289 @$(call GetSourceTips)
290
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100291clobber:: REPORT_BUILD_TIMES=
292clobber::
J. Duke686d76f2007-12-01 00:00:00 +0000293 $(RM) -r $(OUTPUTDIR)/*
J. Duke686d76f2007-12-01 00:00:00 +0000294 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
295
296clean: clobber
297
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700298#
299# Dev builds
300#
301
302dev : dev-build
303
304dev-build:
305 $(MAKE) DEV_ONLY=true all
306dev-sanity:
307 $(MAKE) DEV_ONLY=true sanity
308dev-clobber:
309 $(MAKE) DEV_ONLY=true clobber
J. Duke686d76f2007-12-01 00:00:00 +0000310
311#
312# Quick jdk verification build
313#
314jdk_only:
315 $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
316
317
318#
319# Quick jdk verification fastdebug build
320#
321jdk_fastdebug_only:
322 $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
323 BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
324
325#
326# Quick deploy verification fastdebug build
327#
328deploy_fastdebug_only:
329 $(MAKE) \
330 DEBUG_NAME=fastdebug \
331 BUILD_HOTSPOT=false \
332 BUILD_JDK=false \
333 BUILD_LANGTOOLS=false \
334 BUILD_CORBA=false \
335 BUILD_JAXP=false \
336 BUILD_JAXWS=false \
337 BUILD_INSTALL=false \
338 BUILD_SPONSORS=false \
339 generic_debug_build
340
341#
342# Product build (skip debug builds)
343#
344product_only:
345 $(MAKE) SKIP_FASTDEBUG_BUILD=true all
346
347#
348# Check target
349#
350
351check: variable_check
352
353#
354# Help target
355#
356help: intro_help target_help variable_help notes_help examples_help
357
358# Intro help message
359intro_help:
360 @$(ECHO) "\
361Makefile for the JDK builds (all the JDK). \n\
362"
363
364# Target help
365target_help:
366 @$(ECHO) "\
367--- Common Targets --- \n\
368all -- build the core JDK (default target) \n\
369help -- Print out help information \n\
370check -- Check make variable values for correctness \n\
371sanity -- Perform detailed sanity checks on system and settings \n\
372fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
373debug_build -- build the core JDK in 'debug' mode (-g) \n\
374clean -- remove all built and imported files \n\
375clobber -- same as clean \n\
376"
377
378# Variable help (only common ones used by this Makefile)
379variable_help: variable_help_intro variable_list variable_help_end
380variable_help_intro:
381 @$(ECHO) "--- Common Variables ---"
382variable_help_end:
383 @$(ECHO) " "
384
385# One line descriptions for the variables
386OUTPUTDIR.desc = Output directory
387PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
388SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
389BOOTDIR.desc = JDK used to boot the build
390JDK_IMPORT_PATH.desc = JDK used to import components of the build
391COMPILER_PATH.desc = Compiler install directory
392CACERTS_FILE.desc = Location of certificates file
393DEVTOOLS_PATH.desc = Directory containing zip and gnumake
394CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
395DXSDK_PATH.desc = Root directory of DirectX SDK
J. Duke686d76f2007-12-01 00:00:00 +0000396
397# Make variables to print out (description and value)
398VARIABLE_PRINTVAL_LIST += \
399 OUTPUTDIR \
400 PARALLEL_COMPILE_JOBS \
401 SLASH_JAVA \
402 BOOTDIR \
403 JDK_IMPORT_PATH \
404 COMPILER_PATH \
405 CACERTS_FILE \
406 DEVTOOLS_PATH
407
408# Make variables that should refer to directories that exist
409VARIABLE_CHECKDIR_LIST += \
410 SLASH_JAVA \
411 BOOTDIR \
412 JDK_IMPORT_PATH \
413 COMPILER_PATH \
414 DEVTOOLS_PATH
415
416# Make variables that should refer to files that exist
417VARIABLE_CHECKFIL_LIST += \
418 CACERTS_FILE
419
420# Some are windows specific
421ifeq ($(PLATFORM), windows)
422
423VARIABLE_PRINTVAL_LIST += \
Kelly O'Hair5ef33b62011-01-14 14:04:19 -0800424 DXSDK_PATH
J. Duke686d76f2007-12-01 00:00:00 +0000425
426VARIABLE_CHECKDIR_LIST += \
Kelly O'Hair5ef33b62011-01-14 14:04:19 -0800427 DXSDK_PATH
J. Duke686d76f2007-12-01 00:00:00 +0000428
429endif
430
431# For pattern rules below, so all are treated the same
432DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
433DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
434DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
435
436# Complete variable check
437variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
438variable_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
458notes_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
470examples_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################################################################
Kelly O'Haird77b0512010-12-23 18:41:57 -0800482# Source bundling
J. Duke686d76f2007-12-01 00:00:00 +0000483################################################################
484ifeq ($(BUNDLE_RULES_AVAILABLE), true)
485 include $(BUNDLE_RULES)
486endif
487
488################################################################
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700489# rule to test
490################################################################
491
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700492.NOTPARALLEL: test_run
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700493
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700494test:
495 $(MAKE) test_run
496
497test_run: test_clean test_start test_summary
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700498
499test_start:
500 @$(ECHO) "Tests started at `$(DATE)`"
501
502test_clean:
503 $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
504
505test_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) $@
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700523 @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700524
525# Get log file of all tests run
526JDK_TO_TEST := $(shell \
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700527 if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then \
528 $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; \
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700529 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)
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700535TEST_TARGETS=all
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700536$(OUTPUTDIR)/test_log.txt:
537 $(RM) $@
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700538 ( $(CD) test && \
539 $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700540 ) | tee $@
541
542################################################################
J. Duke686d76f2007-12-01 00:00:00 +0000543# JPRT rule to build
544################################################################
545
546include ./make/jprt.gmk
547
548################################################################
549# PHONY
550################################################################
551
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700552.PHONY: all test test_run test_start test_summary test_clean \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700553 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
J. Duke686d76f2007-12-01 00:00:00 +0000566
Kelly O'Hair6377bd62008-03-09 15:47:58 -0700567# Force target
568FRC:
569
Kelly O'Hair228c2162012-09-18 11:29:16 -0700570endif # Original Makefile logic
571