Thu, 06 Mar 2008 10:07:25 -0800
4741726: allow Object += String
Summary: remove code in line with restriction removed from JLS
Reviewed-by: mcimadamore
Contributed-by: michaelbailey0@gmail.com
duke@1 | 1 | # |
duke@1 | 2 | # Copyright 2007 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 langtools: 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 | # |
duke@1 | 37 | # Minimal platform defs |
duke@1 | 38 | # Need FullPath because we can't rely on gnumake abspath, until we use v3.81 |
duke@1 | 39 | # |
duke@1 | 40 | |
duke@1 | 41 | SYSTEM_UNAME := $(shell uname) |
duke@1 | 42 | |
duke@1 | 43 | ifeq ($(SYSTEM_UNAME), Windows_NT) |
duke@1 | 44 | DEV_NULL = NUL |
duke@1 | 45 | else |
duke@1 | 46 | ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) |
duke@1 | 47 | DEV_NULL = NUL |
duke@1 | 48 | USING_CYGWIN = true |
duke@1 | 49 | else |
duke@1 | 50 | DEV_NULL = /dev/null |
duke@1 | 51 | endif |
duke@1 | 52 | endif |
duke@1 | 53 | |
duke@1 | 54 | ifdef USING_CYGWIN |
duke@1 | 55 | define FullPath |
duke@1 | 56 | $(shell cygpath -a -s -m $1 2> $(DEV_NULL)) |
duke@1 | 57 | endef |
duke@1 | 58 | else |
duke@1 | 59 | define FullPath |
duke@1 | 60 | $(shell cd $1 2> $(DEV_NULL) && pwd) |
duke@1 | 61 | endef |
duke@1 | 62 | endif |
duke@1 | 63 | |
duke@1 | 64 | # |
duke@1 | 65 | # Makefile args |
duke@1 | 66 | # |
duke@1 | 67 | |
duke@1 | 68 | ifdef QUIET |
duke@1 | 69 | ANT_OPTIONS += -quiet |
duke@1 | 70 | endif |
duke@1 | 71 | |
duke@1 | 72 | ifdef VERBOSE |
duke@1 | 73 | ANT_OPTIONS += -verbose -diagnostics |
duke@1 | 74 | endif |
duke@1 | 75 | |
duke@1 | 76 | ifdef JDK_VERSION |
duke@1 | 77 | ANT_OPTIONS += -Djdk.version=$(JDK_VERSION) |
duke@1 | 78 | endif |
duke@1 | 79 | |
duke@1 | 80 | ifdef FULL_VERSION |
duke@1 | 81 | ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces |
duke@1 | 82 | endif |
duke@1 | 83 | |
duke@1 | 84 | ifdef MILESTONE |
duke@1 | 85 | ANT_OPTIONS += -Dmilestone=$(MILESTONE) |
duke@1 | 86 | endif |
duke@1 | 87 | |
duke@1 | 88 | ifdef BUILD_NUMBER |
duke@1 | 89 | ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER) |
duke@1 | 90 | else |
duke@1 | 91 | ifdef JDK_BUILD_NUMBER |
duke@1 | 92 | ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER) |
duke@1 | 93 | endif |
duke@1 | 94 | endif |
duke@1 | 95 | |
duke@1 | 96 | ifeq ($(VARIANT), DBG) |
duke@1 | 97 | ANT_OPTIONS += -Djavac.debug=true |
duke@1 | 98 | else |
duke@1 | 99 | ifeq ($(VARIANT), OPT) |
duke@1 | 100 | ANT_OPTIONS += -Djavac.debug=false |
duke@1 | 101 | endif |
duke@1 | 102 | endif |
duke@1 | 103 | |
duke@1 | 104 | # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) |
duke@1 | 105 | # and the somewhat misnamed CLASS_VERSION (-target NN) |
duke@1 | 106 | ifdef TARGET_CLASS_VERSION |
duke@1 | 107 | ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION) |
duke@1 | 108 | else |
duke@1 | 109 | ifdef JAVAC_TARGET_ARG |
duke@1 | 110 | ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG) |
duke@1 | 111 | endif |
duke@1 | 112 | endif |
duke@1 | 113 | |
duke@1 | 114 | ifdef ALT_BOOTDIR |
duke@1 | 115 | ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR) |
duke@1 | 116 | ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) |
duke@1 | 117 | endif |
duke@1 | 118 | |
duke@1 | 119 | ifdef ALT_OUTPUTDIR |
duke@1 | 120 | OUTPUTDIR = $(ALT_OUTPUTDIR) |
duke@1 | 121 | ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build |
duke@1 | 122 | ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist |
duke@1 | 123 | else |
duke@1 | 124 | OUTPUTDIR = .. |
duke@1 | 125 | endif |
duke@1 | 126 | #ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR)) |
duke@1 | 127 | ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) |
duke@1 | 128 | |
duke@1 | 129 | ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp |
duke@1 | 130 | ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' |
duke@1 | 131 | |
duke@1 | 132 | ifdef FINDBUGS_HOME |
duke@1 | 133 | ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME) |
duke@1 | 134 | endif |
duke@1 | 135 | |
duke@1 | 136 | ifdef ANT_HOME |
duke@1 | 137 | ANT = $(ANT_HOME)/bin/ant |
duke@1 | 138 | ifneq ($(shell test -x $(ANT) && echo OK), OK) |
duke@1 | 139 | $(error $(ANT) not found -- please update ANT_HOME) |
duke@1 | 140 | endif |
duke@1 | 141 | else |
duke@1 | 142 | ANT = ant |
duke@1 | 143 | ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK) |
duke@1 | 144 | $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH) |
duke@1 | 145 | endif |
duke@1 | 146 | endif |
duke@1 | 147 | |
duke@1 | 148 | # Default target and expected 'do everything' target |
duke@1 | 149 | all: build |
duke@1 | 150 | |
duke@1 | 151 | # Standard make clobber target |
duke@1 | 152 | clobber: clean |
duke@1 | 153 | |
duke@1 | 154 | # All ant targets of interest |
duke@1 | 155 | ANT_TARGETS = build clean sanity post-sanity diagnostics # for now |
duke@1 | 156 | |
duke@1 | 157 | # Create a make target for each |
duke@1 | 158 | $(ANT_TARGETS): |
duke@1 | 159 | @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR) |
duke@1 | 160 | $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log |
duke@1 | 161 | $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@ |
duke@1 | 162 | |
duke@1 | 163 | #------------------------------------------------------------------- |
duke@1 | 164 | # |
duke@1 | 165 | # Targets for Sun's internal JPRT build system |
duke@1 | 166 | |
duke@1 | 167 | CD = cd |
duke@1 | 168 | ZIP = zip |
duke@1 | 169 | |
duke@1 | 170 | JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip |
duke@1 | 171 | |
duke@1 | 172 | jprt_build_product jprt_build_debug jprt_build_fastdebug: all |
duke@1 | 173 | ( $(CD) $(OUTPUTDIR) && \ |
duke@1 | 174 | $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) |
duke@1 | 175 | |
duke@1 | 176 | #------------------------------------------------------------------- |
duke@1 | 177 | |
duke@1 | 178 | # Declare these phony (not filenames) |
duke@1 | 179 | .PHONY: $(ANT_TARGETS) all clobber \ |
duke@1 | 180 | jprt_build_product jprt_build_debug jprt_build_fastdebug |