0N/A#
797N/A# Copyright (c) 2007, 2010, 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
553N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
553N/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#
553N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A# or visit www.oracle.com if you need additional information or have any
553N/A# questions.
0N/A#
0N/A
0N/A# Makefile for langtools: wrapper around Ant build.xml file
0N/A
0N/A#
581N/A# On Solaris, the standard 'make' utility will not work with these makefiles.
581N/A# This little rule is only understood by Solaris make, and is harmless
581N/A# when seen by the GNU make tool. If using Solaris make, this causes the
0N/A# make command to fail.
0N/A#
0N/ASUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
0N/A
0N/A#
0N/A# Minimal platform defs
0N/A# Need FullPath because we can't rely on gnumake abspath, until we use v3.81
0N/A#
0N/A
0N/ASYSTEM_UNAME := $(shell uname)
0N/A
587N/A# Where is unwanted output to be delivered?
587N/A# On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file.
0N/Aifeq ($(SYSTEM_UNAME), Windows_NT)
0N/ADEV_NULL = NUL
0N/Aelse
587N/ADEV_NULL = /dev/null
587N/Aendif
587N/A
0N/Aifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
0N/AUSING_CYGWIN = true
0N/Aendif
0N/A
0N/Aifdef USING_CYGWIN
0N/Adefine FullPath
0N/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
0N/A#
0N/A
0N/Aifdef QUIET
0N/A ANT_OPTIONS += -quiet
0N/Aendif
0N/A
0N/Aifdef VERBOSE
500N/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
0N/A ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
0N/Aendif
0N/A
0N/Aifdef MILESTONE
171N/Aifneq ($(MILESTONE),fcs)
0N/A ANT_OPTIONS += -Dmilestone=$(MILESTONE)
171N/Aelse
171N/A ANT_OPTIONS += -Drelease=$(JDK_VERSION)
171N/Aendif
0N/Aendif
0N/A
0N/Aifdef BUILD_NUMBER
0N/A ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
0N/Aelse
0N/A ifdef JDK_BUILD_NUMBER
0N/A ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
0N/A endif
0N/Aendif
0N/A
0N/Aifeq ($(VARIANT), DBG)
0N/A ANT_OPTIONS += -Djavac.debug=true
0N/Aelse
0N/A ifeq ($(VARIANT), OPT)
0N/A ANT_OPTIONS += -Djavac.debug=false
0N/A endif
0N/Aendif
0N/A
270N/Aifeq ($(DEBUG_CLASSFILES), true)
270N/A ANT_OPTIONS += -Djavac.debug=true
272N/A ANT_OPTIONS += -Ddebug.classfiles=true
270N/Aendif
270N/A
0N/A# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
0N/A# and the somewhat misnamed CLASS_VERSION (-target NN)
0N/Aifdef TARGET_CLASS_VERSION
0N/A ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
0N/Aelse
0N/A ifdef JAVAC_TARGET_ARG
0N/A ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
0N/A endif
0N/Aendif
0N/A
285N/Aifdef SOURCE_LANGUAGE_VERSION
285N/A ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
285N/Aelse
285N/A ifdef JAVAC_SOURCE_ARG
285N/A ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
285N/A endif
285N/Aendif
285N/A
0N/Aifdef ALT_BOOTDIR
0N/A ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
0N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
0N/Aendif
0N/A
440N/A# To facilitate bootstrapping, much of langtools can be compiled with (just)
440N/A# a boot JDK. However, some source files need to be compiled against
440N/A# new JDK API. In a bootstrap build, an import JDK may not be available,
440N/A# so build.xml can also build against the source files in a jdk repo,
440N/A# in which case it will automatically generate stub files for the new JDK API.
440N/Aifdef JDK_TOPDIR
440N/A ANT_OPTIONS += -Dimport.jdk=$(JDK_TOPDIR)
440N/Aelse
440N/A ifdef ALT_JDK_TOPDIR
440N/A ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_TOPDIR)
440N/A else
461N/A ifdef ALT_JDK_IMPORT_PATH
461N/A ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_IMPORT_PATH)
440N/A endif
440N/A endif
440N/Aendif
440N/A
0N/Aifdef ALT_OUTPUTDIR
0N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
0N/A ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
0N/A ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
0N/Aelse
0N/A OUTPUTDIR = ..
0N/Aendif
0N/A#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
0N/AABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
0N/A
0N/AANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
0N/AANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
0N/A
0N/Aifdef FINDBUGS_HOME
0N/A ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
0N/Aendif
0N/A
0N/Aifdef ANT_HOME
0N/A ANT = $(ANT_HOME)/bin/ant
0N/A ifneq ($(shell test -x $(ANT) && echo OK), OK)
0N/A $(error $(ANT) not found -- please update ANT_HOME)
0N/A endif
0N/Aelse
0N/A ANT = ant
0N/A ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
0N/A $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
0N/A endif
0N/Aendif
0N/A
0N/A# Default target and expected 'do everything' target
0N/Aall: build
0N/A
0N/A# Standard make clobber target
0N/Aclobber: clean
0N/A
0N/A# All ant targets of interest
804N/AANT_TARGETS = build clean sanity post-sanity diagnostics build-all-tools # for now
0N/A
530N/A# Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1)
530N/A$(OUTPUTDIR)/build/ant-diagnostics.log:
530N/A @mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
530N/A @$(RM) $@
530N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $@ ; \
530N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -version >> $@
530N/A
0N/A# Create a make target for each
530N/A$(ANT_TARGETS): $(OUTPUTDIR)/build/ant-diagnostics.log
0N/A @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
0N/A $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
0N/A
0N/A#-------------------------------------------------------------------
0N/A#
581N/A# Targets for Oracle's internal JPRT build system
0N/A
0N/ACD = cd
0N/AZIP = zip
0N/A
0N/AJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
0N/A
0N/Ajprt_build_product jprt_build_debug jprt_build_fastdebug: all
0N/A ( $(CD) $(OUTPUTDIR) && \
0N/A $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
0N/A
0N/A#-------------------------------------------------------------------
0N/A
0N/A# Declare these phony (not filenames)
0N/A.PHONY: $(ANT_TARGETS) all clobber \
0N/A jprt_build_product jprt_build_debug jprt_build_fastdebug