Makefile revision 2027
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This code is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# under the terms of the GNU General Public License version 2 only, as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# published by the Free Software Foundation. Sun designates this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# particular file as subject to the "Classpath" exception as provided
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# by Sun in the LICENSE file that accompanied this code.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# version 2 for more details (a copy is included in the LICENSE file that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# accompanied this code).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You should have received a copy of the GNU General Public License version
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2 along with this work; if not, write to the Free Software Foundation,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CA 95054 USA or visit www.sun.com if you need additional information or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# have any questions.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Makefile for building and packaging all of the JDK and the JRE. See
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# also included files.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Make sure we are clear what the default target is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Check target
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunthelp: intro_help target_help variable_help notes_help examples_help
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Intro help message
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntMakefile for the main JDK workspace. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntDefault behavior is to use the BOOTDIR javac to bootstrap the build and \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntimport in pre-built components like the VM from the JDK_IMPORT_PATH. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Target help
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein--- Common Targets --- \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userall -- build the core JDK (default target) \n\
f9ce6280cec79deb16ff6d9807aa493ff23e10d9Tinderbox Userhelp -- Print out help information \n\
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox Usercheck -- Check make variable values for correctness \n\
f9ce6280cec79deb16ff6d9807aa493ff23e10d9Tinderbox Usersanity -- Perform detailed sanity checks on system and settings \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntopenjdk -- synonym for 'OPENJDK=true all' \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntfastdebug -- build the core JDK in 'fastdebug' mode (-g -O) \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userdebug -- build the core JDK in 'debug' mode (-g) \n\
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox Userclean -- remove all built and imported files \n\
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox Userclobber -- same as clean \n\
e285c11870c6263cd79b418e104c7eb3e2d96952Tinderbox Userdocs -- run javadoc to generate the JDK documentation \n\
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox Userimages -- build the jdk and jre image directories \n\
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox Userimport -- copy in the pre-built components (e.g. VM) \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntimport_product -- copy in the product components \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userimport_fastdebug -- copy in the fastdebug components \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userimport_debug -- copy in the debug components \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntmodules -- build the jdk and jre module images (experimental) \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntsccs_get -- make sure all SCCS files are up-to-date (need SCCS) \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usercreate_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Variable help (only common ones used by this workspace)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntvariable_help: variable_help_intro variable_list variable_help_end
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User# One line descriptions for the variables
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserLANGTOOLS_DIST.desc = langtools dist area used to build
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserJDK_IMPORT_PATH.desc = JDK used to import components of the build
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserCOMPILER_PATH.desc = Compiler install directory
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserCACERTS_FILE.desc = Location of certificates file
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserDEVTOOLS_PATH.desc = Directory containing zip and unzip
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox UserDXSDK_PATH.desc = Root directory of DirectX SDK
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox UserMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox User# Make variables to print out (description and value)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Make variables that should refer to directories that exist
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User# Make variables that should refer to files that exist
1ffe3f29e3cd0d8355500e9fd34de918ad9b4a01Tinderbox User# Some are windows specific
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User# For pattern rules below, so all are treated the same
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox UserDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox UserDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox UserDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
1ffe3f29e3cd0d8355500e9fd34de918ad9b4a01Tinderbox User# Complete variable check
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox Uservariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox Uservariable_list: $(DO_PRINTVAL_LIST) variable_check
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User# Pattern rule for printing out a variable
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Pattern rule for checking to see if a variable with a directory exists
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @if [ ! -d $($*) ] ; then \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Pattern rule for checking to see if a variable with a file exists
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @if [ ! -f $($*) ] ; then \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Misc notes on help
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User--- Notes --- \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- All builds use same output directory unless overridden with \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt \t to use the clean target first. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- CORBA_DIST must refer to a corba dist area. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- JAXP_DIST must refer to a jaxp dist area. \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User- JAXWS_DIST must refer to a jaxws dist area. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User \t builds or previous release JDK builds will work. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- The 'debug' target and 'import_debug' only works when a debug promoted \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt \t build is available, and they currently are not. \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- The fastest builds have been when the workspace and the BOOTDIR are on \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt \t local disk. \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User--- Examples --- \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# 'all' target intro
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Just in case anyone uses this old name, same as 'build'
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Special debug rules (You may also want to set ALT_OUTPUTDIR)
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User# Rules to re-import VM and other JDK files
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntSUBDIRS = tools java javax org sun sunw com jpda mkdemo mksample launchers
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User# Release engineering targets.
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# Cscope targets.
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# Sanity checks.
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# cleanup everything. If the workspace is not being built by the control
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# workspace, and if it is a Teamware workspace, then see if there are
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# any files which are not under SCCS control.
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User $(ECHO) '\nPerforming workspace scan for remnant files.\n' \
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User ' Any files listed below are not under SCCS control in the workspace\n' \
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User ' and you should review them and possibly remove them manually:' ; \
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User $(FIND) $(TOPDIR)/make $(TOPDIR)/src -type f | \
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User $(SED) 's+SCCS/[ps]\.++' | $(SORT) | $(UNIQ) -c | $(NAWK) '$$1<2 {print $$2;}' ; \
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User# this should be the last rule in this file:
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User @if [ -r $(WARNING_FILE) ]; then \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M')
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Developer rule that links 32 and 64 bit builds on Solaris by creating
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# softlinks in the 32bit outputdir to the 64bit outputdir.
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox User OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32)
e2b184f84e846bbcb764b6f0aef5dcd583d3d7a1Tinderbox User OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt @if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt echo "Creating link for $$sd"; \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(ECHO) "Build both 32 and 64 bit versions first"; \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Binary Plug rules and macros
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntinclude $(BUILDDIR)/common/internal/BinaryPlugs.gmk
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Get top level sccs_get rule
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Phonies to avoid accidents.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt.PHONY: all build clean clobber optimized debug fastdebug create_links \