Makefile revision 115
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
59dd3b3cd954239d98ef52cd26328856cb6f2975Automatic Updater# This code is free software; you can redistribute it and/or modify it
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# under the terms of the GNU General Public License version 2 only, as
59dd3b3cd954239d98ef52cd26328856cb6f2975Automatic Updater# published by the Free Software Foundation. Oracle designates this
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# particular file as subject to the "Classpath" exception as provided
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater# by Oracle in the LICENSE file that accompanied this code.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# This code is distributed in the hope that it will be useful, but WITHOUT
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# version 2 for more details (a copy is included in the LICENSE file that
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# accompanied this code).
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater# You should have received a copy of the GNU General Public License version
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# 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.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# or visit www.oracle.com if you need additional information or have any
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# Makefile wrapper around Ant build.xml file
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# On Solaris, the 'make' utility from Sun will not work with these makefiles.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# This little rule is only understood by Sun's make, and is harmless
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# when seen by the GNU make tool. If using Sun's make, this causes the
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# make command to fail.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonSUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# and the somewhat misnamed CLASS_VERSION (-target NN)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
6f046a065e5543f8cd7e2f24991c65d2372f4c8dMark Andrews# Figure out the platform we are using
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# Where is /java in case we need it
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater# Do we have the drops already downloaded?
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater# Check ALT_DROPS_DIR for a full path first,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# before trying to use the devtools path,
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk7-drops
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk7-drops
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Add in path to drops already downloaded
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(error "$(ANT) not found; please update ANT_HOME")
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updater ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Default target and expected 'do everything' target
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# All ant targets of interest
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic UpdaterANT_TARGETS = all source drop_included build dist clobber clean sanity
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Create a make target for each
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo "----------------------------------------------------------"
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater @echo "Help information for this Makefile:"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo " Targets (see ant project information for descriptions):"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @echo " Environment or command line variables (all optional):"
ca904804e43f663f08eb1ac9d6d617930b9a3cd3Automatic Updater "path to langtools repository dist directory")
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews "if set makes sure ant property javac.debug is true")
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews "if set uses this to set ant property javac.source")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(call helpenvline, TARGET_CLASS_VERSION,\
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews "if set to OPT means optimized build will set javac.debug to false")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo "----------------------------------------------------------"
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews @echo "Ant project file help information:"
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
e076d0c88be69de7c190ab924d095e69d2e11f7aAndreas Gustafsson @echo "----------------------------------------------------------"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Targets for Sun's internal JPRT build system
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterjprt_build_product jprt_build_debug jprt_build_fastdebug: all
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Declare these phony (not filenames)