Makefile revision 604
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is free software; you can redistribute it and/or modify it
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# under the terms of the GNU General Public License version 2 only, as
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# published by the Free Software Foundation. Sun designates this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# particular file as subject to the "Classpath" exception as provided
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Sun in the LICENSE file that accompanied this code.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is distributed in the hope that it will be useful, but WITHOUT
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# version 2 for more details (a copy is included in the LICENSE file that
5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4eTheo Schlossnagle# accompanied this code).
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You should have received a copy of the GNU General Public License version
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# 2 along with this work; if not, write to the Free Software Foundation,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# CA 95054 USA or visit www.sun.com if you need additional information or
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# have any questions.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Makefile for building and packaging all of the JDK and the JRE. See
b9476f453004695da12eaaff383ed9005e7a47c4Joshua M. Clulow# also included files.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make sure we are clear what the default target is
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Check target
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Help target
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowehelp: intro_help target_help variable_help notes_help examples_help
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Intro help message
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweMakefile for the main JDK workspace. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDefault behavior is to use the BOOTDIR javac to bootstrap the build and \n\
177d5b5f8c0e969013441207a0a705ae66b08cf7Robert Mustacchiimport in pre-built components like the VM from the JDK_IMPORT_PATH. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Target help
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov--- Common Targets --- \n\
5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4eTheo Schlossnagleall -- build the core JDK (default target) \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowehelp -- Print out help information \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowecheck -- Check make variable values for correctness \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowesanity -- Perform detailed sanity checks on system and settings \n\
ff3aea39f71c371be25b08deb9efed41f1c95983Robert Mustacchiopenjdk -- synonym for 'OPENJDK=true all' \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowefastdebug -- build the core JDK in 'fastdebug' mode (-g -O) \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedebug -- build the core JDK in 'debug' mode (-g) \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweclean -- remove all built and imported files \n\
ff3aea39f71c371be25b08deb9efed41f1c95983Robert Mustacchiclobber -- same as clean \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedocs -- run javadoc to generate the JDK documentation \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimages -- build the jdk and jre image directories \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport -- copy in the pre-built components (e.g. VM) \n\
b9476f453004695da12eaaff383ed9005e7a47c4Joshua M. Clulowimport_product -- copy in the product components \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport_fastdebug -- copy in the fastdebug components \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport_debug -- copy in the debug components \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowesccs_get -- make sure all SCCS files are up-to-date (need SCCS) \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowecreate_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Variable help (only common ones used by this workspace)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_help: variable_help_intro variable_list variable_help_end
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# One line descriptions for the variables
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLANGTOOLS_DIST.desc = langtools dist area used to build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweJDK_IMPORT_PATH.desc = JDK used to import components of the build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCACERTS_FILE.desc = Location of certificates file
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDEVTOOLS_PATH.desc = Directory containing zip and unzip
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables to print out (description and value)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables that should refer to directories that exist
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables that should refer to files that exist
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Some are windows specific
177d5b5f8c0e969013441207a0a705ae66b08cf7Robert Mustacchi# For pattern rules below, so all are treated the same
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Complete variable check
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankovvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankovvariable_list: $(DO_PRINTVAL_LIST) variable_check
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Pattern rule for printing out a variable
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Pattern rule for checking to see if a variable with a directory exists
ff3aea39f71c371be25b08deb9efed41f1c95983Robert Mustacchi @if [ ! -d $($*) ] ; then \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Pattern rule for checking to see if a variable with a file exists
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov @if [ ! -f $($*) ] ; then \
b9476f453004695da12eaaff383ed9005e7a47c4Joshua M. Clulow $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Misc notes on help
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov--- Notes --- \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- All builds use same output directory unless overridden with \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov \t to use the clean target first. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- CORBA_DIST must refer to a corba dist area. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- JAXP_DIST must refer to a jaxp dist area. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- JAXWS_DIST must refer to a jaxws dist area. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov \t builds or previous release JDK builds will work. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- The 'debug' target and 'import_debug' only works when a debug promoted \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov \t build is available, and they currently are not. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov- The fastest builds have been when the workspace and the BOOTDIR are on \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov \t local disk. \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov--- Examples --- \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# 'all' target intro
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Just in case anyone uses this old name, same as 'build'
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Special debug rules (You may also want to set ALT_OUTPUTDIR)
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Rules to re-import VM and other JDK files
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri PankovSUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
177d5b5f8c0e969013441207a0a705ae66b08cf7Robert Mustacchi# Release engineering targets.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Cscope targets.
$(MKDIR) -p $@
all::
@if [ -r $(WARNING_FILE) ]; then \
echo "Creating link for $$sd"; \