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