blob: f7b9d1b35e3ae0b1c2fae5701cc5519f7e00e018 [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
Kelly O'Hairec348ed2013-01-04 21:04:03 -080029# If not specified, select what the default build is
30ifndef NEWBUILD
31 NEWBUILD=true
32endif
33
Kelly O'Hair228c2162012-09-18 11:29:16 -070034ifeq ($(NEWBUILD),true)
35
36 # The new top level Makefile
37 include NewMakefile.gmk
38
39else # Original Makefile logic
40
Kelly O'Hair6377bd62008-03-09 15:47:58 -070041BUILD_PARENT_DIRECTORY=.
42
Kelly O'Haireebc4b12011-05-16 08:40:01 -070043# Basename of any originally supplied ALT_OUTPUTDIR directory
44ifndef ORIG_OUTPUTDIR_BASENAME
45 ifdef ALT_OUTPUTDIR
46 ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
47 else
48 ORIG_OUTPUTDIR_BASENAME = $(PLATFORM)-$(ARCH)
49 endif
50endif
51export ORIG_OUTPUTDIR_BASENAME
52
53# The three possible directories created for output (3 build flavors)
54OUTPUTDIR_BASENAME- = $(ORIG_OUTPUTDIR_BASENAME)
55OUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug
56OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
57
58# Relative path to a debug output area
59REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
60
61# The created jdk image directory
62JDK_IMAGE_DIRNAME = j2sdk-image
63JDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
64ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
65
66# Relative path from an output directory to the image directory
67REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
68REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
69REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
70
J. Duke686d76f2007-12-01 00:00:00 +000071ifndef TOPDIR
Kelly O'Hairfb56a9a2008-03-25 14:38:56 -070072 TOPDIR:=.
J. Duke686d76f2007-12-01 00:00:00 +000073endif
74
J. Duke686d76f2007-12-01 00:00:00 +000075ifndef JDK_TOPDIR
76 JDK_TOPDIR=$(TOPDIR)/jdk
77endif
78ifndef JDK_MAKE_SHARED_DIR
79 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
80endif
81
Kelly O'Hairfa892cf2008-08-06 14:57:13 -070082default: all
83
J. Duke686d76f2007-12-01 00:00:00 +000084include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
J. Duke686d76f2007-12-01 00:00:00 +000085include ./make/Defs-internal.gmk
J. Duke686d76f2007-12-01 00:00:00 +000086include ./make/sanity-rules.gmk
J. Duke686d76f2007-12-01 00:00:00 +000087include ./make/hotspot-rules.gmk
88include ./make/langtools-rules.gmk
89include ./make/corba-rules.gmk
90include ./make/jaxp-rules.gmk
91include ./make/jaxws-rules.gmk
92include ./make/jdk-rules.gmk
Erik Joelsson5c31bde2013-02-25 15:08:11 -080093include ./make/nashorn-rules.gmk
J. Duke686d76f2007-12-01 00:00:00 +000094include ./make/install-rules.gmk
95include ./make/sponsors-rules.gmk
96include ./make/deploy-rules.gmk
97
Kelly O'Hair88990fd2011-01-05 17:24:58 -080098all:: sanity
Kelly O'Hairfa892cf2008-08-06 14:57:13 -070099
100ifeq ($(SKIP_FASTDEBUG_BUILD), false)
101 all:: fastdebug_build
102endif
103
104ifeq ($(SKIP_DEBUG_BUILD), false)
105 all:: debug_build
106endif
107
Kelly O'Hair179908e2008-08-17 09:56:25 -0700108all:: all_product_build
109
Kelly O'Hairc64ee492011-03-09 16:26:38 -0800110all_product_build::
111
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700112# Everything for a full product build
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700113ifeq ($(SKIP_PRODUCT_BUILD), false)
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100114
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700115 all_product_build:: product_build
116
117 ifeq ($(BUILD_INSTALL), true)
118 all_product_build:: $(INSTALL)
119 clobber:: install-clobber
120 endif
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100121
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700122 ifeq ($(BUILD_SPONSORS), true)
123 all_product_build:: $(SPONSORS)
124 clobber:: sponsors-clobber
125 endif
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100126
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700127 ifneq ($(SKIP_COMPARE_IMAGES), true)
128 all_product_build:: compare-image
129 endif
130
131endif
132
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100133define StartTimer
134 $(MKDIR) -p $(BUILDTIMESDIR)
135 $(RM) $(BUILDTIMESDIR)/build_time_*
136 $(call RecordStartTime,TOTAL)
137endef
138
139define StopTimer
140 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
141endef
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700142
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700143# Generic build of basic repo series
Kelly O'Hair4231fbb2011-04-26 16:30:00 -0700144generic_build_repo_series:: $(SOURCE_TIPS)
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700145 $(MKDIR) -p $(JDK_IMAGE_DIR)
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100146 @$(call StartTimer)
J. Duke686d76f2007-12-01 00:00:00 +0000147
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700148ifeq ($(BUILD_LANGTOOLS), true)
149 generic_build_repo_series:: langtools
150 clobber:: langtools-clobber
151endif
152
153ifeq ($(BUILD_CORBA), true)
154 generic_build_repo_series:: corba
155 clobber:: corba-clobber
156endif
157
158ifeq ($(BUILD_JAXP), true)
159 generic_build_repo_series:: jaxp
160 clobber:: jaxp-clobber
161endif
162
163ifeq ($(BUILD_JAXWS), true)
164 generic_build_repo_series:: jaxws
165 clobber:: jaxws-clobber
166endif
167
168ifeq ($(BUILD_HOTSPOT), true)
169 generic_build_repo_series:: $(HOTSPOT)
170 clobber:: hotspot-clobber
171endif
172
173ifeq ($(BUILD_JDK), true)
174 generic_build_repo_series:: $(JDK_JAVA_EXE)
175 clobber:: jdk-clobber
176endif
177
Erik Joelsson5c31bde2013-02-25 15:08:11 -0800178ifeq ($(BUILD_NASHORN), true)
179 generic_build_repo_series:: $(NASHORN)
180 clobber:: nashorn-clobber
181endif
182
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700183ifeq ($(BUILD_DEPLOY), true)
184 generic_build_repo_series:: $(DEPLOY)
185 clobber:: deploy-clobber
186endif
187
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100188generic_build_repo_series::
189 @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
190
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700191# 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
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700197# 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)
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700199# 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#
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700204# 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#
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700208
209# Location of fresh bootdir output
210ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700211FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
212FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700213
214create_fresh_product_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700215 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800216 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700217 BOOT_CYCLE_SETTINGS= \
218 build_product_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700219
220create_fresh_debug_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700221 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800222 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700223 BOOT_CYCLE_DEBUG_SETTINGS= \
224 build_debug_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700225
226create_fresh_fastdebug_bootdir: FRC
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700227 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800228 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700229 BOOT_CYCLE_DEBUG_SETTINGS= \
230 build_fastdebug_image
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700231
232# Create boot image?
233ifeq ($(SKIP_BOOT_CYCLE),false)
234 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
235 DO_BOOT_CYCLE=true
236 endif
237endif
238
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100239
240
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700241ifeq ($(DO_BOOT_CYCLE),true)
242
243 # Create the bootdir to use in the build
244 product_build:: create_fresh_product_bootdir
245 debug_build:: create_fresh_debug_bootdir
246 fastdebug_build:: create_fresh_fastdebug_bootdir
247
248 # Define variables to be used now for the boot jdk
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
256else
257
258 # Use the supplied ALT_BOOTDIR as the boot
259 BOOT_CYCLE_SETTINGS=
260 BOOT_CYCLE_DEBUG_SETTINGS=
261
262endif
263
264build_product_image:
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700265 $(MAKE) \
266 SKIP_FASTDEBUG_BUILD=true \
267 SKIP_DEBUG_BUILD=true \
268 $(BOOT_CYCLE_SETTINGS) \
269 generic_build_repo_series
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700270
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700271# 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
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700275generic_debug_build:
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700276 $(MAKE) \
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700277 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700278 DEBUG_NAME=$(DEBUG_NAME) \
Kelly O'Haird0c9ba32009-11-18 16:41:09 -0800279 GENERATE_DOCS=false \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700280 $(BOOT_CYCLE_DEBUG_SETTINGS) \
281 generic_build_repo_series
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700282
283build_debug_image:
284 $(MAKE) DEBUG_NAME=debug generic_debug_build
285
286build_fastdebug_image:
287 $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
288
289# Build final image
290product_build:: build_product_image
291debug_build:: build_debug_image
292fastdebug_build:: build_fastdebug_image
293
Kelly O'Hair4231fbb2011-04-26 16:30:00 -0700294# The source tips are stored with the relative path to the repo.
295# This file will be used when constructing the jdk image.
296source_tips: $(SOURCE_TIPS)
297 $(CAT) $<
298$(SOURCE_TIPS): FRC
299 @$(prep-target)
300 @$(call GetSourceTips)
301
Fredrik Öhrström4eb68762011-02-28 10:56:10 +0100302clobber:: REPORT_BUILD_TIMES=
303clobber::
J. Duke686d76f2007-12-01 00:00:00 +0000304 $(RM) -r $(OUTPUTDIR)/*
J. Duke686d76f2007-12-01 00:00:00 +0000305 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
306
307clean: clobber
308
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700309#
310# Dev builds
311#
312
313dev : dev-build
314
315dev-build:
316 $(MAKE) DEV_ONLY=true all
317dev-sanity:
318 $(MAKE) DEV_ONLY=true sanity
319dev-clobber:
320 $(MAKE) DEV_ONLY=true clobber
J. Duke686d76f2007-12-01 00:00:00 +0000321
322#
323# Quick jdk verification build
324#
325jdk_only:
326 $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
327
328
329#
330# Quick jdk verification fastdebug build
331#
332jdk_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#
339deploy_fastdebug_only:
340 $(MAKE) \
341 DEBUG_NAME=fastdebug \
342 BUILD_HOTSPOT=false \
343 BUILD_JDK=false \
344 BUILD_LANGTOOLS=false \
Erik Joelsson5c31bde2013-02-25 15:08:11 -0800345 BUILD_NASHORN=false \
J. Duke686d76f2007-12-01 00:00:00 +0000346 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#
356product_only:
357 $(MAKE) SKIP_FASTDEBUG_BUILD=true all
358
359#
360# Check target
361#
362
363check: variable_check
364
365#
366# Help target
367#
368help: intro_help target_help variable_help notes_help examples_help
369
370# Intro help message
371intro_help:
372 @$(ECHO) "\
373Makefile for the JDK builds (all the JDK). \n\
374"
375
376# Target help
377target_help:
378 @$(ECHO) "\
379--- Common Targets --- \n\
380all -- build the core JDK (default target) \n\
381help -- Print out help information \n\
382check -- Check make variable values for correctness \n\
383sanity -- Perform detailed sanity checks on system and settings \n\
384fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
385debug_build -- build the core JDK in 'debug' mode (-g) \n\
386clean -- remove all built and imported files \n\
387clobber -- same as clean \n\
388"
389
390# Variable help (only common ones used by this Makefile)
391variable_help: variable_help_intro variable_list variable_help_end
392variable_help_intro:
393 @$(ECHO) "--- Common Variables ---"
394variable_help_end:
395 @$(ECHO) " "
396
397# One line descriptions for the variables
398OUTPUTDIR.desc = Output directory
399PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
400SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
401BOOTDIR.desc = JDK used to boot the build
402JDK_IMPORT_PATH.desc = JDK used to import components of the build
403COMPILER_PATH.desc = Compiler install directory
404CACERTS_FILE.desc = Location of certificates file
405DEVTOOLS_PATH.desc = Directory containing zip and gnumake
406CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
407DXSDK_PATH.desc = Root directory of DirectX SDK
J. Duke686d76f2007-12-01 00:00:00 +0000408
409# Make variables to print out (description and value)
410VARIABLE_PRINTVAL_LIST += \
411 OUTPUTDIR \
412 PARALLEL_COMPILE_JOBS \
413 SLASH_JAVA \
414 BOOTDIR \
415 JDK_IMPORT_PATH \
416 COMPILER_PATH \
417 CACERTS_FILE \
418 DEVTOOLS_PATH
419
420# Make variables that should refer to directories that exist
421VARIABLE_CHECKDIR_LIST += \
422 SLASH_JAVA \
423 BOOTDIR \
424 JDK_IMPORT_PATH \
425 COMPILER_PATH \
426 DEVTOOLS_PATH
427
428# Make variables that should refer to files that exist
429VARIABLE_CHECKFIL_LIST += \
430 CACERTS_FILE
431
432# Some are windows specific
433ifeq ($(PLATFORM), windows)
434
435VARIABLE_PRINTVAL_LIST += \
Kelly O'Hair5ef33b62011-01-14 14:04:19 -0800436 DXSDK_PATH
J. Duke686d76f2007-12-01 00:00:00 +0000437
438VARIABLE_CHECKDIR_LIST += \
Kelly O'Hair5ef33b62011-01-14 14:04:19 -0800439 DXSDK_PATH
J. Duke686d76f2007-12-01 00:00:00 +0000440
441endif
442
443# For pattern rules below, so all are treated the same
444DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
445DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
446DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
447
448# Complete variable check
449variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
450variable_list: $(DO_PRINTVAL_LIST) variable_check
451
452# Pattern rule for printing out a variable
453%.printval:
454 @$(ECHO) " ALT_$* - $($*.desc)"
455 @$(ECHO) " \t $*=$($*)"
456
457# Pattern rule for checking to see if a variable with a directory exists
458%.checkdir:
459 @if [ ! -d $($*) ] ; then \
460 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
461 fi
462
463# Pattern rule for checking to see if a variable with a file exists
464%.checkfil:
465 @if [ ! -f $($*) ] ; then \
466 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
467 fi
468
469# Misc notes on help
470notes_help:
471 @$(ECHO) "\
472--- Notes --- \n\
473- All builds use same output directory unless overridden with \n\
474 \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
475 \t to use the clean target first. \n\
476- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
477 \t builds or previous release JDK builds will work. \n\
478- The fastest builds have been when the sources and the BOOTDIR are on \n\
479 \t local disk. \n\
480"
481
482examples_help:
483 @$(ECHO) "\
484--- Examples --- \n\
485 $(MAKE) fastdebug_build \n\
486 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
487 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
488 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
489 $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
490 $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
491"
492
493################################################################
Kelly O'Haird77b0512010-12-23 18:41:57 -0800494# Source bundling
J. Duke686d76f2007-12-01 00:00:00 +0000495################################################################
496ifeq ($(BUNDLE_RULES_AVAILABLE), true)
497 include $(BUNDLE_RULES)
498endif
499
500################################################################
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700501# rule to test
502################################################################
503
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700504.NOTPARALLEL: test_run
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700505
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700506test:
507 $(MAKE) test_run
508
509test_run: test_clean test_start test_summary
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700510
511test_start:
512 @$(ECHO) "Tests started at `$(DATE)`"
513
514test_clean:
515 $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
516
517test_summary: $(OUTPUTDIR)/test_failures.txt
518 @$(ECHO) "#################################################"
519 @$(ECHO) "Tests completed at `$(DATE)`"
520 @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
521 || $(ECHO) "No TEST STATS seen in log" )
522 @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
523 @$(ECHO) "#################################################"
524 @if [ -s $< ] ; then \
525 $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
526 $(CAT) $<; \
527 exit 1; \
528 else \
529 $(ECHO) "Success! No failures detected"; \
530 fi
531
532# Get failure list from log
533$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
534 @$(RM) $@
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700535 @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700536
537# Get log file of all tests run
538JDK_TO_TEST := $(shell \
Kelly O'Haireebc4b12011-05-16 08:40:01 -0700539 if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then \
540 $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; \
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700541 elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
542 $(ECHO) "$(ABS_OUTPUTDIR)"; \
543 elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
544 $(ECHO) "$(PRODUCT_HOME)"; \
545 fi \
546)
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700547TEST_TARGETS=all
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700548$(OUTPUTDIR)/test_log.txt:
549 $(RM) $@
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700550 ( $(CD) test && \
551 $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
Kelly O'Hair0eca63f2010-06-21 11:00:15 -0700552 ) | tee $@
553
554################################################################
J. Duke686d76f2007-12-01 00:00:00 +0000555# JPRT rule to build
556################################################################
557
558include ./make/jprt.gmk
559
560################################################################
561# PHONY
562################################################################
563
Kelly O'Haire0c099c2010-09-24 14:03:33 -0700564.PHONY: all test test_run test_start test_summary test_clean \
Kelly O'Hairfa892cf2008-08-06 14:57:13 -0700565 generic_build_repo_series \
566 what clobber insane \
567 dev dev-build dev-sanity dev-clobber \
568 product_build \
569 fastdebug_build \
570 debug_build \
571 build_product_image \
572 build_debug_image \
573 build_fastdebug_image \
574 create_fresh_product_bootdir \
575 create_fresh_debug_bootdir \
576 create_fresh_fastdebug_bootdir \
577 generic_debug_build
J. Duke686d76f2007-12-01 00:00:00 +0000578
Kelly O'Hair6377bd62008-03-09 15:47:58 -0700579# Force target
580FRC:
581
Kelly O'Hair228c2162012-09-18 11:29:16 -0700582endif # Original Makefile logic
583