make/Defs-internal.gmk

Tue, 06 Mar 2012 20:25:18 +0000

author
michaelm
date
Tue, 06 Mar 2012 20:25:18 +0000
changeset 414
84ece503953e
parent 330
7e13dbf7e8af
child 423
4d45c7117e23
permissions
-rw-r--r--

7113349: Initial changeset for Macosx port to jdk
Reviewed-by: jjh, alanb, dholmes, anthony, ohrstrom, ksrini, jrose, weijun, smarks
Contributed-by: Alan Bateman <alan.bateman@oracle.com>, Alexander Potochkin <alexander.potochkin@oracle.com>, Alexander Zuev <alexander.zuev@oracle.com>, Andrew Brygin <andrew.brygin@oracle.com>, Artem Ananiev <artem.ananiev@oracle.com>, Alex Strange <astrange@apple.com>, Bino George <bino@apple.com>, Christine Lu <christine.lu@oracle.com>, David Katleman <david.katleman@oracle.com>, David Durrence <david_durrence@apple.com>, Dmitry Cherepanov <dmitry.cherepanov@oracle.com>, Greg Lewis <glewis@eyesbeyond.com>, Kevin Miller <kevin_m_miller@apple.com>, Kurt Miller <kurt@intricatesoftware.com>, Landon Fuller <landonf@plausiblelabs.com>, Leonid Romanov <leonid.romanov@oracle.com>, Loefty Walkowiak <loefty@apple.com>, Mark Reinhold <mark.reinhold@oracle.com>, Naoto Sato <naoto.sato@oracle.com>, Philip Race <philip.race@oracle.com>, Roger Hoover <rhoover@apple.com>, Scott Kovatch <scott.kovatch@oracle.com>, Sergey ByloKhov <sergey.bylokhov@oracle.com>, Mike Swingler <swingler@apple.com>, Tomas Hurka <tomas.hurka@oracle.com>

