0N/A#
3909N/A# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
2362N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
2362N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Makefile for building and packaging all of the JDK and the JRE. See
0N/A# also included files.
0N/A#
0N/A
0N/ABUILDDIR=.
0N/Ainclude $(BUILDDIR)/common/Defs.gmk
0N/A
0N/A#
0N/A# Make sure we are clear what the default target is
0N/A#
0N/Adefault_target: all
0N/A
0N/A#
0N/A# Check target
0N/A#
0N/A
0N/Acheck: variable_check
0N/A
0N/A#
0N/A# Help target
0N/A#
0N/Ahelp: intro_help target_help variable_help notes_help examples_help
0N/A
0N/A# Intro help message
0N/Aintro_help:
0N/A @$(ECHO) "\
0N/AMakefile for the main JDK workspace. \n\
0N/ADefault behavior is to use the BOOTDIR javac to bootstrap the build and \n\
0N/Aimport in pre-built components like the VM from the JDK_IMPORT_PATH. \n\
0N/A"
0N/A
0N/A# Target help
0N/Atarget_help:
0N/A @$(ECHO) "\
0N/A--- Common Targets --- \n\
0N/Aall -- build the core JDK (default target) \n\
0N/Ahelp -- Print out help information \n\
0N/Acheck -- Check make variable values for correctness \n\
0N/Asanity -- Perform detailed sanity checks on system and settings \n\
0N/Aopenjdk -- synonym for 'OPENJDK=true all' \n\
0N/Afastdebug -- build the core JDK in 'fastdebug' mode (-g -O) \n\
0N/Adebug -- build the core JDK in 'debug' mode (-g) \n\
0N/Aclean -- remove all built and imported files \n\
0N/Aclobber -- same as clean \n\
0N/Adocs -- run javadoc to generate the JDK documentation \n\
0N/Aimages -- build the jdk and jre image directories \n\
0N/Aimport -- copy in the pre-built components (e.g. VM) \n\
0N/Aimport_product -- copy in the product components \n\
0N/Aimport_fastdebug -- copy in the fastdebug components \n\
0N/Aimport_debug -- copy in the debug components \n\
0N/Acreate_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
0N/A"
0N/A
0N/A# Variable help (only common ones used by this workspace)
0N/Avariable_help: variable_help_intro variable_list variable_help_end
0N/Avariable_help_intro:
0N/A @$(ECHO) "--- Common Variables ---"
0N/Avariable_help_end:
0N/A @$(ECHO) " "
0N/A
0N/A# One line descriptions for the variables
0N/AOUTPUTDIR.desc = Output directory
0N/APARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
0N/ASLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
0N/ABOOTDIR.desc = JDK used to boot the build
0N/ALANGTOOLS_DIST.desc = langtools dist area used to build
0N/ACORBA_DIST.desc = corba dist area
0N/AJAXP_DIST.desc = jaxp dist area
0N/AJAXWS_DIST.desc = jaxws dist area
0N/AJDK_IMPORT_PATH.desc = JDK used to import components of the build
0N/ACOMPILER_PATH.desc = Compiler install directory
0N/ACACERTS_FILE.desc = Location of certificates file
0N/ADEVTOOLS_PATH.desc = Directory containing zip and unzip
0N/ACUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
0N/ADXSDK_PATH.desc = Root directory of DirectX SDK
0N/A
0N/A# Make variables to print out (description and value)
0N/AVARIABLE_PRINTVAL_LIST += \
0N/A OUTPUTDIR \
0N/A PARALLEL_COMPILE_JOBS \
0N/A SLASH_JAVA \
0N/A BOOTDIR \
0N/A LANGTOOLS_DIST \
0N/A JAXWS_DIST \
0N/A CORBA_DIST \
0N/A JAXP_DIST \
0N/A JDK_IMPORT_PATH \
0N/A COMPILER_PATH \
0N/A CACERTS_FILE \
0N/A DEVTOOLS_PATH
0N/A
0N/A# Make variables that should refer to directories that exist
0N/AVARIABLE_CHECKDIR_LIST += \
0N/A SLASH_JAVA \
0N/A BOOTDIR \
0N/A JDK_IMPORT_PATH \
0N/A COMPILER_PATH \
0N/A DEVTOOLS_PATH
0N/A
0N/A# Make variables that should refer to files that exist
0N/AVARIABLE_CHECKFIL_LIST += \
0N/A CACERTS_FILE
0N/A
0N/A# Some are windows specific
0N/Aifeq ($(PLATFORM), windows)
0N/A
0N/AVARIABLE_PRINTVAL_LIST += \
3429N/A DXSDK_PATH
0N/A
0N/AVARIABLE_CHECKDIR_LIST += \
3429N/A DXSDK_PATH
0N/A
0N/Aendif
0N/A
0N/A# For pattern rules below, so all are treated the same
0N/ADO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
0N/ADO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
0N/ADO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
0N/A
0N/A# Complete variable check
0N/Avariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
0N/Avariable_list: $(DO_PRINTVAL_LIST) variable_check
0N/A
0N/A# Pattern rule for printing out a variable
0N/A%.printval:
0N/A @$(ECHO) " ALT_$* - $($*.desc)"
0N/A @$(ECHO) " \t $*=$($*)"
0N/A
0N/A# Pattern rule for checking to see if a variable with a directory exists
0N/A%.checkdir:
0N/A @if [ ! -d $($*) ] ; then \
0N/A $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
0N/A fi
0N/A
0N/A# Pattern rule for checking to see if a variable with a file exists
0N/A%.checkfil:
0N/A @if [ ! -f $($*) ] ; then \
0N/A $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
0N/A fi
0N/A
0N/A# Misc notes on help
0N/Anotes_help:
0N/A @$(ECHO) "\
0N/A--- Notes --- \n\
0N/A- All builds use same output directory unless overridden with \n\
0N/A \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
0N/A \t to use the clean target first. \n\
0N/A- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\
0N/A- CORBA_DIST must refer to a corba dist area. \n\
0N/A- JAXP_DIST must refer to a jaxp dist area. \n\
0N/A- JAXWS_DIST must refer to a jaxws dist area. \n\
0N/A- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
0N/A \t builds or previous release JDK builds will work. \n\
0N/A- The 'debug' target and 'import_debug' only works when a debug promoted \n\
0N/A \t build is available, and they currently are not. \n\
0N/A- The fastest builds have been when the workspace and the BOOTDIR are on \n\
0N/A \t local disk. \n\
0N/A"
0N/A
0N/Aexamples_help:
0N/A @$(ECHO) "\
0N/A--- Examples --- \n\
0N/A $(MAKE) fastdebug \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\
0N/A $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.6.0 \n\
0N/A $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\
0N/A"
0N/A
0N/A#
0N/A# 'all' target intro
0N/A#
0N/Aall::
0N/A @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
0N/A
0N/A# Just in case anyone uses this old name, same as 'build'
0N/Aoptimized: build
0N/A
0N/Aopenjdk:
0N/A $(MAKE) OPENJDK=true all
0N/A
0N/A#
0N/A# Special debug rules (You may also want to set ALT_OUTPUTDIR)
0N/A#
0N/Adebug:
0N/A $(MAKE) VARIANT=DBG all
0N/Afastdebug:
0N/A $(MAKE) VARIANT=DBG FASTDEBUG=true all
0N/A
0N/A#
0N/A# Rules to re-import VM and other JDK files
0N/A#
0N/Aimport:
0N/A $(CD) java/redist; $(MAKE) clean all
0N/A
0N/Aimport_fastdebug:
0N/A $(MAKE) VARIANT=DBG FASTDEBUG=true import
0N/A
0N/Aimport_product:
0N/A $(MAKE) VARIANT=OPT FASTDEBUG=false import
0N/A
0N/A#
0N/A# Core.
0N/A#
0N/A
0N/Aall build:: sanity-all post-sanity-all
0N/A
2157N/ASUBDIRS = tools java javax sun com
4632N/Aifeq ($(PLATFORM), macosx)
4632N/A SUBDIRS += apple
4632N/Aendif
5023N/Aifeq ($(PLATFORM), windows)
5023N/A SUBDIRS += bridge
5023N/Aendif
2157N/ASUBDIRS_tools = launchers
2157N/ASUBDIRS_misc = org sunw jpda mkdemo mksample
2157N/A
3045N/A# Alternate classes implementation
3045N/Aifndef OPENJDK
3045N/A SUBDIRS_misc += altclasses
3045N/Aendif
3045N/A
2157N/Ainclude $(BUILDDIR)/common/Subdirs.gmk
2157N/A
0N/Aall build::
0N/A $(SUBDIRS-loop)
0N/A
0N/Aclean clobber::
0N/A $(RM) -r $(OUTPUTDIR)
0N/A
0N/A#
0N/A# Docs
0N/A#
0N/AOTHERSUBDIRS = docs
0N/Adocs:: sanity-docs post-sanity-docs
0N/A $(OTHERSUBDIRS-loop)
0N/A
0N/A#
0N/A# Release engineering targets.
0N/A#
0N/Ainclude $(BUILDDIR)/common/Release.gmk
0N/A
0N/A#
0N/A# Cscope targets.
0N/A#
0N/Ainclude $(BUILDDIR)/common/Cscope.gmk
0N/A
0N/A#
0N/A# Sanity checks.
0N/A#
0N/Ainclude $(BUILDDIR)/common/Sanity.gmk
0N/A
0N/A$(OUTPUTDIR) $(TEMPDIR):
0N/A $(MKDIR) -p $@
0N/A
0N/A# this should be the last rule in this file:
0N/Aall::
0N/A @if [ -r $(WARNING_FILE) ]; then \
0N/A $(CAT) $(WARNING_FILE) ; \
0N/A fi
0N/A @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M')
0N/A
0N/A#
0N/A# Developer rule that links 32 and 64 bit builds on Solaris by creating
0N/A# softlinks in the 32bit outputdir to the 64bit outputdir.
0N/A#
0N/Aifeq ($(PLATFORM), solaris)
0N/A ifeq ($(ARCH_FAMILY), sparc)
0N/A ARCH32 = sparc
0N/A ARCH64 = sparcv9
0N/A else
0N/A ARCH32 = i586
0N/A ARCH64 = amd64
0N/A endif
0N/A OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32)
0N/A OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64)
0N/Aendif
0N/A
0N/Acreate_links:
0N/Aifeq ($(PLATFORM), solaris)
0N/A @if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \
0N/A dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \
0N/A for sd in $$dirlist ; do \
0N/A pdir=`$(DIRNAME) $$sd`; \
0N/A if [ -d $(OUTPUTDIR32)/$$pdir ] ; then \
0N/A echo "Creating link for $$sd"; \
0N/A (cd $(OUTPUTDIR32)/$$pdir; $(RM) $(ARCH64); \
0N/A $(LN) -s $(OUTPUTDIR64)/$$sd ); \
0N/A fi; \
0N/A done; \
0N/A else \
0N/A $(ECHO) "Build both 32 and 64 bit versions first"; \
0N/A fi
0N/Aelse
0N/A $(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)"
0N/Aendif
0N/A
0N/A#
2812N/A# Test rule
0N/A#
2812N/A
2812N/A.NOTPARALLEL: test_run
2812N/A
2812N/Atest:
2812N/A $(MAKE) test_run
2812N/A
2812N/Atest_run: test_clean test_start test_summary
2812N/A
2812N/Atest_start:
2812N/A @$(ECHO) "Tests started at `$(DATE)`"
2812N/A
2812N/Atest_clean:
2812N/A $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
0N/A
2812N/Atest_summary: $(OUTPUTDIR)/test_failures.txt
2812N/A @$(ECHO) "#################################################"
2812N/A @$(ECHO) "Tests completed at `$(DATE)`"
2812N/A @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
2812N/A || $(ECHO) "No TEST STATS seen in log" )
2812N/A @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
2812N/A @$(ECHO) "#################################################"
2812N/A @if [ -s $< ] ; then \
2812N/A $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
2812N/A $(CAT) $<; \
2812N/A exit 1; \
2812N/A else \
2812N/A $(ECHO) "Success! No failures detected"; \
2812N/A fi
2812N/A
2812N/A# Get failure list from log
2812N/A$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
2812N/A @$(RM) $@
2812N/A @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
2812N/A
2812N/A# Get log file of all tests run
2812N/AJDK_TO_TEST := $(shell \
2812N/A if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
2812N/A $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
2812N/A elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
2812N/A $(ECHO) "$(ABS_OUTPUTDIR)"; \
2812N/A elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
2812N/A $(ECHO) "$(PRODUCT_HOME)"; \
2812N/A fi \
2812N/A)
2812N/A
2812N/ATEST_TARGETS=jdk_all
2812N/A$(OUTPUTDIR)/test_log.txt:
2812N/A $(RM) $@
2812N/A ( $(CD) ../test && \
2812N/A $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
2812N/A ) | tee $@
2812N/A
2812N/A#
0N/A# JPRT rules
2812N/A#
2812N/A
0N/Ainclude jprt.gmk
0N/A
0N/A#
0N/A# Phonies to avoid accidents.
0N/A#
0N/A.PHONY: all build clean clobber optimized debug fastdebug create_links \
2812N/A import import_product import_fastdebug import_debug \
2812N/A test test_run test_start test_clean test_summary
0N/A