make/Makefile

Wed, 06 May 2009 11:29:11 -0700

author
ohair
date
Wed, 06 May 2009 11:29:11 -0700
changeset 56
35c29ff8d904
parent 55
ab30d5761947
child 57
d95fec0fa489
permissions
-rw-r--r--

6837665: Deal with windows ant problem where commas in -D options do not work
Reviewed-by: xdono

duke@1 1 #
xdono@32 2 # Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 #
duke@1 5 # This code is free software; you can redistribute it and/or modify it
duke@1 6 # under the terms of the GNU General Public License version 2 only, as
duke@1 7 # published by the Free Software Foundation. Sun designates this
duke@1 8 # particular file as subject to the "Classpath" exception as provided
duke@1 9 # by Sun in the LICENSE file that accompanied this code.
duke@1 10 #
duke@1 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 # accompanied this code).
duke@1 16 #
duke@1 17 # You should have received a copy of the GNU General Public License version
duke@1 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 #
duke@1 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 23 # have any questions.
duke@1 24 #
duke@1 25
duke@1 26 # Makefile for jaxws: wrapper around Ant build.xml file
duke@1 27
duke@1 28 #
duke@1 29 # On Solaris, the 'make' utility from Sun will not work with these makefiles.
duke@1 30 # This little rule is only understood by Sun's make, and is harmless
duke@1 31 # when seen by the GNU make tool. If using Sun's make, this causes the
duke@1 32 # make command to fail.
duke@1 33 #
duke@1 34 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
duke@1 35
duke@1 36 ifdef QUIET
duke@1 37 ANT_OPTIONS += -quiet
duke@1 38 endif
duke@1 39
duke@1 40 ifdef VERBOSE
duke@1 41 ANT_OPTIONS += -verbose
duke@1 42 endif
duke@1 43
duke@1 44 ifdef JDK_VERSION
duke@1 45 ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
duke@1 46 endif
duke@1 47
duke@1 48 ifdef FULL_VERSION
duke@1 49 ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
duke@1 50 endif
duke@1 51
duke@1 52 ifdef MILESTONE
duke@1 53 ANT_OPTIONS += -Dmilestone=$(MILESTONE)
duke@1 54 endif
duke@1 55
duke@1 56 ifdef BUILD_NUMBER
duke@1 57 ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
duke@1 58 else
duke@1 59 ifdef JDK_BUILD_NUMBER
duke@1 60 ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
duke@1 61 endif
duke@1 62 endif
duke@1 63
duke@1 64 ifeq ($(VARIANT), DBG)
duke@1 65 ANT_OPTIONS += -Djavac.debug=true
duke@1 66 else
duke@1 67 ifeq ($(VARIANT), OPT)
duke@1 68 ANT_OPTIONS += -Djavac.debug=false
duke@1 69 endif
duke@1 70 endif
duke@1 71
aph@54 72 ifeq ($(DEBUG_CLASSFILES), true)
aph@54 73 ANT_OPTIONS += -Djavac.debug=true
aph@54 74 endif
aph@54 75
ohair@4 76 # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
duke@1 77 # and the somewhat misnamed CLASS_VERSION (-target NN)
duke@1 78 ifdef TARGET_CLASS_VERSION
duke@1 79 ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
duke@1 80 else
duke@1 81 ifdef JAVAC_TARGET_ARG
duke@1 82 ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
duke@1 83 endif
duke@1 84 endif
duke@1 85
duke@1 86 ifdef ALT_BOOTDIR
duke@1 87 ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
duke@1 88 endif
duke@1 89
duke@1 90 ifdef ALT_OUTPUTDIR
duke@1 91 OUTPUTDIR = $(ALT_OUTPUTDIR)
duke@1 92 ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
duke@1 93 ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
duke@1 94 else
duke@1 95 OUTPUTDIR = ..
duke@1 96 endif
duke@1 97
duke@1 98 ifdef ALT_LANGTOOLS_DIST
duke@1 99 ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
duke@1 100 endif
duke@1 101
duke@1 102 ifdef FINDBUGS_HOME
duke@1 103 ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
duke@1 104 endif
duke@1 105
duke@1 106 ifdef ANT_HOME
duke@1 107 ANT = $(ANT_HOME)/bin/ant
duke@1 108 ifneq ($(shell test -x $(ANT); echo $$?), 0)
duke@1 109 $(error "$(ANT) not found; please update ANT_HOME")
duke@1 110 endif
duke@1 111 else
duke@1 112 ANT = ant
duke@1 113 ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
duke@1 114 $(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH")
duke@1 115 endif
duke@1 116 endif
duke@1 117
duke@1 118 # Default target and expected 'do everything' target
duke@1 119 all: build
duke@1 120
duke@1 121 # Standard make clobber target
duke@1 122 clobber: clean
duke@1 123
duke@1 124 # All ant targets of interest
duke@1 125 ANT_TARGETS = build clean sanity # for now
duke@1 126
duke@1 127 # Create a make target for each
duke@1 128 $(ANT_TARGETS):
duke@1 129 $(ANT_JAVA_HOME) $(ANT) -version
duke@1 130 $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
duke@1 131
duke@1 132 # Targets for Sun's internal JPRT build system
ohair@4 133 JPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
duke@1 134 jprt_build_product jprt_build_debug jprt_build_fastdebug: all
ohair@4 135 $(RM) $(JPRT_ARCHIVE_BUNDLE)
ohair@4 136 ( cd $(OUTPUTDIR)/dist && \
ohair@4 137 zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
duke@1 138
duke@1 139 # Declare these phony (not filenames)
duke@1 140 .PHONY: $(ANT_TARGETS) all clobber \
duke@1 141 jprt_build_product jprt_build_debug jprt_build_fastdebug

mercurial