Makefile revision 87
205c10066a0acfeac52d1a135671f41d207b8557Automatic Updater# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.
205c10066a0acfeac52d1a135671f41d207b8557Automatic Updater# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# This code is free software; you can redistribute it and/or modify it
2bb3422dc683c013db7042f5736240de6b86f182Automatic Updater# under the terms of the GNU General Public License version 2 only, as
75b70a68aefaa17ac4e768d5ed85d2f50d471490Automatic Updater# published by the Free Software Foundation. Sun designates this
2ec4ab21838e218863d052ebfa3e106e04f50820Evan Hunt# particular file as subject to the "Classpath" exception as provided
ea854b585041ad19f70f7af15e08144ef2c2bd1bMark Andrews# by Sun in the LICENSE file that accompanied this code.
c89d02f2fb4c06168236d600e86831cff324f763Mark Andrews# This code is distributed in the hope that it will be useful, but WITHOUT
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# accompanied this code).
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# You should have received a copy of the GNU General Public License version
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater# 2 along with this work; if not, write to the Free Software Foundation,
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater# CA 95054 USA or visit www.sun.com if you need additional information or
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# have any questions.
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater# Makefile wrapper around Ant build.xml file
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# On Solaris, the 'make' utility from Sun will not work with these makefiles.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# This little rule is only understood by Sun's make, and is harmless
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# when seen by the GNU make tool. If using Sun's make, this causes the
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# make command to fail.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonSUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# and the somewhat misnamed CLASS_VERSION (-target NN)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Figure out the platform we are using
1a06700908f5a1d9f4a8d51285a0fd971e2f9117Automatic Updaterifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Where is /java in case we need it
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Where is /java/devtools in case we need it
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont# Add in path to devtools
52367885450d8f61d4f2d63292beb15ba8f39ac7Automatic Updater ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
0977f3f39ef6728516be7976452b9122c8f5607aAutomatic Updater ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater ifneq ($(shell test -x $(ANT); echo $$?), 0)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater $(error "$(ANT) not found; please update ANT_HOME")
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Default target and expected 'do everything' target
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater# All ant targets of interest
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic UpdaterANT_TARGETS = all source build dist clobber clean sanity
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater# Create a make target for each
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater @echo "----------------------------------------------------------"
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater @echo "Help information for this Makefile:"
3b6e4c84a525b0b3fc9e8affd8bb9fa5c000345fAutomatic Updater @echo " Targets (see ant project information for descriptions):"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo " Environment or command line variables (all optional):"
0df8ead472f207020f8da22a185fe4b945248ab8Automatic Updater "path to langtools repository dist directory")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater "if set makes sure ant property javac.debug is true")
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater "if set uses this to set ant property javac.source")
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater $(call helpenvline, TARGET_CLASS_VERSION,\
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater "if set to OPT means optimized build will set javac.debug to false")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo "----------------------------------------------------------"
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater @echo "Ant project file help information:"
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater @echo "----------------------------------------------------------"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Targets for Sun's internal JPRT build system
bbb069be941f649228760edcc241122933c066d2Automatic Updaterjprt_build_product jprt_build_debug jprt_build_fastdebug: all
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater# Declare these phony (not filenames)