0N/A#
193N/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
115N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
115N/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#
115N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
115N/A# or visit www.oracle.com if you need additional information or have any
115N/A# questions.
0N/A#
0N/A
84N/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
84N/Aifeq ($(VARIANT), OPT)
84N/A ifneq ($(DEBUG_CLASSFILES), true)
0N/A ANT_OPTIONS += -Djavac.debug=false
0N/A endif
0N/Aendif
0N/A
3N/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
62N/Aifdef SOURCE_LANGUAGE_VERSION
62N/A ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
62N/Aelse
62N/A ifdef JAVAC_SOURCE_ARG
62N/A ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
62N/A endif
62N/Aendif
62N/A
123N/A# If downloads are allowed
123N/Aifeq ($(ALLOW_DOWNLOADS),true)
123N/A ANT_OPTIONS += -Dallow.downloads=true
123N/Aendif
123N/A
84N/A# Figure out the platform we are using
84N/A_SYSTEM_UNAME := $(shell uname)
84N/A_PLATFORM_KIND = unix
84N/Aifeq ($(_SYSTEM_UNAME), Windows_NT)
84N/A _PLATFORM_KIND = windows
84N/Aendif
84N/Aifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
84N/A _PLATFORM_KIND = windows
0N/Aendif
0N/A
84N/A# Where is /java in case we need it
84N/Aifdef ALT_SLASH_JAVA
84N/A _SLASHJAVA = $(ALT_SLASH_JAVA)
84N/Aelse
84N/A ifeq ($(_PLATFORM_KIND), windows)
84N/A _SLASHJAVA=J:/
84N/A else
84N/A _SLASHJAVA=/java
84N/A endif
84N/Aendif
84N/A
0N/Aifdef ALT_OUTPUTDIR
0N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
84N/A ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
0N/Aelse
0N/A OUTPUTDIR = ..
0N/Aendif
0N/A
0N/Aifdef ALT_LANGTOOLS_DIST
84N/A ifdef ALT_BOOTDIR
84N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
94N/A ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
84N/A endif
0N/A ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
84N/Aelse
84N/A ifdef ALT_JDK_IMPORT_PATH
84N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
94N/A ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
84N/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)
187N/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
84N/Adefault: all
0N/A
0N/A# All ant targets of interest
325N/AANT_TARGETS = all build dist clobber clean sanity
325N/A
325N/A# Just for compat reasons, delete in future.
325N/Adrop_included:
325N/Asource:
0N/A
0N/A# Create a make target for each
0N/A$(ANT_TARGETS):
94N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
84N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
84N/A
84N/A# Help target
84N/Adefine helpenvline
84N/A@echo " $1";echo " $2"
84N/Aendef
84N/Ahelp:
84N/A @echo "----------------------------------------------------------"
84N/A @echo " "
84N/A @echo "Help information for this Makefile:"
84N/A @echo " "
84N/A @echo " Targets (see ant project information for descriptions):"
84N/A @echo " $(ANT_TARGETS)"
84N/A @echo " "
84N/A @echo " Environment or command line variables (all optional):"
84N/A $(call helpenvline, ALT_BOOTDIR,\
84N/A "JAVA_HOME to use when running ant")
84N/A $(call helpenvline, ALT_LANGTOOLS_DIST,\
84N/A "path to langtools repository dist directory")
84N/A $(call helpenvline, ALT_OUTPUTDIR,\
84N/A "path to root of output")
84N/A $(call helpenvline, DEBUG_CLASSFILES,\
84N/A "if set makes sure ant property javac.debug is true")
84N/A $(call helpenvline, JAVAC_SOURCE_ARG,\
84N/A "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
84N/A $(call helpenvline, JAVAC_TARGET_ARG,\
84N/A "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
84N/A $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
84N/A "if set uses this to set ant property javac.source")
84N/A $(call helpenvline, QUIET,\
84N/A "if set will pass -quiet to ant")
84N/A $(call helpenvline, TARGET_CLASS_VERSION,\
84N/A "JAVA_HOME to use when running ant")
84N/A $(call helpenvline, VARIANT,\
84N/A "if set to OPT means optimized build will set javac.debug to false")
84N/A $(call helpenvline, VERBOSE,\
84N/A "if set will pass -verbose to ant")
84N/A @echo " "
84N/A @echo "----------------------------------------------------------"
84N/A @echo " "
84N/A @echo "Ant project file help information:"
84N/A @echo " "
84N/A @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
84N/A @echo " "
84N/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 && \
3N/A zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
0N/A
0N/A# Declare these phony (not filenames)
84N/A.PHONY: $(ANT_TARGETS) \
0N/A jprt_build_product jprt_build_debug jprt_build_fastdebug