Makefile revision 618
0N/A#
328N/A# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
180N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
180N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
180N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
180N/A# or visit www.oracle.com if you need additional information or have any
180N/A# questions.
0N/A#
0N/A
5N/A# Makefile for langtools: wrapper around Ant build.xml file
5N/A
338N/A#
338N/A# On Solaris, the standard 'make' utility will not work with these makefiles.
338N/A# This little rule is only understood by Solaris make, and is harmless
338N/A# when seen by the GNU make tool. If using Solaris make, this causes the
338N/A# make command to fail.
338N/A#
338N/ASUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
338N/A
338N/A#
338N/A# Minimal platform defs
338N/A# Need FullPath because we can't rely on gnumake abspath, until we use v3.81
338N/A#
338N/A
338N/ASYSTEM_UNAME := $(shell uname)
338N/A
338N/A# Where is unwanted output to be delivered?
338N/A# On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file.
338N/Aifeq ($(SYSTEM_UNAME), Windows_NT)
338N/ADEV_NULL = NUL
338N/Aelse
338N/ADEV_NULL = /dev/null
338N/Aendif
338N/A
338N/Aifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
338N/AUSING_CYGWIN = true
338N/Aendif
338N/A
338N/Aifdef USING_CYGWIN
0N/Adefine FullPath
8N/A$(shell cygpath -a -s -m $1 2> $(DEV_NULL))
0N/Aendef
0N/Aelse
0N/Adefine FullPath
0N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
0N/Aendef
0N/Aendif
0N/A
0N/A#
0N/A# Makefile args
27N/A#
0N/A
27N/Aifdef QUIET
27N/A ANT_OPTIONS += -quiet
27N/Aendif
0N/A
0N/Aifdef VERBOSE
0N/A ANT_OPTIONS += -verbose -debug
0N/Aendif
0N/A
0N/Aifdef JDK_VERSION
0N/A ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
0N/Aendif
0N/A
0N/Aifdef FULL_VERSION
286N/A ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
27N/Aendif
27N/A
27N/Aifdef MILESTONE
27N/Aifneq ($(MILESTONE),fcs)
27N/A ANT_OPTIONS += -Dmilestone=$(MILESTONE)
27N/Aelse
27N/A ANT_OPTIONS += -Drelease=$(JDK_VERSION)
27N/Aendif
27N/Aendif
32N/A
32N/Aifdef BUILD_NUMBER
315N/A ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
315N/Aelse
311N/A ifdef JDK_BUILD_NUMBER
311N/A ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
27N/A endif
27N/Aendif
27N/A
27N/Aifeq ($(VARIANT), DBG)
27N/A ANT_OPTIONS += -Djavac.debug=true
27N/Aelse
27N/A ifeq ($(VARIANT), OPT)
311N/A ANT_OPTIONS += -Djavac.debug=false
27N/A endif
27N/Aendif
27N/A
27N/Aifeq ($(DEBUG_CLASSFILES), true)
311N/A ANT_OPTIONS += -Djavac.debug=true
27N/A ANT_OPTIONS += -Ddebug.classfiles=true
27N/Aendif
27N/A
27N/A# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
27N/A# and the somewhat misnamed CLASS_VERSION (-target NN)
27N/Aifdef TARGET_CLASS_VERSION
311N/A ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
311N/Aelse
311N/A ifdef JAVAC_TARGET_ARG
311N/A ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
311N/A endif
311N/Aendif
311N/A
311N/Aifdef SOURCE_LANGUAGE_VERSION
311N/A ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
27N/Aelse
189N/A ifdef JAVAC_SOURCE_ARG
332N/A ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
338N/A endif
311N/Aendif
27N/A
27N/Aifdef ALT_BOOTDIR
27N/A ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
27N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
27N/Aendif
27N/A
27N/A# To facilitate bootstrapping, much of langtools can be compiled with (just)
27N/A# a boot JDK. However, some source files need to be compiled against
27N/A# new JDK API. In a bootstrap build, an import JDK may not be available,
27N/A# so build.xml can also build against the source files in a jdk repo,
27N/A# in which case it will automatically generate stub files for the new JDK API.
27N/Aifdef JDK_TOPDIR
27N/A ANT_OPTIONS += -Dimport.jdk=$(JDK_TOPDIR)
27N/Aelse
27N/A ifdef ALT_JDK_TOPDIR
27N/A ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_TOPDIR)
27N/A else
27N/A ifdef ALT_JDK_IMPORT_PATH
27N/A ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_IMPORT_PATH)
27N/A endif
27N/A endif
27N/Aendif
27N/A
27N/Aifdef ALT_OUTPUTDIR
27N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
27N/A ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
27N/A ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
27N/Aelse
27N/A OUTPUTDIR = ..
27N/Aendif
27N/A#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
27N/AABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
27N/A
27N/AANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
27N/AANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
27N/A
311N/Aifdef FINDBUGS_HOME
311N/A ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
311N/Aendif
27N/A
27N/Aifdef ANT_HOME
27N/A ANT = $(ANT_HOME)/bin/ant
27N/A ifneq ($(shell test -x $(ANT) && echo OK), OK)
27N/A $(error $(ANT) not found -- please update ANT_HOME)
27N/A endif
338N/Aelse
338N/A ANT = ant
27N/A ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
27N/A $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
27N/A endif
27N/Aendif
27N/A
189N/A# Default target and expected 'do everything' target
189N/Aall: build
189N/A
189N/A# Standard make clobber target
27N/Aclobber: clean
27N/A
27N/A# All ant targets of interest
338N/AANT_TARGETS = build clean sanity post-sanity diagnostics # for now
338N/A
27N/A# Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1)
27N/A$(OUTPUTDIR)/build/ant-diagnostics.log:
27N/A @mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
142N/A @$(RM) $@
27N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $@ ; \
27N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -version >> $@
27N/A
27N/A# Create a make target for each
27N/A$(ANT_TARGETS): $(OUTPUTDIR)/build/ant-diagnostics.log
142N/A @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
27N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
27N/A
27N/A#-------------------------------------------------------------------
27N/A#
27N/A# Targets for Oracle's internal JPRT build system
142N/A
27N/ACD = cd
27N/AZIP = zip
27N/A
27N/AJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
27N/A
27N/Ajprt_build_product jprt_build_debug jprt_build_fastdebug: all
27N/A ( $(CD) $(OUTPUTDIR) && \
27N/A $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
27N/A
27N/A#-------------------------------------------------------------------
311N/A
311N/A# Declare these phony (not filenames)
27N/A.PHONY: $(ANT_TARGETS) all clobber \
27N/A jprt_build_product jprt_build_debug jprt_build_fastdebug
27N/A