0N/A#
206N/A# Copyright (c) 2007, 2011, 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
123N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
123N/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#
123N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
123N/A# or visit www.oracle.com if you need additional information or have any
123N/A# questions.
0N/A#
0N/A
87N/A# Makefile wrapper around Ant build.xml file
0N/A
0N/A#
0N/A# On Solaris, the 'make' utility from Sun will not work with these makefiles.
0N/A# This little rule is only understood by Sun's make, and is harmless
0N/A# when seen by the GNU make tool. If using Sun's 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/Aifdef QUIET
0N/A ANT_OPTIONS += -quiet
0N/Aendif
0N/A
0N/Aifdef VERBOSE
0N/A ANT_OPTIONS += -verbose
0N/Aendif
0N/A
87N/Aifeq ($(VARIANT), OPT)
87N/A ifneq ($(DEBUG_CLASSFILES), true)
0N/A ANT_OPTIONS += -Djavac.debug=false
0N/A endif
0N/Aendif
0N/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
87N/Aendif
59N/A
59N/Aifdef SOURCE_LANGUAGE_VERSION
59N/A ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
59N/Aelse
59N/A ifdef JAVAC_SOURCE_ARG
59N/A ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
59N/A endif
59N/Aendif
0N/A
131N/A# If downloads are allowed
131N/Aifeq ($(ALLOW_DOWNLOADS),true)
131N/A ANT_OPTIONS += -Dallow.downloads=true
131N/Aendif
131N/A
87N/A# Figure out the platform we are using
87N/A_SYSTEM_UNAME := $(shell uname)
87N/A_PLATFORM_KIND = unix
87N/Aifeq ($(_SYSTEM_UNAME), Windows_NT)
87N/A _PLATFORM_KIND = windows
87N/Aendif
87N/Aifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
87N/A _PLATFORM_KIND = windows
0N/Aendif
0N/A
87N/A# Where is /java in case we need it
87N/Aifdef ALT_SLASH_JAVA
87N/A _SLASHJAVA = $(ALT_SLASH_JAVA)
87N/Aelse
87N/A ifeq ($(_PLATFORM_KIND), windows)
87N/A _SLASHJAVA=J:/
87N/A else
87N/A _SLASHJAVA=/java
87N/A endif
87N/Aendif
87N/A
96N/A# Do we have the drops already downloaded?
96N/A# Check ALT_DROPS_DIR for a full path first,
96N/A# before trying to use the devtools path,
96N/A# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools.
96N/Aifdef ALT_DROPS_DIR
96N/A DROPS_DIR = $(ALT_DROPS_DIR)
87N/Aelse
96N/A ifdef ALT_JDK_DEVTOOLS_DIR
96N/A DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk7-drops
96N/A else
96N/A DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk7-drops
96N/A endif
87N/Aendif
87N/A
96N/A# Add in path to drops already downloaded
96N/AANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR)
87N/A
0N/Aifdef ALT_OUTPUTDIR
0N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
87N/A ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
0N/Aelse
0N/A OUTPUTDIR = ..
0N/Aendif
0N/A
0N/Aifdef ALT_LANGTOOLS_DIST
87N/A ifdef ALT_BOOTDIR
87N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
99N/A ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
87N/A endif
0N/A ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
87N/Aelse
87N/A ifdef ALT_JDK_IMPORT_PATH
87N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
99N/A ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
87N/A endif
0N/Aendif
0N/A
0N/Aifdef ANT_HOME
0N/A ANT = $(ANT_HOME)/bin/ant
0N/A ifneq ($(shell test -x $(ANT); echo $$?), 0)
0N/A $(error "$(ANT) not found; please update ANT_HOME")
0N/A endif
0N/Aelse
0N/A ANT = ant
0N/A ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
199N/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
87N/Adefault: all
0N/A
0N/A# All ant targets of interest
94N/AANT_TARGETS = all source drop_included build dist clobber clean sanity
0N/A
0N/A# Create a make target for each
0N/A$(ANT_TARGETS):
99N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
87N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
87N/A
87N/A# Help target
87N/Adefine helpenvline
87N/A@echo " $1";echo " $2"
87N/Aendef
87N/Ahelp:
87N/A @echo "----------------------------------------------------------"
87N/A @echo " "
87N/A @echo "Help information for this Makefile:"
87N/A @echo " "
87N/A @echo " Targets (see ant project information for descriptions):"
87N/A @echo " $(ANT_TARGETS)"
87N/A @echo " "
87N/A @echo " Environment or command line variables (all optional):"
131N/A $(call helpenvline, ALT_DROPS_DIR,\
131N/A "Directory that contains the drop source bundles i.e. drops.dir")
87N/A $(call helpenvline, ALT_BOOTDIR,\
87N/A "JAVA_HOME to use when running ant")
87N/A $(call helpenvline, ALT_LANGTOOLS_DIST,\
87N/A "path to langtools repository dist directory")
87N/A $(call helpenvline, ALT_OUTPUTDIR,\
87N/A "path to root of output")
87N/A $(call helpenvline, DEBUG_CLASSFILES,\
87N/A "if set makes sure ant property javac.debug is true")
87N/A $(call helpenvline, JAVAC_SOURCE_ARG,\
87N/A "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
87N/A $(call helpenvline, JAVAC_TARGET_ARG,\
87N/A "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
87N/A $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
87N/A "if set uses this to set ant property javac.source")
87N/A $(call helpenvline, QUIET,\
87N/A "if set will pass -quiet to ant")
87N/A $(call helpenvline, TARGET_CLASS_VERSION,\
87N/A "JAVA_HOME to use when running ant")
87N/A $(call helpenvline, VARIANT,\
87N/A "if set to OPT means optimized build will set javac.debug to false")
87N/A $(call helpenvline, VERBOSE,\
87N/A "if set will pass -verbose to ant")
87N/A @echo " "
87N/A @echo "----------------------------------------------------------"
87N/A @echo " "
87N/A @echo "Ant project file help information:"
87N/A @echo " "
87N/A @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
87N/A @echo " "
87N/A @echo "----------------------------------------------------------"
0N/A
0N/A# Targets for Sun's internal JPRT build system
3N/AJPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
0N/Ajprt_build_product jprt_build_debug jprt_build_fastdebug: all
3N/A $(RM) $(JPRT_ARCHIVE_BUNDLE)
3N/A ( cd $(OUTPUTDIR)/dist && \
87N/A zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
0N/A
0N/A# Declare these phony (not filenames)
87N/A.PHONY: $(ANT_TARGETS) \
0N/A jprt_build_product jprt_build_debug jprt_build_fastdebug