Makefile revision 59
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews#
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# This code is free software; you can redistribute it and/or modify it
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# under the terms of the GNU General Public License version 2 only, as
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# published by the Free Software Foundation. Sun designates this
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# particular file as subject to the "Classpath" exception as provided
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# by Sun in the LICENSE file that accompanied this code.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews#
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# This code is distributed in the hope that it will be useful, but WITHOUT
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# accompanied this code).
f8f37672a57524560fbdde52484e6ae3de1c3354Mark Andrews#
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# You should have received a copy of the GNU General Public License version
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews#
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# CA 95054 USA or visit www.sun.com if you need additional information or
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# have any questions.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson#
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Makefile for jaxp: wrapper around Ant build.xml file
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews#
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# On Solaris, the 'make' utility from Sun will not work with these makefiles.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# This little rule is only understood by Sun's make, and is harmless
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# when seen by the GNU make tool. If using Sun's make, this causes the
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# make command to fail.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews#
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsSUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef QUIET
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -quiet
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef VERBOSE
a0624cf8d5711cca4e3907859fbc8062a7e460faMark Andrews ANT_OPTIONS += -verbose
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
a0624cf8d5711cca4e3907859fbc8062a7e460faMark Andrews
a0624cf8d5711cca4e3907859fbc8062a7e460faMark Andrewsifdef JDK_VERSION
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonendif
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrewsifdef FULL_VERSION
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrewsendif
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonifdef MILESTONE
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews ANT_OPTIONS += -Dmilestone=$(MILESTONE)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonendif
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef BUILD_NUMBER
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewselse
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ifdef JDK_BUILD_NUMBER
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews endif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifeq ($(VARIANT), DBG)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Djavac.debug=true
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewselse
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ifeq ($(VARIANT), OPT)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Djavac.debug=false
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews endif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# and the somewhat misnamed CLASS_VERSION (-target NN)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonifdef TARGET_CLASS_VERSION
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonelse
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ifdef JAVAC_TARGET_ARG
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson endif
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonendif
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonifdef SOURCE_LANGUAGE_VERSION
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonelse
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ifdef JAVAC_SOURCE_ARG
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson endif
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonendif
c25080dc50542213058c240226c9f342186e6285Mark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef ALT_BOOTDIR
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrewsendif
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef ALT_OUTPUTDIR
c25080dc50542213058c240226c9f342186e6285Mark Andrews OUTPUTDIR = $(ALT_OUTPUTDIR)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrewselse
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews OUTPUTDIR = ..
c25080dc50542213058c240226c9f342186e6285Mark Andrewsendif
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrewsifdef ALT_LANGTOOLS_DIST
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef FINDBUGS_HOME
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsendif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsifdef ANT_HOME
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT = $(ANT_HOME)/bin/ant
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews ifneq ($(shell test -x $(ANT); echo $$?), 0)
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(error "$(ANT) not found; please update ANT_HOME")
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews endif
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewselse
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews ANT = ant
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews endif
c25080dc50542213058c240226c9f342186e6285Mark Andrewsendif
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Default target and expected 'do everything' target
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsall: build
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Standard make clobber target
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsclobber: clean
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# All ant targets of interest
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsANT_TARGETS = build clean sanity # for now
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Create a make target for each
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews$(ANT_TARGETS):
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ANT_JAVA_HOME) $(ANT) -version
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Targets for Sun's internal JPRT build system
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark AndrewsJPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsjprt_build_product jprt_build_debug jprt_build_fastdebug: all
5752b9e296f14034f103149f18188770c2cc5239Mark Andrews $(RM) $(JPRT_ARCHIVE_BUNDLE)
c25080dc50542213058c240226c9f342186e6285Mark Andrews ( cd $(OUTPUTDIR)/dist && \
5752b9e296f14034f103149f18188770c2cc5239Mark Andrews zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Declare these phony (not filenames)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews.PHONY: $(ANT_TARGETS) all clobber \
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews jprt_build_product jprt_build_debug jprt_build_fastdebug
c25080dc50542213058c240226c9f342186e6285Mark Andrews