annotate make/Makefile @ 520:ab11cef1dfaa

Added tag jdk7u21-b07 for changeset 4a9533495068
author katleman
date Tue, 19 Mar 2013 14:33:49 -0700
parents de11bd049d6f
children
rev   line source
duke@0 1 #
ohair@247 2 # Copyright (c) 2007, 2011, 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@149 7 # published by the Free Software Foundation. Oracle designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
ohair@149 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@149 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@149 22 # or visit www.oracle.com if you need additional information or have any
ohair@149 23 # questions.
duke@0 24 #
duke@0 25
ohair@103 26 # Makefile wrapper around Ant build.xml file
duke@0 27
duke@0 28 #
duke@0 29 # On Solaris, the 'make' utility from Sun will not work with these makefiles.
duke@0 30 # This little rule is only understood by Sun's make, and is harmless
duke@0 31 # when seen by the GNU make tool. If using Sun's 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 ifdef QUIET
duke@0 37 ANT_OPTIONS += -quiet
duke@0 38 endif
duke@0 39
duke@0 40 ifdef VERBOSE
duke@0 41 ANT_OPTIONS += -verbose
duke@0 42 endif
duke@0 43
ohair@103 44 ifeq ($(VARIANT), OPT)
ohair@103 45 ifneq ($(DEBUG_CLASSFILES), true)
duke@0 46 ANT_OPTIONS += -Djavac.debug=false
duke@0 47 endif
duke@0 48 endif
duke@0 49
ohair@3 50 # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
duke@0 51 # and the somewhat misnamed CLASS_VERSION (-target NN)
duke@0 52 ifdef TARGET_CLASS_VERSION
duke@0 53 ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
duke@0 54 else
duke@0 55 ifdef JAVAC_TARGET_ARG
duke@0 56 ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
duke@0 57 endif
duke@0 58 endif
duke@0 59
jjg@76 60 ifdef SOURCE_LANGUAGE_VERSION
jjg@76 61 ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
jjg@76 62 else
jjg@76 63 ifdef JAVAC_SOURCE_ARG
jjg@76 64 ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
jjg@76 65 endif
jjg@76 66 endif
jjg@76 67
ohair@158 68 # If downloads are allowed
ohair@158 69 ifeq ($(ALLOW_DOWNLOADS),true)
ohair@158 70 ANT_OPTIONS += -Dallow.downloads=true
ohair@158 71 endif
ohair@158 72
ohair@103 73 # Figure out the platform we are using
ohair@103 74 _SYSTEM_UNAME := $(shell uname)
ohair@103 75 _PLATFORM_KIND = unix
ohair@103 76 ifeq ($(_SYSTEM_UNAME), Windows_NT)
ohair@103 77 _PLATFORM_KIND = windows
duke@0 78 endif
ohair@103 79 ifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
ohair@103 80 _PLATFORM_KIND = windows
ohair@103 81 endif
ohair@103 82
ohair@103 83 # Where is /java in case we need it
ohair@103 84 ifdef ALT_SLASH_JAVA
ohair@103 85 _SLASHJAVA = $(ALT_SLASH_JAVA)
ohair@103 86 else
ohair@103 87 ifeq ($(_PLATFORM_KIND), windows)
ohair@103 88 _SLASHJAVA=J:/
ohair@103 89 else
ohair@103 90 _SLASHJAVA=/java
ohair@103 91 endif
ohair@103 92 endif
ohair@103 93
duke@0 94 ifdef ALT_OUTPUTDIR
duke@0 95 OUTPUTDIR = $(ALT_OUTPUTDIR)
ohair@103 96 ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
duke@0 97 else
duke@0 98 OUTPUTDIR = ..
duke@0 99 endif
duke@0 100
duke@0 101 ifdef ALT_LANGTOOLS_DIST
ohair@103 102 ifdef ALT_BOOTDIR
ohair@103 103 ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
ohair@117 104 ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
ohair@103 105 endif
duke@0 106 ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
ohair@103 107 else
ohair@103 108 ifdef ALT_JDK_IMPORT_PATH
ohair@103 109 ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
ohair@117 110 ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
ohair@103 111 endif
duke@0 112 endif
duke@0 113
duke@0 114 ifdef ANT_HOME
duke@0 115 ANT = $(ANT_HOME)/bin/ant
duke@0 116 ifneq ($(shell test -x $(ANT); echo $$?), 0)
duke@0 117 $(error "$(ANT) not found; please update ANT_HOME")
duke@0 118 endif
duke@0 119 else
duke@0 120 ANT = ant
duke@0 121 ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
ohair@239 122 $(error "'ant' not found; please set ANT_HOME or put 'ant' on your PATH")
duke@0 123 endif
duke@0 124 endif
duke@0 125
duke@0 126 # Default target and expected 'do everything' target
ohair@103 127 default: all
duke@0 128
duke@0 129 # All ant targets of interest
ohair@396 130 ANT_TARGETS = all build dist clobber clean sanity
ohair@396 131
ohair@396 132 # Just for compat reasons, delete in future.
ohair@396 133 drop_included:
ohair@396 134 source:
duke@0 135
duke@0 136 # Create a make target for each
duke@0 137 $(ANT_TARGETS):
ohair@117 138 cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
ohair@103 139 cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
ohair@103 140
ohair@103 141 # Help target
ohair@103 142 define helpenvline
ohair@103 143 @echo " $1";echo " $2"
ohair@103 144 endef
ohair@103 145 help:
ohair@103 146 @echo "----------------------------------------------------------"
ohair@103 147 @echo " "
ohair@103 148 @echo "Help information for this Makefile:"
ohair@103 149 @echo " "
ohair@103 150 @echo " Targets (see ant project information for descriptions):"
ohair@103 151 @echo " $(ANT_TARGETS)"
ohair@103 152 @echo " "
ohair@103 153 @echo " Environment or command line variables (all optional):"
ohair@103 154 $(call helpenvline, ALT_BOOTDIR,\
ohair@103 155 "JAVA_HOME to use when running ant")
ohair@103 156 $(call helpenvline, ALT_LANGTOOLS_DIST,\
ohair@103 157 "path to langtools repository dist directory")
ohair@103 158 $(call helpenvline, ALT_OUTPUTDIR,\
ohair@103 159 "path to root of output")
ohair@103 160 $(call helpenvline, DEBUG_CLASSFILES,\
ohair@103 161 "if set makes sure ant property javac.debug is true")
ohair@103 162 $(call helpenvline, JAVAC_SOURCE_ARG,\
ohair@103 163 "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
ohair@103 164 $(call helpenvline, JAVAC_TARGET_ARG,\
ohair@103 165 "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
ohair@103 166 $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
ohair@103 167 "if set uses this to set ant property javac.source")
ohair@103 168 $(call helpenvline, QUIET,\
ohair@103 169 "if set will pass -quiet to ant")
ohair@103 170 $(call helpenvline, TARGET_CLASS_VERSION,\
ohair@103 171 "JAVA_HOME to use when running ant")
ohair@103 172 $(call helpenvline, VARIANT,\
ohair@103 173 "if set to OPT means optimized build will set javac.debug to false")
ohair@103 174 $(call helpenvline, VERBOSE,\
ohair@103 175 "if set will pass -verbose to ant")
ohair@103 176 @echo " "
ohair@103 177 @echo "----------------------------------------------------------"
ohair@103 178 @echo " "
ohair@103 179 @echo "Ant project file help information:"
ohair@103 180 @echo " "
ohair@103 181 @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
ohair@103 182 @echo " "
ohair@103 183 @echo "----------------------------------------------------------"
duke@0 184
duke@0 185 # Targets for Sun's internal JPRT build system
ohair@3 186 JPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
duke@0 187 jprt_build_product jprt_build_debug jprt_build_fastdebug: all
ohair@3 188 $(RM) $(JPRT_ARCHIVE_BUNDLE)
ohair@3 189 ( cd $(OUTPUTDIR)/dist && \
ohair@3 190 zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
duke@0 191
duke@0 192 # Declare these phony (not filenames)
ohair@103 193 .PHONY: $(ANT_TARGETS) \
duke@0 194 jprt_build_product jprt_build_debug jprt_build_fastdebug