Makefile revision 3909
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
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. Oracle designates this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# particular file as subject to the "Classpath" exception as provided
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Oracle in the LICENSE file that accompanied this code.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
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).
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# You should have received a copy of the GNU General Public License version
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# 2 along with this work; if not, write to the Free Software Foundation,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# or visit www.oracle.com if you need additional information or have any
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# questions.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Makefile for building and packaging all of the JDK and the JRE. See
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# also included files.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweBUILDDIR=.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Defs.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make sure we are clear what the default target is
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedefault_target: all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Check target
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowecheck: variable_check
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Help target
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowehelp: intro_help target_help variable_help notes_help examples_help
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Intro help message
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweintro_help:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweMakefile for the main JDK workspace. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDefault behavior is to use the BOOTDIR javac to bootstrap the build and \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport in pre-built components like the VM from the JDK_IMPORT_PATH. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Target help
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetarget_help:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe--- Common Targets --- \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall -- 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\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweopenjdk -- 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\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweclobber -- 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\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport_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 Lowecreate_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Variable help (only common ones used by this workspace)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_help: variable_help_intro variable_list variable_help_end
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_help_intro:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "--- Common Variables ---"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_help_end:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) " "
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# One line descriptions for the variables
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweOUTPUTDIR.desc = Output directory
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 LoweBOOTDIR.desc = JDK used to boot the build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLANGTOOLS_DIST.desc = langtools dist area used to build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCORBA_DIST.desc = corba dist area
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweJAXP_DIST.desc = jaxp dist area
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweJAXWS_DIST.desc = jaxws dist area
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweJDK_IMPORT_PATH.desc = JDK used to import components of the build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCOMPILER_PATH.desc = Compiler install directory
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 LoweDXSDK_PATH.desc = Root directory of DirectX SDK
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables to print out (description and value)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIABLE_PRINTVAL_LIST += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OUTPUTDIR \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe PARALLEL_COMPILE_JOBS \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe SLASH_JAVA \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe BOOTDIR \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LANGTOOLS_DIST \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe JAXWS_DIST \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CORBA_DIST \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe JAXP_DIST \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe JDK_IMPORT_PATH \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_PATH \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CACERTS_FILE \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DEVTOOLS_PATH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables that should refer to directories that exist
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIABLE_CHECKDIR_LIST += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe SLASH_JAVA \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe BOOTDIR \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe JDK_IMPORT_PATH \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe COMPILER_PATH \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DEVTOOLS_PATH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make variables that should refer to files that exist
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIABLE_CHECKFIL_LIST += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CACERTS_FILE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Some are windows specific
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIABLE_PRINTVAL_LIST += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DXSDK_PATH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVARIABLE_CHECKDIR_LIST += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe DXSDK_PATH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# For pattern rules below, so all are treated the same
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Complete variable check
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevariable_list: $(DO_PRINTVAL_LIST) variable_check
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Pattern rule for printing out a variable
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe%.printval:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) " ALT_$* - $($*.desc)"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) " \t $*=$($*)"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Pattern rule for checking to see if a variable with a directory exists
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe%.checkdir:
296749875bd503e7a14e25b4c57d3142cb496df1Joshua M. Clulow @if [ ! -d $($*) ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Pattern rule for checking to see if a variable with a file exists
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe%.checkfil:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @if [ ! -f $($*) ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Misc notes on help
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowenotes_help:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe--- Notes --- \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- All builds use same output directory unless overridden with \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe \t to use the clean target first. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- LANGTOOLS_DIST must refer to a langtools dist area, used to build. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- CORBA_DIST must refer to a corba dist area. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- JAXP_DIST must refer to a jaxp dist area. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- JAXWS_DIST must refer to a jaxws dist area. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe \t builds or previous release JDK builds will work. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- The 'debug' target and 'import_debug' only works when a debug promoted \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe \t build is available, and they currently are not. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe- The fastest builds have been when the workspace and the BOOTDIR are on \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe \t local disk. \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweexamples_help:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe--- Examples --- \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) fastdebug \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug images \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all docs images \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.6.0 \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.7.0 \n\
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# 'all' target intro
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall::
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Just in case anyone uses this old name, same as 'build'
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweoptimized: build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweopenjdk:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) OPENJDK=true all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Special debug rules (You may also want to set ALT_OUTPUTDIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedebug:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) VARIANT=DBG all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowefastdebug:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) VARIANT=DBG FASTDEBUG=true all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Rules to re-import VM and other JDK files
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CD) java/redist; $(MAKE) clean all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport_fastdebug:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) VARIANT=DBG FASTDEBUG=true import
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweimport_product:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) VARIANT=OPT FASTDEBUG=false import
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Core.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall build:: sanity-all post-sanity-all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweSUBDIRS = tools java javax sun com
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweSUBDIRS_tools = launchers
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweSUBDIRS_misc = org sunw jpda mkdemo mksample
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Alternate classes implementation
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifndef OPENJDK
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe SUBDIRS_misc += altclasses
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Subdirs.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall build::
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(SUBDIRS-loop)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweclean clobber::
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(RM) -r $(OUTPUTDIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Docs
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweOTHERSUBDIRS = docs
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedocs:: sanity-docs post-sanity-docs
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(OTHERSUBDIRS-loop)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Release engineering targets.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Release.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Cscope targets.
462453d2d0c563559a4caf186db76954e563bd1aMatthew Ahrens#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Cscope.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Sanity checks.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Sanity.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(OUTPUTDIR) $(TEMPDIR):
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MKDIR) -p $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# this should be the last rule in this file:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall::
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @if [ -r $(WARNING_FILE) ]; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CAT) $(WARNING_FILE) ; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build finished: $(shell $(DATE) '+%y-%m-%d %H:%M')
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Developer rule that links 32 and 64 bit builds on Solaris by creating
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# softlinks in the 32bit outputdir to the 64bit outputdir.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), solaris)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(ARCH_FAMILY), sparc)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ARCH32 = sparc
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ARCH64 = sparcv9
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe else
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ARCH32 = i586
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ARCH64 = amd64
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OUTPUTDIR32 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH32)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OUTPUTDIR64 = $(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH64)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowecreate_links:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), solaris)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @if [ -d $(OUTPUTDIR32) -a -d $(OUTPUTDIR64) ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe dirlist=`($(CD) $(OUTPUTDIR64); $(FIND) . -name $(ARCH64))`; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe for sd in $$dirlist ; do \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe pdir=`$(DIRNAME) $$sd`; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe if [ -d $(OUTPUTDIR32)/$$pdir ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe echo "Creating link for $$sd"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe (cd $(OUTPUTDIR32)/$$pdir; $(RM) $(ARCH64); \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(LN) -s $(OUTPUTDIR64)/$$sd ); \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe done; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe else \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "Build both 32 and 64 bit versions first"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "Rule $@ does not apply on $(PLATFORM)-$(ARCH)"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Test rule
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe.NOTPARALLEL: test_run
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetest:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) test_run
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetest_run: test_clean test_start test_summary
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetest_start:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "Tests started at `$(DATE)`"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetest_clean:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowetest_summary: $(OUTPUTDIR)/test_failures.txt
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "#################################################"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "Tests completed at `$(DATE)`"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe || $(ECHO) "No TEST STATS seen in log" )
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(ECHO) "#################################################"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @if [ -s $< ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CAT) $<; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe exit 1; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe else \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "Success! No failures detected"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Get failure list from log
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @$(RM) $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Get log file of all tests run
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweJDK_TO_TEST := $(shell \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "$(ABS_OUTPUTDIR)"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "$(PRODUCT_HOME)"; \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe fi \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweTEST_TARGETS=jdk_all
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(OUTPUTDIR)/test_log.txt:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(RM) $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ( $(CD) ../test && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ) | tee $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# JPRT rules
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude jprt.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Phonies to avoid accidents.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe.PHONY: all build clean clobber optimized debug fastdebug create_links \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe import import_product import_fastdebug import_debug \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe test test_run test_start test_clean test_summary
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe