Makefile revision 115
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews#
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#
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.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
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).
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater#
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.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews#
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
04eba969cb9a54bbda2896db2067c07b2ac5ba16Automatic Updater# questions.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# Makefile wrapper around Ant build.xml file
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews#
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.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews#
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonSUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsifdef QUIET
fc3576328379e813ccf6b3a6e66d9bb701a79c83Automatic Updater ANT_OPTIONS += -quiet
298c514fff250c1a147176cfbbc1c0ca441d1ea5Automatic Updaterendif
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
bbb069be941f649228760edcc241122933c066d2Automatic Updaterifdef VERBOSE
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews ANT_OPTIONS += -verbose
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updaterendif
9d330c054e02f52cefd8dc0e71550b0fe07e077eAutomatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsifeq ($(VARIANT), OPT)
ca904804e43f663f08eb1ac9d6d617930b9a3cd3Automatic Updater ifneq ($(DEBUG_CLASSFILES), true)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews ANT_OPTIONS += -Djavac.debug=false
3a6600c8d319275d73c36eb625f77103cd83e824Automatic Updater endif
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrewsendif
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# and the somewhat misnamed CLASS_VERSION (-target NN)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsifdef TARGET_CLASS_VERSION
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewselse
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews ifdef JAVAC_TARGET_ARG
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews endif
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsendif
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsifdef SOURCE_LANGUAGE_VERSION
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updaterelse
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont ifdef JAVAC_SOURCE_ARG
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont endif
2a31bd531072824ef252c18303859d6af7451b00Francis Dupontendif
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6f046a065e5543f8cd7e2f24991c65d2372f4c8dMark Andrews# Figure out the platform we are using
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews_SYSTEM_UNAME := $(shell uname)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews_PLATFORM_KIND = unix
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsifeq ($(_SYSTEM_UNAME), Windows_NT)
a8644ebab678a1de66cbfaabb513651a739958afAutomatic Updater _PLATFORM_KIND = windows
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrewsendif
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater _PLATFORM_KIND = windows
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterendif
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# Where is /java in case we need it
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsifdef ALT_SLASH_JAVA
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson _SLASHJAVA = $(ALT_SLASH_JAVA)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewselse
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews ifeq ($(_PLATFORM_KIND), windows)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson _SLASHJAVA=J:/
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews else
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson _SLASHJAVA=/java
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews endif
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updaterendif
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater
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.
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updaterifdef ALT_DROPS_DIR
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updater DROPS_DIR = $(ALT_DROPS_DIR)
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updaterelse
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater ifdef ALT_JDK_DEVTOOLS_DIR
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk7-drops
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater else
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk7-drops
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater endif
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updaterendif
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Add in path to drops already downloaded
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic UpdaterANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterifdef ALT_OUTPUTDIR
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater OUTPUTDIR = $(ALT_OUTPUTDIR)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterelse
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater OUTPUTDIR = ..
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterendif
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterifdef ALT_LANGTOOLS_DIST
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater ifdef ALT_BOOTDIR
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater endif
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updaterelse
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ifdef ALT_JDK_IMPORT_PATH
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
ea935c46e8261ea10621e5b038426539fe8a7cc5Mark Andrews endif
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterendif
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterifdef ANT_HOME
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater ANT = $(ANT_HOME)/bin/ant
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews ifneq ($(shell test -x $(ANT); echo $$?), 0)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(error "$(ANT) not found; please update ANT_HOME")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater endif
bbb069be941f649228760edcc241122933c066d2Automatic Updaterelse
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ANT = ant
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 endif
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrewsendif
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Default target and expected 'do everything' target
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updaterdefault: all
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# All ant targets of interest
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic UpdaterANT_TARGETS = all source drop_included build dist clobber clean sanity
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Create a make target for each
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews$(ANT_TARGETS):
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Help target
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updaterdefine helpenvline
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater@echo " $1";echo " $2"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterendef
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonhelp:
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo "----------------------------------------------------------"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo " "
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater @echo "Help information for this Makefile:"
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater @echo " "
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo " Targets (see ant project information for descriptions):"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo " $(ANT_TARGETS)"
00be0f9f61d4c6bf197d000bfa1a6b7e70ea0866Automatic Updater @echo " "
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @echo " Environment or command line variables (all optional):"
00be0f9f61d4c6bf197d000bfa1a6b7e70ea0866Automatic Updater $(call helpenvline, ALT_BOOTDIR,\
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater "JAVA_HOME to use when running ant")
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater $(call helpenvline, ALT_LANGTOOLS_DIST,\
ca904804e43f663f08eb1ac9d6d617930b9a3cd3Automatic Updater "path to langtools repository dist directory")
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater $(call helpenvline, ALT_OUTPUTDIR,\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington "path to root of output")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(call helpenvline, DEBUG_CLASSFILES,\
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews "if set makes sure ant property javac.debug is true")
81c3cb9b921cda22a5a35fa32ca1bf35797b9a36Automatic Updater $(call helpenvline, JAVAC_SOURCE_ARG,\
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(call helpenvline, JAVAC_TARGET_ARG,\
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")
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(call helpenvline, QUIET,\
8ae412a86ed138263796195eed82a4716e7effcbMark Andrews "if set will pass -quiet to ant")
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(call helpenvline, TARGET_CLASS_VERSION,\
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews "JAVA_HOME to use when running ant")
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater $(call helpenvline, VARIANT,\
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews "if set to OPT means optimized build will set javac.debug to false")
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(call helpenvline, VERBOSE,\
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews "if set will pass -verbose to ant")
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater @echo " "
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @echo "----------------------------------------------------------"
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @echo " "
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews @echo "Ant project file help information:"
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @echo " "
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @echo " "
e076d0c88be69de7c190ab924d095e69d2e11f7aAndreas Gustafsson @echo "----------------------------------------------------------"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Targets for Sun's internal JPRT build system
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic UpdaterJPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterjprt_build_product jprt_build_debug jprt_build_fastdebug: all
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews $(RM) $(JPRT_ARCHIVE_BUNDLE)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ( cd $(OUTPUTDIR)/dist && \
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Declare these phony (not filenames)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson.PHONY: $(ANT_TARGETS) \
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews jprt_build_product jprt_build_debug jprt_build_fastdebug
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews