annotate make/Makefile @ 112:38d07d25ab65

6962318: Update copyright year Reviewed-by: andrew
author ohair
date Wed, 22 Dec 2010 20:12:27 -0800
parents 0e4ccb5a0d40
children
rev   line source
duke@0 1 #
ohair@109 2 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
ohair@86 7 # published by the Free Software Foundation. Oracle designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
ohair@86 9 # by Oracle in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
ohair@86 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@86 22 # or visit www.oracle.com if you need additional information or have any
ohair@86 23 # questions.
duke@0 24 #
duke@0 25
duke@0 26 # Makefile for langtools: wrapper around Ant build.xml file
duke@0 27
duke@0 28 #
jjg@89 29 # On Solaris, the standard 'make' utility will not work with these makefiles.
jjg@89 30 # This little rule is only understood by Solaris make, and is harmless
jjg@89 31 # when seen by the GNU make tool. If using Solaris make, this causes the
duke@0 32 # make command to fail.
duke@0 33 #
duke@0 34 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
duke@0 35
duke@0 36 #
duke@0 37 # Minimal platform defs
duke@0 38 # Need FullPath because we can't rely on gnumake abspath, until we use v3.81
duke@0 39 #
duke@0 40
duke@0 41 SYSTEM_UNAME := $(shell uname)
duke@0 42
jjg@99 43 # Where is unwanted output to be delivered?
jjg@99 44 # On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file.
duke@0 45 ifeq ($(SYSTEM_UNAME), Windows_NT)
duke@0 46 DEV_NULL = NUL
duke@0 47 else
jjg@99 48 DEV_NULL = /dev/null
jjg@99 49 endif
jjg@99 50
duke@0 51 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
duke@0 52 USING_CYGWIN = true
duke@0 53 endif
duke@0 54
duke@0 55 ifdef USING_CYGWIN
duke@0 56 define FullPath
duke@0 57 $(shell cygpath -a -s -m $1 2> $(DEV_NULL))
duke@0 58 endef
duke@0 59 else
duke@0 60 define FullPath
duke@0 61 $(shell cd $1 2> $(DEV_NULL) && pwd)
duke@0 62 endef
duke@0 63 endif
duke@0 64
duke@0 65 #
duke@0 66 # Makefile args
duke@0 67 #
duke@0 68
duke@0 69 ifdef QUIET
duke@0 70 ANT_OPTIONS += -quiet
duke@0 71 endif
duke@0 72
duke@0 73 ifdef VERBOSE
andrew@74 74 ANT_OPTIONS += -verbose -debug
duke@0 75 endif
duke@0 76
duke@0 77 ifdef JDK_VERSION
duke@0 78 ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
duke@0 79 endif
duke@0 80
duke@0 81 ifdef FULL_VERSION
duke@0 82 ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
duke@0 83 endif
duke@0 84
duke@0 85 ifdef MILESTONE
jjg@37 86 ifneq ($(MILESTONE),fcs)
duke@0 87 ANT_OPTIONS += -Dmilestone=$(MILESTONE)
jjg@37 88 else
jjg@37 89 ANT_OPTIONS += -Drelease=$(JDK_VERSION)
jjg@37 90 endif
duke@0 91 endif
duke@0 92
duke@0 93 ifdef BUILD_NUMBER
duke@0 94 ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
duke@0 95 else
duke@0 96 ifdef JDK_BUILD_NUMBER
duke@0 97 ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
duke@0 98 endif
duke@0 99 endif
duke@0 100
duke@0 101 ifeq ($(VARIANT), DBG)
duke@0 102 ANT_OPTIONS += -Djavac.debug=true
duke@0 103 else
duke@0 104 ifeq ($(VARIANT), OPT)
duke@0 105 ANT_OPTIONS += -Djavac.debug=false
duke@0 106 endif
duke@0 107 endif
duke@0 108
aph@45 109 ifeq ($(DEBUG_CLASSFILES), true)
jjg@49 110 ANT_OPTIONS += -Djavac.debug=true
aph@45 111 ANT_OPTIONS += -Ddebug.classfiles=true
aph@45 112 endif
aph@45 113
duke@0 114 # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
duke@0 115 # and the somewhat misnamed CLASS_VERSION (-target NN)
duke@0 116 ifdef TARGET_CLASS_VERSION
duke@0 117 ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
duke@0 118 else
duke@0 119 ifdef JAVAC_TARGET_ARG
duke@0 120 ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
duke@0 121 endif
duke@0 122 endif
duke@0 123
jjg@49 124 ifdef SOURCE_LANGUAGE_VERSION
jjg@49 125 ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
jjg@49 126 else
jjg@49 127 ifdef JAVAC_SOURCE_ARG
jjg@49 128 ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
jjg@49 129 endif
jjg@49 130 endif
jjg@49 131
duke@0 132 ifdef ALT_BOOTDIR
duke@0 133 ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR)
duke@0 134 ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
duke@0 135 endif
duke@0 136
duke@0 137 ifdef ALT_OUTPUTDIR
duke@0 138 OUTPUTDIR = $(ALT_OUTPUTDIR)
duke@0 139 ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
duke@0 140 ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
duke@0 141 else
duke@0 142 OUTPUTDIR = ..
duke@0 143 endif
duke@0 144 #ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
duke@0 145 ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
duke@0 146
duke@0 147 ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
duke@0 148 ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
duke@0 149
duke@0 150 ifdef FINDBUGS_HOME
duke@0 151 ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
duke@0 152 endif
duke@0 153
duke@0 154 ifdef ANT_HOME
duke@0 155 ANT = $(ANT_HOME)/bin/ant
duke@0 156 ifneq ($(shell test -x $(ANT) && echo OK), OK)
duke@0 157 $(error $(ANT) not found -- please update ANT_HOME)
duke@0 158 endif
duke@0 159 else
duke@0 160 ANT = ant
duke@0 161 ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
duke@0 162 $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
duke@0 163 endif
duke@0 164 endif
duke@0 165
duke@0 166 # Default target and expected 'do everything' target
duke@0 167 all: build
duke@0 168
duke@0 169 # Standard make clobber target
duke@0 170 clobber: clean
duke@0 171
duke@0 172 # All ant targets of interest
duke@0 173 ANT_TARGETS = build clean sanity post-sanity diagnostics # for now
duke@0 174
ohair@80 175 # Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1)
ohair@80 176 $(OUTPUTDIR)/build/ant-diagnostics.log:
ohair@80 177 @mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
ohair@80 178 @$(RM) $@
ohair@80 179 $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $@ ; \
ohair@80 180 $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -version >> $@
ohair@80 181
duke@0 182 # Create a make target for each
ohair@80 183 $(ANT_TARGETS): $(OUTPUTDIR)/build/ant-diagnostics.log
duke@0 184 @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
duke@0 185 $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
duke@0 186
duke@0 187 #-------------------------------------------------------------------
duke@0 188 #
jjg@89 189 # Targets for Oracle's internal JPRT build system
duke@0 190
duke@0 191 CD = cd
duke@0 192 ZIP = zip
duke@0 193
duke@0 194 JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
duke@0 195
duke@0 196 jprt_build_product jprt_build_debug jprt_build_fastdebug: all
duke@0 197 ( $(CD) $(OUTPUTDIR) && \
duke@0 198 $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
duke@0 199
duke@0 200 #-------------------------------------------------------------------
duke@0 201
duke@0 202 # Declare these phony (not filenames)
duke@0 203 .PHONY: $(ANT_TARGETS) all clobber \
duke@0 204 jprt_build_product jprt_build_debug jprt_build_fastdebug