duke@2 1 #
ohair@330 2 # Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
duke@2 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@2 4 #
duke@2 5 # This code is free software; you can redistribute it and/or modify it
duke@2 6 # under the terms of the GNU General Public License version 2 only, as
ohair@182 7 # published by the Free Software Foundation. Oracle designates this
duke@2 8 # particular file as subject to the "Classpath" exception as provided
ohair@182 9 # by Oracle in the LICENSE file that accompanied this code.
duke@2 10 #
duke@2 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@2 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@2 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@2 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@2 15 # accompanied this code).
duke@2 16 #
duke@2 17 # You should have received a copy of the GNU General Public License version
duke@2 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@2 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@2 20 #
ohair@182 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@182 22 # or visit www.oracle.com if you need additional information or have any
ohair@182 23 # questions.
duke@2 24 #
duke@2 25
duke@2 26 #
duke@2 27 # Common variables used by all the Java makefiles. This file should
duke@2 28 # not contain rules.
duke@2 29 #
duke@2 30
ohrstrom@313 31 # The build times report is turned off by setting REPORT_BUILD_TIMES to nothing.
ohrstrom@313 32 # This is necessary for the target clobber/clean which will erase the
ohrstrom@313 33 # directories where the buildtimes are stored.
ohrstrom@313 34 REPORT_BUILD_TIMES=1
ohrstrom@313 35 # Store the build times in this directory.
ohrstrom@313 36 BUILDTIMESDIR=$(ABS_OUTPUTDIR)/tmp/buildtimes
ohrstrom@313 37
ohrstrom@313 38 # Record starting time for build of a sub repository.
ohrstrom@313 39 define RecordStartTime
ohrstrom@313 40 $(MKDIR) -p $(BUILDTIMESDIR)
ohrstrom@313 41 $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
ohrstrom@313 42 $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
ohrstrom@313 43 endef
ohrstrom@313 44
ohrstrom@313 45 # Indicate that we started to build a sub repository and record starting time.
ohair@128 46 define MakeStart
ohrstrom@313 47 $(call RecordStartTime,$1)
ohrstrom@313 48 $(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \
ohair@128 49 "########################################################################" \
ohair@128 50 "########################################################################" \
ohrstrom@313 51 "Entering $1 for target(s) $2" \
ohair@128 52 "########################################################################"
ohair@128 53 endef
ohair@128 54
ohrstrom@313 55 # Record ending time and calculate the difference and store it in a
ohrstrom@313 56 # easy to read format. Handles builds that cross midnight. Expects
ohrstrom@313 57 # that a build will never take 24 hours or more.
ohrstrom@313 58 define RecordEndTime
ohrstrom@313 59 $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
ohrstrom@313 60 $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
ohrstrom@313 61 $(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
ohrstrom@313 62 $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
ohrstrom@313 63 M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
ohrstrom@313 64 > $(BUILDTIMESDIR)/build_time_diff_$1
ohrstrom@313 65 endef
ohrstrom@313 66
ohrstrom@313 67 # Indicate that we are done.
ohrstrom@313 68 # Record ending time and print out the total time it took to build.
ohrstrom@313 69 define MakeFinish
ohrstrom@313 70 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),)
ohrstrom@313 71 $(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \
ohair@128 72 "########################################################################" \
ohrstrom@313 73 "Leaving $1 for target(s) $2" \
ohair@128 74 "########################################################################" \
ohrstrom@313 75 $(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
ohrstrom@313 76 "########################################################################"
ohrstrom@313 77 endef
ohrstrom@313 78
ohrstrom@313 79 # Find all build_time_* files and print their contents in a list sorted
ohrstrom@313 80 # on the name of the sub repository.
ohrstrom@313 81 define ReportBuildTimes
michaelm@414 82 $(PRINTF) -- "-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
ohrstrom@313 83 $1 \
ohrstrom@313 84 "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
ohrstrom@313 85 "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
ohrstrom@313 86 "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
ohrstrom@313 87 "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
ohair@128 88 endef
ohair@128 89
ohair@9 90 ifdef OPENJDK
ohair@9 91 ifneq ($(OPENJDK),true)
ohair@9 92 x:=$(error "OPENJDK (if defined) can only be set to true")
ohair@9 93 endif
ohair@9 94 endif
ohair@9 95
duke@2 96 # Define absolute paths to TOPDIRs
duke@2 97 ABS_LANGTOOLS_TOPDIR:=$(call OptFullPath,"$(LANGTOOLS_TOPDIR)")
duke@2 98 ABS_CORBA_TOPDIR:=$(call OptFullPath,"$(CORBA_TOPDIR)")
duke@2 99 ABS_JAXP_TOPDIR:=$(call OptFullPath,"$(JAXP_TOPDIR)")
duke@2 100 ABS_JAXWS_TOPDIR:=$(call OptFullPath,"$(JAXWS_TOPDIR)")
duke@2 101 ABS_JDK_TOPDIR:=$(call OptFullPath,"$(JDK_TOPDIR)")
duke@2 102 ABS_HOTSPOT_TOPDIR:=$(call OptFullPath,"$(HOTSPOT_TOPDIR)")
duke@2 103 ABS_INSTALL_TOPDIR:=$(call OptFullPath,"$(INSTALL_TOPDIR)")
duke@2 104 ABS_SPONSORS_TOPDIR:=$(call OptFullPath,"$(SPONSORS_TOPDIR)")
duke@2 105 ABS_DEPLOY_TOPDIR:=$(call OptFullPath,"$(DEPLOY_TOPDIR)")
duke@2 106
duke@2 107 # Macro to return true or false if a file exists and is readable
duke@2 108 define MkExists
duke@2 109 $(shell if [ -r $1 ]; then $(ECHO) true; else $(ECHO) false; fi)
duke@2 110 endef
duke@2 111
duke@2 112 HOTSPOT_SRC_AVAILABLE := $(call MkExists,$(HOTSPOT_TOPDIR)/make/Makefile)
duke@2 113 ifndef BUILD_HOTSPOT
duke@2 114 ifdef ALT_HOTSPOT_IMPORT_PATH
duke@2 115 BUILD_HOTSPOT := false
duke@2 116 else
duke@2 117 BUILD_HOTSPOT := $(HOTSPOT_SRC_AVAILABLE)
duke@2 118 endif
duke@2 119 endif
duke@2 120
duke@2 121 LANGTOOLS_SRC_AVAILABLE := $(call MkExists,$(LANGTOOLS_TOPDIR)/make/Makefile)
duke@2 122 ifndef BUILD_LANGTOOLS
duke@2 123 ifdef ALT_LANGTOOLS_DIST
duke@2 124 BUILD_LANGTOOLS := false
duke@2 125 else
duke@2 126 BUILD_LANGTOOLS := $(LANGTOOLS_SRC_AVAILABLE)
duke@2 127 endif
duke@2 128 endif
duke@2 129
duke@2 130 CORBA_SRC_AVAILABLE := $(call MkExists,$(CORBA_TOPDIR)/make/Makefile)
duke@2 131 ifndef BUILD_CORBA
duke@2 132 ifdef ALT_CORBA_DIST
duke@2 133 BUILD_CORBA := false
duke@2 134 else
duke@2 135 BUILD_CORBA := $(CORBA_SRC_AVAILABLE)
duke@2 136 endif
duke@2 137 endif
duke@2 138
duke@2 139 JAXP_SRC_AVAILABLE := $(call MkExists,$(JAXP_TOPDIR)/make/Makefile)
duke@2 140 ifndef BUILD_JAXP
duke@2 141 ifdef ALT_JAXP_DIST
duke@2 142 BUILD_JAXP := false
duke@2 143 else
duke@2 144 BUILD_JAXP := $(JAXP_SRC_AVAILABLE)
duke@2 145 endif
duke@2 146 endif
duke@2 147
duke@2 148 JAXWS_SRC_AVAILABLE := $(call MkExists,$(JAXWS_TOPDIR)/make/Makefile)
duke@2 149 ifndef BUILD_JAXWS
duke@2 150 ifdef ALT_JAXWS_DIST
duke@2 151 BUILD_JAXWS := false
duke@2 152 else
duke@2 153 BUILD_JAXWS := $(JAXWS_SRC_AVAILABLE)
duke@2 154 endif
duke@2 155 endif
duke@2 156
duke@2 157 JDK_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/make/Makefile)
duke@2 158 ifndef BUILD_JDK
duke@2 159 BUILD_JDK := $(JDK_SRC_AVAILABLE)
duke@2 160 endif
duke@2 161 ifeq ($(JDK_SRC_AVAILABLE),true)
duke@2 162 JDK_CLOSED_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/src/closed)
ohair@9 163 ifeq ($(JDK_CLOSED_SRC_AVAILABLE),false)
ohair@9 164 OPENJDK = true
duke@2 165 endif
duke@2 166 endif
duke@2 167
duke@2 168 DEPLOY_SRC_AVAILABLE := $(call MkExists,$(DEPLOY_TOPDIR)/make/Makefile)
duke@2 169 ifndef BUILD_DEPLOY
duke@2 170 BUILD_DEPLOY := $(DEPLOY_SRC_AVAILABLE)
duke@2 171 endif
duke@2 172
duke@2 173 INSTALL_SRC_AVAILABLE := $(call MkExists,$(INSTALL_TOPDIR)/make/Makefile)
duke@2 174 ifndef BUILD_INSTALL
duke@2 175 ifdef DEV_ONLY
duke@2 176 BUILD_INSTALL := false
duke@2 177 else
duke@2 178 BUILD_INSTALL := $(INSTALL_SRC_AVAILABLE)
duke@2 179 endif
duke@2 180 endif
duke@2 181
duke@2 182 SPONSORS_SRC_AVAILABLE := $(call MkExists,$(SPONSORS_TOPDIR)/make/Makefile)
duke@2 183 ifndef BUILD_SPONSORS
duke@2 184 ifdef DEV_ONLY
duke@2 185 BUILD_SPONSORS := false
duke@2 186 else
duke@2 187 BUILD_SPONSORS := $(SPONSORS_SRC_AVAILABLE)
duke@2 188 endif
duke@2 189 endif
duke@2 190
duke@2 191
ohair@288 192 # Do we build the source bundles?
duke@2 193 BUNDLE_RULES = $(JDK_TOPDIR)/make/closed/bundles.gmk
wetmore@122 194 ifeq ($(SKIP_BUNDLES_BUILD), true)
wetmore@122 195 BUNDLE_RULES_AVAILABLE := false
wetmore@122 196 else
wetmore@122 197 BUNDLE_RULES_AVAILABLE := $(call MkExists,$(BUNDLE_RULES))
wetmore@122 198 endif
duke@2 199
duke@2 200 # Current things we do NOT build for OPENJDK
duke@2 201 ifdef OPENJDK
duke@2 202 BUILD_DEPLOY = false
duke@2 203 BUILD_INSTALL = false
duke@2 204 BUILD_SPONSORS = false
duke@2 205 BUNDLE_RULES_AVAILABLE := false
duke@2 206 # These could be over-ridden on the command line or in environment
duke@2 207 ifndef SKIP_FASTDEBUG_BUILD
duke@2 208 SKIP_FASTDEBUG_BUILD = true
duke@2 209 endif
duke@2 210 ifndef SKIP_DEBUG_BUILD
duke@2 211 SKIP_DEBUG_BUILD = true
duke@2 212 endif
duke@2 213 ifndef SKIP_COMPARE_IMAGES
duke@2 214 SKIP_COMPARE_IMAGES = true
duke@2 215 endif
duke@2 216 else
ohair@102 217
ohair@102 218 # Various non-OPENJDK reasons to NOT build the deploy repository
ohair@102 219 ifeq ($(ARCH), ia64)
ohair@102 220 BUILD_DEPLOY=false
ohair@102 221 endif
ohair@102 222 ifeq ($(ARCH), sparcv9)
ohair@102 223 BUILD_DEPLOY=false
ohair@102 224 endif
ohair@102 225 ifeq ($(ARCH), amd64)
ohair@102 226 ifeq ($(PLATFORM), solaris)
ohair@102 227 BUILD_DEPLOY=false
ohair@102 228 endif
ohair@102 229 endif
ohair@102 230
duke@2 231 endif
ohair@29 232 ifndef SKIP_PRODUCT_BUILD
ohair@29 233 SKIP_PRODUCT_BUILD = false
ohair@29 234 endif
duke@2 235
duke@2 236 # Many reasons why we would want to skip the comparison to previous jdk
duke@2 237 ifndef SKIP_COMPARE_IMAGES
duke@2 238 ifeq ($(BUILD_JDK), false)
duke@2 239 SKIP_COMPARE_IMAGES = true
duke@2 240 endif
duke@2 241 ifeq ($(BUILD_DEPLOY), false)
duke@2 242 SKIP_COMPARE_IMAGES = true
duke@2 243 endif
duke@2 244 ifeq ($(BUILD_INSTALL), false)
duke@2 245 SKIP_COMPARE_IMAGES = true
duke@2 246 endif
duke@2 247 ifdef DEV_ONLY
duke@2 248 SKIP_COMPARE_IMAGES = true
duke@2 249 endif
duke@2 250 endif
duke@2 251
duke@2 252 # Select defaults if these are not set to true or false
duke@2 253 ifndef SKIP_DEBUG_BUILD
duke@2 254 SKIP_DEBUG_BUILD=true
duke@2 255 endif
duke@2 256 ifndef SKIP_FASTDEBUG_BUILD
ohair@296 257 SKIP_FASTDEBUG_BUILD=true
duke@2 258 endif
duke@2 259
ohair@144 260 # Select javadoc setting GENERATE_DOCS
ohair@144 261 ifndef NO_DOCS
ohair@144 262 # Default value (we want javadoc run)
ohair@144 263 GENERATE_DOCS=true
andrew@151 264 # No DOCS build when JDK_UPDATE_VERSION set on non-OPENJDK builds
andrew@151 265 ifndef OPENJDK
andrew@151 266 ifdef JDK_UPDATE_VERSION
andrew@151 267 GENERATE_DOCS=false
andrew@151 268 endif
ohair@144 269 endif
ohair@144 270 # If langtools, corba, jaxp, and jaxws are not being built,
ohair@144 271 # a full jdk javadoc is not possible
ohair@144 272 ifneq ($(BUILD_LANGTOOLS), true)
ohair@144 273 GENERATE_DOCS=false
ohair@144 274 endif
ohair@144 275 ifneq ($(BUILD_CORBA), true)
ohair@144 276 GENERATE_DOCS=false
ohair@144 277 endif
ohair@144 278 ifneq ($(BUILD_JAXP), true)
ohair@144 279 GENERATE_DOCS=false
ohair@144 280 endif
ohair@144 281 ifneq ($(BUILD_JAXWS), true)
ohair@144 282 GENERATE_DOCS=false
ohair@144 283 endif
ohair@144 284 ifeq ($(GENERATE_DOCS),false)
ohair@144 285 NO_DOCS=true
ohair@144 286 endif
ohair@144 287 else
ohair@144 288 GENERATE_DOCS=false
ohair@144 289 endif
ohair@144 290
duke@2 291 # Output directory for hotspot build
duke@2 292 HOTSPOT_DIR = $(ABS_OUTPUTDIR)/hotspot
duke@2 293
duke@2 294 # If we are building components
duke@2 295 ifndef ALT_LANGTOOLS_DIST
duke@2 296 LANGTOOLS_OUTPUTDIR = $(ABS_OUTPUTDIR)/langtools
duke@2 297 ABS_LANGTOOLS_DIST = $(LANGTOOLS_OUTPUTDIR)/dist
duke@2 298 endif
duke@2 299 ifndef ALT_CORBA_DIST
duke@2 300 CORBA_OUTPUTDIR = $(ABS_OUTPUTDIR)/corba
duke@2 301 ABS_CORBA_DIST = $(CORBA_OUTPUTDIR)/dist
duke@2 302 endif
duke@2 303 ifndef ALT_JAXP_DIST
duke@2 304 JAXP_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxp
duke@2 305 ABS_JAXP_DIST = $(JAXP_OUTPUTDIR)/dist
duke@2 306 endif
duke@2 307 ifndef ALT_JAXWS_DIST
duke@2 308 JAXWS_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxws
duke@2 309 ABS_JAXWS_DIST = $(JAXWS_OUTPUTDIR)/dist
duke@2 310 endif
duke@2 311
duke@2 312 # Common make arguments (supplied to all component builds)
duke@2 313 COMMON_BUILD_ARGUMENTS = \
duke@2 314 JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
duke@2 315 JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
duke@2 316 EXTERNALSANITYCONTROL=true \
jjg@87 317 SOURCE_LANGUAGE_VERSION=$(SOURCE_LANGUAGE_VERSION) \
duke@2 318 TARGET_CLASS_VERSION=$(TARGET_CLASS_VERSION) \
duke@2 319 MILESTONE=$(MILESTONE) \
duke@2 320 BUILD_NUMBER=$(BUILD_NUMBER) \
duke@2 321 JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) \
duke@2 322 FULL_VERSION=$(FULL_VERSION) \
duke@2 323 PREVIOUS_JDK_VERSION=$(PREVIOUS_JDK_VERSION) \
duke@2 324 JDK_VERSION=$(JDK_VERSION) \
duke@2 325 JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
duke@2 326 JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
duke@2 327 JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
martin@17 328 JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
martin@17 329 PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
martin@17 330 PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
martin@17 331 PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
duke@2 332
duke@2 333 ifdef ARCH_DATA_MODEL
duke@2 334 COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
duke@2 335 endif
duke@2 336
duke@2 337 ifeq ($(DEBUG_NAME), debug)
duke@2 338 COMMON_BUILD_ARGUMENTS += VARIANT=DBG DEBUG_CLASSFILES=true
duke@2 339 endif
duke@2 340
duke@2 341 ifeq ($(DEBUG_NAME), fastdebug)
duke@2 342 COMMON_BUILD_ARGUMENTS += VARIANT=DBG FASTDEBUG=true DEBUG_CLASSFILES=true
duke@2 343 endif
duke@2 344
duke@2 345 ifdef COOKED_JDK_UPDATE_VERSION
duke@2 346 COMMON_BUILD_ARGUMENTS += COOKED_JDK_UPDATE_VERSION=$(COOKED_JDK_UPDATE_VERSION)
duke@2 347 endif
duke@2 348
duke@2 349 ifdef COOKED_BUILD_NUMBER
duke@2 350 COMMON_BUILD_ARGUMENTS += COOKED_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
duke@2 351 endif
duke@2 352
duke@2 353 ifdef ANT_HOME
duke@2 354 COMMON_BUILD_ARGUMENTS += ANT_HOME="$(ANT_HOME)"
duke@2 355 endif
duke@2 356

mercurial