Makefile revision 241
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
1252N/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)
1252N/A
235N/Aifeq ($(SYSTEM_UNAME), Windows_NT)
911N/ADEV_NULL = NUL
1252N/Aelse
1252N/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))
1124N/Aendef
1124N/Aelse
1124N/Adefine FullPath
235N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
1252N/Aendef
235N/Aendif
235N/A
235N/A#
1276N/A# Makefile args
1276N/A#
1276N/A
1276N/Aifdef QUIET
1276N/A ANT_OPTIONS += -quiet
1276N/Aendif
1276N/A
1276N/Aifdef VERBOSE
1276N/A ANT_OPTIONS += -verbose -diagnostics
1276N/Aendif
1276N/A
1276N/Aifdef JDK_VERSION
235N/A ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
1124N/Aendif
1124N/A
1124N/Aifdef FULL_VERSION
970N/A ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
970N/Aendif
970N/A
970N/Aifdef MILESTONE
970N/Aifneq ($(MILESTONE),fcs)
970N/A ANT_OPTIONS += -Dmilestone=$(MILESTONE)
970N/Aelse
947N/A ANT_OPTIONS += -Drelease=$(JDK_VERSION)
235N/Aendif
247N/Aendif
947N/A
235N/Aifdef BUILD_NUMBER
247N/A ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
947N/Aelse
947N/A ifdef JDK_BUILD_NUMBER
970N/A ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
970N/A endif
947N/Aendif
947N/A
947N/Aifeq ($(VARIANT), DBG)
947N/A ANT_OPTIONS += -Djavac.debug=true
947N/Aelse
947N/A ifeq ($(VARIANT), OPT)
235N/A ANT_OPTIONS += -Djavac.debug=false
241N/A endif
493N/Aendif
493N/A
235N/A# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
1270N/A# and the somewhat misnamed CLASS_VERSION (-target NN)
1270N/Aifdef TARGET_CLASS_VERSION
1270N/A ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
1270N/Aelse
493N/A ifdef JAVAC_TARGET_ARG
493N/A ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
1124N/A endif
963N/Aendif
1124N/A
1124N/Aifdef ALT_BOOTDIR
1097N/A ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
493N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
1097N/Aendif
1097N/A
493N/Aifdef ALT_OUTPUTDIR
235N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
1124N/A ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
1124N/A ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
1124N/Aelse
1124N/A OUTPUTDIR = ..
1124N/Aendif
1124N/A#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
1124N/AABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
1124N/A
1124N/AANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
1124N/AANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
970N/A
970N/Aifdef FINDBUGS_HOME
970N/A ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
1097N/Aendif
1097N/A
1097N/Aifdef ANT_HOME
1030N/A ANT = $(ANT_HOME)/bin/ant
822N/A ifneq ($(shell test -x $(ANT) && echo OK), OK)
235N/A $(error $(ANT) not found -- please update ANT_HOME)
235N/A endif
822N/Aelse
822N/A ANT = ant
963N/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)
935N/A endif
935N/Aendif
935N/A
935N/A# Default target and expected 'do everything' target
935N/Aall: build
1088N/A
235N/A# Standard make clobber target
935N/Aclobber: clean
963N/A
963N/A# All ant targets of interest
935N/AANT_TARGETS = build clean sanity post-sanity diagnostics # for now
963N/A
963N/A# Create a make target for each
963N/A$(ANT_TARGETS):
963N/A @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
235N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log
963N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
235N/A
935N/A#-------------------------------------------------------------------
935N/A#
963N/A# Targets for Sun's internal JPRT build system
963N/A
935N/ACD = cd
963N/AZIP = zip
963N/A
963N/AJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
235N/A
493N/Ajprt_build_product jprt_build_debug jprt_build_fastdebug: all
1252N/A ( $(CD) $(OUTPUTDIR) && \
1252N/A $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
1252N/A
1252N/A#-------------------------------------------------------------------
1252N/A
1252N/A# Declare these phony (not filenames)
1252N/A.PHONY: $(ANT_TARGETS) all clobber \
1252N/A jprt_build_product jprt_build_debug jprt_build_fastdebug
1252N/A