Makefile revision 315
235N/A#
235N/A# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
822N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
822N/A#
822N/A# This code is free software; you can redistribute it and/or modify it
235N/A# under the terms of the GNU General Public License version 2 only, as
1088N/A# published by the Free Software Foundation. Sun designates this
235N/A# particular file as subject to the "Classpath" exception as provided
235N/A# by Sun in the LICENSE file that accompanied this code.
919N/A#
919N/A# This code is distributed in the hope that it will be useful, but WITHOUT
919N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
919N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
919N/A# version 2 for more details (a copy is included in the LICENSE file that
919N/A# accompanied this code).
919N/A#
919N/A# You should have received a copy of the GNU General Public License version
919N/A# 2 along with this work; if not, write to the Free Software Foundation,
919N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
919N/A#
919N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
919N/A# CA 95054 USA or visit www.sun.com if you need additional information or
919N/A# have any questions.
919N/A#
919N/A
919N/A# Makefile for langtools: wrapper around Ant build.xml file
235N/A
235N/A#
235N/A# On Solaris, the 'make' utility from Sun will not work with these makefiles.
822N/A# This little rule is only understood by Sun's make, and is harmless
235N/A# when seen by the GNU make tool. If using Sun's make, this causes the
970N/A# make command to fail.
970N/A#
970N/ASUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
970N/A
970N/A#
970N/A# Minimal platform defs
970N/A# Need FullPath because we can't rely on gnumake abspath, until we use v3.81
1003N/A#
970N/A
235N/ASYSTEM_UNAME := $(shell uname)
981N/A
235N/Aifeq ($(SYSTEM_UNAME), Windows_NT)
911N/ADEV_NULL = NUL
981N/Aelse
981N/Aifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
911N/ADEV_NULL = NUL
235N/AUSING_CYGWIN = true
493N/Aelse
493N/ADEV_NULL = /dev/null
235N/Aendif
235N/Aendif
235N/A
235N/Aifdef USING_CYGWIN
822N/Adefine FullPath
235N/A$(shell cygpath -a -s -m $1 2> $(DEV_NULL))
235N/Aendef
1042N/Aelse
235N/Adefine FullPath
235N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
235N/Aendef
235N/Aendif
235N/A
851N/A#
851N/A# Makefile args
981N/A#
981N/A
1088N/Aifdef QUIET
1088N/A ANT_OPTIONS += -quiet
1088N/Aendif
1088N/A
1088N/Aifdef VERBOSE
822N/A ANT_OPTIONS += -verbose -diagnostics
822N/Aendif
981N/A
235N/Aifdef JDK_VERSION
970N/A ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
970N/Aendif
970N/A
970N/Aifdef FULL_VERSION
970N/A ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
970N/Aendif
970N/A
947N/Aifdef MILESTONE
235N/Aifneq ($(MILESTONE),fcs)
247N/A ANT_OPTIONS += -Dmilestone=$(MILESTONE)
947N/Aelse
235N/A ANT_OPTIONS += -Drelease=$(JDK_VERSION)
247N/Aendif
947N/Aendif
947N/A
970N/Aifdef BUILD_NUMBER
970N/A ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
947N/Aelse
947N/A ifdef JDK_BUILD_NUMBER
947N/A ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
947N/A endif
947N/Aendif
947N/A
235N/Aifeq ($(VARIANT), DBG)
241N/A ANT_OPTIONS += -Djavac.debug=true
493N/Aelse
493N/A ifeq ($(VARIANT), OPT)
235N/A ANT_OPTIONS += -Djavac.debug=false
493N/A endif
493N/Aendif
963N/A
963N/A# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
493N/A# and the somewhat misnamed CLASS_VERSION (-target NN)
493N/Aifdef TARGET_CLASS_VERSION
1097N/A ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
493N/Aelse
1097N/A ifdef JAVAC_TARGET_ARG
1097N/A ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
493N/A endif
235N/Aendif
970N/A
970N/Aifdef ALT_BOOTDIR
970N/A ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
1097N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
1097N/Aendif
1097N/A
1030N/Aifdef ALT_OUTPUTDIR
822N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
235N/A ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
235N/A ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
822N/Aelse
822N/A OUTPUTDIR = ..
963N/Aendif
963N/A#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
935N/AABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
935N/A
935N/AANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
935N/AANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
935N/A
1088N/Aifdef FINDBUGS_HOME
235N/A ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
935N/Aendif
963N/A
963N/Aifdef ANT_HOME
935N/A ANT = $(ANT_HOME)/bin/ant
963N/A ifneq ($(shell test -x $(ANT) && echo OK), OK)
935N/A $(error $(ANT) not found -- please update ANT_HOME)
963N/A endif
963N/Aelse
963N/A ANT = ant
235N/A ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
963N/A $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
235N/A endif
935N/Aendif
935N/A
963N/A# Default target and expected 'do everything' target
963N/Aall: build
935N/A
963N/A# Standard make clobber target
963N/Aclobber: clean
963N/A
235N/A# All ant targets of interest
493N/AANT_TARGETS = build clean sanity post-sanity diagnostics # for now
493N/A
493N/A# Create a make target for each
851N/A$(ANT_TARGETS):
235N/A @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
493N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log
493N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
822N/A
606N/A#-------------------------------------------------------------------
822N/A#
822N/A# Targets for Sun's internal JPRT build system
822N/A
235N/ACD = cd
493N/AZIP = zip
822N/A
241N/AJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
235N/A
493N/Ajprt_build_product jprt_build_debug jprt_build_fastdebug: all
235N/A ( $(CD) $(OUTPUTDIR) && \
493N/A $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
235N/A
235N/A#-------------------------------------------------------------------
965N/A
965N/A# Declare these phony (not filenames)
965N/A.PHONY: $(ANT_TARGETS) all clobber \
965N/A jprt_build_product jprt_build_debug jprt_build_fastdebug
235N/A