Makefile revision 126
341N/A#
341N/A# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
1064N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
341N/A#
341N/A# This code is free software; you can redistribute it and/or modify it
919N/A# under the terms of the GNU General Public License version 2 only, as
919N/A# published by the Free Software Foundation. Oracle designates this
919N/A# particular file as subject to the "Classpath" exception as provided
919N/A# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
919N/A# or visit www.oracle.com if you need additional information or have any
341N/A# questions.
341N/A#
341N/A
341N/A# Makefile wrapper around Ant build.xml file
493N/A
341N/A#
341N/A# On Solaris, the 'make' utility from Sun will not work with these makefiles.
1179N/A# This little rule is only understood by Sun's make, and is harmless
341N/A# when seen by the GNU make tool. If using Sun's make, this causes the
911N/A# make command to fail.
1179N/A#
1179N/ASUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
1179N/A
911N/Aifdef QUIET
341N/A ANT_OPTIONS += -quiet
341N/Aendif
341N/A
341N/Aifdef VERBOSE
341N/A ANT_OPTIONS += -verbose
341N/Aendif
1179N/A
341N/Aifeq ($(VARIANT), OPT)
341N/A ifneq ($(DEBUG_CLASSFILES), true)
604N/A ANT_OPTIONS += -Djavac.debug=false
1179N/A endif
688N/Aendif
688N/A
688N/A# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
688N/A# and the somewhat misnamed CLASS_VERSION (-target NN)
1179N/Aifdef TARGET_CLASS_VERSION
1179N/A ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
1179N/Aelse
688N/A ifdef JAVAC_TARGET_ARG
688N/A ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
688N/A endif
688N/Aendif
688N/A
688N/Aifdef SOURCE_LANGUAGE_VERSION
688N/A ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
688N/Aelse
688N/A ifdef JAVAC_SOURCE_ARG
688N/A ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
688N/A endif
688N/Aendif
688N/A
688N/A# Figure out the platform we are using
688N/A_SYSTEM_UNAME := $(shell uname)
688N/A_PLATFORM_KIND = unix
688N/Aifeq ($(_SYSTEM_UNAME), Windows_NT)
688N/A _PLATFORM_KIND = windows
688N/Aendif
688N/Aifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
996N/A _PLATFORM_KIND = windows
1179N/Aendif
688N/A
688N/A# Where is /java in case we need it
688N/Aifdef ALT_SLASH_JAVA
688N/A _SLASHJAVA = $(ALT_SLASH_JAVA)
688N/Aelse
688N/A ifeq ($(_PLATFORM_KIND), windows)
688N/A _SLASHJAVA=J:/
688N/A else
688N/A _SLASHJAVA=/java
688N/A endif
1146N/Aendif
688N/A
688N/A# Do we have the drops already downloaded?
688N/A# Check ALT_DROPS_DIR for a full path first,
688N/A# before trying to use the devtools path,
688N/A# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools.
816N/Aifdef ALT_DROPS_DIR
1064N/A DROPS_DIR = $(ALT_DROPS_DIR)
341N/Aelse
341N/A ifdef ALT_JDK_DEVTOOLS_DIR
341N/A DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk7-drops
341N/A else
970N/A DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk7-drops
970N/A endif
970N/Aendif
970N/A
970N/A# Add in path to drops already downloaded
970N/AANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR)
970N/A
970N/Aifdef ALT_OUTPUTDIR
970N/A OUTPUTDIR = $(ALT_OUTPUTDIR)
970N/A ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
970N/Aelse
970N/A OUTPUTDIR = ..
970N/Aendif
1029N/A
1029N/Aifdef ALT_LANGTOOLS_DIST
970N/A ifdef ALT_BOOTDIR
341N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
341N/A ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
493N/A endif
969N/A ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
341N/Aelse
341N/A ifdef ALT_JDK_IMPORT_PATH
493N/A ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
1064N/A ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
1029N/A endif
341N/Aendif
341N/A
341N/Aifdef ANT_HOME
341N/A ANT = $(ANT_HOME)/bin/ant
493N/A ifneq ($(shell test -x $(ANT); echo $$?), 0)
341N/A $(error "$(ANT) not found; please update ANT_HOME")
1064N/A endif
341N/Aelse
341N/A ANT = ant
1029N/A ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
1029N/A $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
1029N/A endif
341N/Aendif
965N/A
965N/A# Default target and expected 'do everything' target
851N/Adefault: all
851N/A
851N/A# All ant targets of interest
851N/AANT_TARGETS = all source drop_included build dist clobber clean sanity
851N/A
341N/A# Create a make target for each
493N/A$(ANT_TARGETS):
341N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
341N/A cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
341N/A
341N/A# Help target
341N/Adefine helpenvline
341N/A@echo " $1";echo " $2"
341N/Aendef
493N/Ahelp:
341N/A @echo "----------------------------------------------------------"
341N/A @echo " "
341N/A @echo "Help information for this Makefile:"
341N/A @echo " "
341N/A @echo " Targets (see ant project information for descriptions):"
493N/A @echo " $(ANT_TARGETS)"
493N/A @echo " "
493N/A @echo " Environment or command line variables (all optional):"
493N/A $(call helpenvline, ALT_BOOTDIR,\
341N/A "JAVA_HOME to use when running ant")
341N/A $(call helpenvline, ALT_LANGTOOLS_DIST,\
341N/A "path to langtools repository dist directory")
922N/A $(call helpenvline, ALT_OUTPUTDIR,\
922N/A "path to root of output")
910N/A $(call helpenvline, DEBUG_CLASSFILES,\
970N/A "if set makes sure ant property javac.debug is true")
970N/A $(call helpenvline, JAVAC_SOURCE_ARG,\
963N/A "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
963N/A $(call helpenvline, JAVAC_TARGET_ARG,\
970N/A "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
970N/A $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
970N/A "if set uses this to set ant property javac.source")
922N/A $(call helpenvline, QUIET,\
922N/A "if set will pass -quiet to ant")
922N/A $(call helpenvline, TARGET_CLASS_VERSION,\
851N/A "JAVA_HOME to use when running ant")
851N/A $(call helpenvline, VARIANT,\
851N/A "if set to OPT means optimized build will set javac.debug to false")
341N/A $(call helpenvline, VERBOSE,\
851N/A "if set will pass -verbose to ant")
922N/A @echo " "
851N/A @echo "----------------------------------------------------------"
963N/A @echo " "
970N/A @echo "Ant project file help information:"
963N/A @echo " "
963N/A @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
963N/A @echo " "
963N/A @echo "----------------------------------------------------------"
963N/A
963N/A# Targets for Sun's internal JPRT build system
963N/AJPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
jprt_build_product jprt_build_debug jprt_build_fastdebug: all
$(RM) $(JPRT_ARCHIVE_BUNDLE)
( cd $(OUTPUTDIR)/dist && \
zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
# Declare these phony (not filenames)
.PHONY: $(ANT_TARGETS) \
jprt_build_product jprt_build_debug jprt_build_fastdebug