J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 2 | # Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | # |
| 5 | # This code is free software; you can redistribute it and/or modify it |
| 6 | # under the terms of the GNU General Public License version 2 only, as |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 10 | # |
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | # version 2 for more details (a copy is included in the LICENSE file that |
| 15 | # accompanied this code). |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License version |
| 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | # |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | # or visit www.oracle.com if you need additional information or have any |
| 23 | # questions. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 24 | # |
| 25 | |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 26 | # If NEWBUILD is defined, use the new build-infra Makefiles and configure. |
| 27 | # See NewMakefile.gmk for more information. |
| 28 | |
Kelly O'Hair | ec348ed | 2013-01-04 21:04:03 -0800 | [diff] [blame^] | 29 | # If not specified, select what the default build is |
| 30 | ifndef NEWBUILD |
| 31 | NEWBUILD=true |
| 32 | endif |
| 33 | |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 34 | ifeq ($(NEWBUILD),true) |
| 35 | |
| 36 | # The new top level Makefile |
| 37 | include NewMakefile.gmk |
| 38 | |
| 39 | else # Original Makefile logic |
| 40 | |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 41 | BUILD_PARENT_DIRECTORY=. |
| 42 | |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 43 | # Basename of any originally supplied ALT_OUTPUTDIR directory |
| 44 | ifndef ORIG_OUTPUTDIR_BASENAME |
| 45 | ifdef ALT_OUTPUTDIR |
| 46 | ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR)) |
| 47 | else |
| 48 | ORIG_OUTPUTDIR_BASENAME = $(PLATFORM)-$(ARCH) |
| 49 | endif |
| 50 | endif |
| 51 | export ORIG_OUTPUTDIR_BASENAME |
| 52 | |
| 53 | # The three possible directories created for output (3 build flavors) |
| 54 | OUTPUTDIR_BASENAME- = $(ORIG_OUTPUTDIR_BASENAME) |
| 55 | OUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug |
| 56 | OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug |
| 57 | |
| 58 | # Relative path to a debug output area |
| 59 | REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME)) |
| 60 | |
| 61 | # The created jdk image directory |
| 62 | JDK_IMAGE_DIRNAME = j2sdk-image |
| 63 | JDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME) |
| 64 | ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME) |
| 65 | |
| 66 | # Relative path from an output directory to the image directory |
| 67 | REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME) |
| 68 | REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME) |
| 69 | REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME) |
| 70 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 71 | ifndef TOPDIR |
Kelly O'Hair | fb56a9a | 2008-03-25 14:38:56 -0700 | [diff] [blame] | 72 | TOPDIR:=. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 73 | endif |
| 74 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 75 | ifndef JDK_TOPDIR |
| 76 | JDK_TOPDIR=$(TOPDIR)/jdk |
| 77 | endif |
| 78 | ifndef JDK_MAKE_SHARED_DIR |
| 79 | JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared |
| 80 | endif |
| 81 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 82 | default: all |
| 83 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 84 | include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 85 | include ./make/Defs-internal.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 86 | include ./make/sanity-rules.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 87 | include ./make/hotspot-rules.gmk |
| 88 | include ./make/langtools-rules.gmk |
| 89 | include ./make/corba-rules.gmk |
| 90 | include ./make/jaxp-rules.gmk |
| 91 | include ./make/jaxws-rules.gmk |
| 92 | include ./make/jdk-rules.gmk |
| 93 | include ./make/install-rules.gmk |
| 94 | include ./make/sponsors-rules.gmk |
| 95 | include ./make/deploy-rules.gmk |
| 96 | |
Kelly O'Hair | 88990fd | 2011-01-05 17:24:58 -0800 | [diff] [blame] | 97 | all:: sanity |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 98 | |
| 99 | ifeq ($(SKIP_FASTDEBUG_BUILD), false) |
| 100 | all:: fastdebug_build |
| 101 | endif |
| 102 | |
| 103 | ifeq ($(SKIP_DEBUG_BUILD), false) |
| 104 | all:: debug_build |
| 105 | endif |
| 106 | |
Kelly O'Hair | 179908e | 2008-08-17 09:56:25 -0700 | [diff] [blame] | 107 | all:: all_product_build |
| 108 | |
Kelly O'Hair | c64ee49 | 2011-03-09 16:26:38 -0800 | [diff] [blame] | 109 | all_product_build:: |
| 110 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 111 | # Everything for a full product build |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 112 | ifeq ($(SKIP_PRODUCT_BUILD), false) |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 113 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 114 | all_product_build:: product_build |
| 115 | |
| 116 | ifeq ($(BUILD_INSTALL), true) |
| 117 | all_product_build:: $(INSTALL) |
| 118 | clobber:: install-clobber |
| 119 | endif |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 120 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 121 | ifeq ($(BUILD_SPONSORS), true) |
| 122 | all_product_build:: $(SPONSORS) |
| 123 | clobber:: sponsors-clobber |
| 124 | endif |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 125 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 126 | ifneq ($(SKIP_COMPARE_IMAGES), true) |
| 127 | all_product_build:: compare-image |
| 128 | endif |
| 129 | |
| 130 | endif |
| 131 | |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 132 | define StartTimer |
| 133 | $(MKDIR) -p $(BUILDTIMESDIR) |
| 134 | $(RM) $(BUILDTIMESDIR)/build_time_* |
| 135 | $(call RecordStartTime,TOTAL) |
| 136 | endef |
| 137 | |
| 138 | define StopTimer |
| 139 | $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),) |
| 140 | endef |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 141 | |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 142 | # Generic build of basic repo series |
Kelly O'Hair | 4231fbb | 2011-04-26 16:30:00 -0700 | [diff] [blame] | 143 | generic_build_repo_series:: $(SOURCE_TIPS) |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 144 | $(MKDIR) -p $(JDK_IMAGE_DIR) |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 145 | @$(call StartTimer) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 146 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 147 | ifeq ($(BUILD_LANGTOOLS), true) |
| 148 | generic_build_repo_series:: langtools |
| 149 | clobber:: langtools-clobber |
| 150 | endif |
| 151 | |
| 152 | ifeq ($(BUILD_CORBA), true) |
| 153 | generic_build_repo_series:: corba |
| 154 | clobber:: corba-clobber |
| 155 | endif |
| 156 | |
| 157 | ifeq ($(BUILD_JAXP), true) |
| 158 | generic_build_repo_series:: jaxp |
| 159 | clobber:: jaxp-clobber |
| 160 | endif |
| 161 | |
| 162 | ifeq ($(BUILD_JAXWS), true) |
| 163 | generic_build_repo_series:: jaxws |
| 164 | clobber:: jaxws-clobber |
| 165 | endif |
| 166 | |
| 167 | ifeq ($(BUILD_HOTSPOT), true) |
| 168 | generic_build_repo_series:: $(HOTSPOT) |
| 169 | clobber:: hotspot-clobber |
| 170 | endif |
| 171 | |
| 172 | ifeq ($(BUILD_JDK), true) |
| 173 | generic_build_repo_series:: $(JDK_JAVA_EXE) |
| 174 | clobber:: jdk-clobber |
| 175 | endif |
| 176 | |
| 177 | ifeq ($(BUILD_DEPLOY), true) |
| 178 | generic_build_repo_series:: $(DEPLOY) |
| 179 | clobber:: deploy-clobber |
| 180 | endif |
| 181 | |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 182 | generic_build_repo_series:: |
| 183 | @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build)) |
| 184 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 185 | # The debug build, fastdebug or debug. Needs special handling. |
| 186 | # Note that debug builds do NOT do INSTALL steps, but must be done |
| 187 | # after the product build and before the INSTALL step of the product build. |
| 188 | # |
| 189 | # DEBUG_NAME is fastdebug or debug |
| 190 | # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 191 | # The resulting image directory (j2sdk-image) is used by the install makefiles |
| 192 | # to create a debug install bundle jdk-*-debug-** bundle (tar or zip) |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 193 | # which will install in the debug or fastdebug subdirectory of the |
| 194 | # normal product install area. |
| 195 | # The install process needs to know what the DEBUG_NAME is, so |
| 196 | # look for INSTALL_DEBUG_NAME in the install rules. |
| 197 | # |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 198 | # NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME). |
| 199 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
| 200 | # not be the same location. |
| 201 | # |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 202 | |
| 203 | # Location of fresh bootdir output |
| 204 | ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 205 | FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME) |
| 206 | FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR) |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 207 | |
| 208 | create_fresh_product_bootdir: FRC |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 209 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 210 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 211 | BOOT_CYCLE_SETTINGS= \ |
| 212 | build_product_image |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 213 | |
| 214 | create_fresh_debug_bootdir: FRC |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 215 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 216 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 217 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 218 | build_debug_image |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 219 | |
| 220 | create_fresh_fastdebug_bootdir: FRC |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 221 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 222 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 223 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 224 | build_fastdebug_image |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 225 | |
| 226 | # Create boot image? |
| 227 | ifeq ($(SKIP_BOOT_CYCLE),false) |
| 228 | ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
| 229 | DO_BOOT_CYCLE=true |
| 230 | endif |
| 231 | endif |
| 232 | |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 233 | |
| 234 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 235 | ifeq ($(DO_BOOT_CYCLE),true) |
| 236 | |
| 237 | # Create the bootdir to use in the build |
| 238 | product_build:: create_fresh_product_bootdir |
| 239 | debug_build:: create_fresh_debug_bootdir |
| 240 | fastdebug_build:: create_fresh_fastdebug_bootdir |
| 241 | |
| 242 | # Define variables to be used now for the boot jdk |
| 243 | BOOT_CYCLE_SETTINGS= \ |
| 244 | ALT_BOOTDIR=$(FRESH_BOOTDIR) \ |
| 245 | ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR) |
| 246 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 247 | ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \ |
| 248 | ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR) |
| 249 | |
| 250 | else |
| 251 | |
| 252 | # Use the supplied ALT_BOOTDIR as the boot |
| 253 | BOOT_CYCLE_SETTINGS= |
| 254 | BOOT_CYCLE_DEBUG_SETTINGS= |
| 255 | |
| 256 | endif |
| 257 | |
| 258 | build_product_image: |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 259 | $(MAKE) \ |
| 260 | SKIP_FASTDEBUG_BUILD=true \ |
| 261 | SKIP_DEBUG_BUILD=true \ |
| 262 | $(BOOT_CYCLE_SETTINGS) \ |
| 263 | generic_build_repo_series |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 264 | |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 265 | # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). |
| 266 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
| 267 | # not be the same location. |
| 268 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 269 | generic_debug_build: |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 270 | $(MAKE) \ |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 271 | ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 272 | DEBUG_NAME=$(DEBUG_NAME) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 273 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 274 | $(BOOT_CYCLE_DEBUG_SETTINGS) \ |
| 275 | generic_build_repo_series |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 276 | |
| 277 | build_debug_image: |
| 278 | $(MAKE) DEBUG_NAME=debug generic_debug_build |
| 279 | |
| 280 | build_fastdebug_image: |
| 281 | $(MAKE) DEBUG_NAME=fastdebug generic_debug_build |
| 282 | |
| 283 | # Build final image |
| 284 | product_build:: build_product_image |
| 285 | debug_build:: build_debug_image |
| 286 | fastdebug_build:: build_fastdebug_image |
| 287 | |
Kelly O'Hair | 4231fbb | 2011-04-26 16:30:00 -0700 | [diff] [blame] | 288 | # The source tips are stored with the relative path to the repo. |
| 289 | # This file will be used when constructing the jdk image. |
| 290 | source_tips: $(SOURCE_TIPS) |
| 291 | $(CAT) $< |
| 292 | $(SOURCE_TIPS): FRC |
| 293 | @$(prep-target) |
| 294 | @$(call GetSourceTips) |
| 295 | |
Fredrik Öhrström | 4eb6876 | 2011-02-28 10:56:10 +0100 | [diff] [blame] | 296 | clobber:: REPORT_BUILD_TIMES= |
| 297 | clobber:: |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 298 | $(RM) -r $(OUTPUTDIR)/* |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 299 | -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) |
| 300 | |
| 301 | clean: clobber |
| 302 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 303 | # |
| 304 | # Dev builds |
| 305 | # |
| 306 | |
| 307 | dev : dev-build |
| 308 | |
| 309 | dev-build: |
| 310 | $(MAKE) DEV_ONLY=true all |
| 311 | dev-sanity: |
| 312 | $(MAKE) DEV_ONLY=true sanity |
| 313 | dev-clobber: |
| 314 | $(MAKE) DEV_ONLY=true clobber |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 315 | |
| 316 | # |
| 317 | # Quick jdk verification build |
| 318 | # |
| 319 | jdk_only: |
| 320 | $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all |
| 321 | |
| 322 | |
| 323 | # |
| 324 | # Quick jdk verification fastdebug build |
| 325 | # |
| 326 | jdk_fastdebug_only: |
| 327 | $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \ |
| 328 | BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build |
| 329 | |
| 330 | # |
| 331 | # Quick deploy verification fastdebug build |
| 332 | # |
| 333 | deploy_fastdebug_only: |
| 334 | $(MAKE) \ |
| 335 | DEBUG_NAME=fastdebug \ |
| 336 | BUILD_HOTSPOT=false \ |
| 337 | BUILD_JDK=false \ |
| 338 | BUILD_LANGTOOLS=false \ |
| 339 | BUILD_CORBA=false \ |
| 340 | BUILD_JAXP=false \ |
| 341 | BUILD_JAXWS=false \ |
| 342 | BUILD_INSTALL=false \ |
| 343 | BUILD_SPONSORS=false \ |
| 344 | generic_debug_build |
| 345 | |
| 346 | # |
| 347 | # Product build (skip debug builds) |
| 348 | # |
| 349 | product_only: |
| 350 | $(MAKE) SKIP_FASTDEBUG_BUILD=true all |
| 351 | |
| 352 | # |
| 353 | # Check target |
| 354 | # |
| 355 | |
| 356 | check: variable_check |
| 357 | |
| 358 | # |
| 359 | # Help target |
| 360 | # |
| 361 | help: intro_help target_help variable_help notes_help examples_help |
| 362 | |
| 363 | # Intro help message |
| 364 | intro_help: |
| 365 | @$(ECHO) "\ |
| 366 | Makefile for the JDK builds (all the JDK). \n\ |
| 367 | " |
| 368 | |
| 369 | # Target help |
| 370 | target_help: |
| 371 | @$(ECHO) "\ |
| 372 | --- Common Targets --- \n\ |
| 373 | all -- build the core JDK (default target) \n\ |
| 374 | help -- Print out help information \n\ |
| 375 | check -- Check make variable values for correctness \n\ |
| 376 | sanity -- Perform detailed sanity checks on system and settings \n\ |
| 377 | fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\ |
| 378 | debug_build -- build the core JDK in 'debug' mode (-g) \n\ |
| 379 | clean -- remove all built and imported files \n\ |
| 380 | clobber -- same as clean \n\ |
| 381 | " |
| 382 | |
| 383 | # Variable help (only common ones used by this Makefile) |
| 384 | variable_help: variable_help_intro variable_list variable_help_end |
| 385 | variable_help_intro: |
| 386 | @$(ECHO) "--- Common Variables ---" |
| 387 | variable_help_end: |
| 388 | @$(ECHO) " " |
| 389 | |
| 390 | # One line descriptions for the variables |
| 391 | OUTPUTDIR.desc = Output directory |
| 392 | PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count |
| 393 | SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: |
| 394 | BOOTDIR.desc = JDK used to boot the build |
| 395 | JDK_IMPORT_PATH.desc = JDK used to import components of the build |
| 396 | COMPILER_PATH.desc = Compiler install directory |
| 397 | CACERTS_FILE.desc = Location of certificates file |
| 398 | DEVTOOLS_PATH.desc = Directory containing zip and gnumake |
| 399 | CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files |
| 400 | DXSDK_PATH.desc = Root directory of DirectX SDK |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 401 | |
| 402 | # Make variables to print out (description and value) |
| 403 | VARIABLE_PRINTVAL_LIST += \ |
| 404 | OUTPUTDIR \ |
| 405 | PARALLEL_COMPILE_JOBS \ |
| 406 | SLASH_JAVA \ |
| 407 | BOOTDIR \ |
| 408 | JDK_IMPORT_PATH \ |
| 409 | COMPILER_PATH \ |
| 410 | CACERTS_FILE \ |
| 411 | DEVTOOLS_PATH |
| 412 | |
| 413 | # Make variables that should refer to directories that exist |
| 414 | VARIABLE_CHECKDIR_LIST += \ |
| 415 | SLASH_JAVA \ |
| 416 | BOOTDIR \ |
| 417 | JDK_IMPORT_PATH \ |
| 418 | COMPILER_PATH \ |
| 419 | DEVTOOLS_PATH |
| 420 | |
| 421 | # Make variables that should refer to files that exist |
| 422 | VARIABLE_CHECKFIL_LIST += \ |
| 423 | CACERTS_FILE |
| 424 | |
| 425 | # Some are windows specific |
| 426 | ifeq ($(PLATFORM), windows) |
| 427 | |
| 428 | VARIABLE_PRINTVAL_LIST += \ |
Kelly O'Hair | 5ef33b6 | 2011-01-14 14:04:19 -0800 | [diff] [blame] | 429 | DXSDK_PATH |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 430 | |
| 431 | VARIABLE_CHECKDIR_LIST += \ |
Kelly O'Hair | 5ef33b6 | 2011-01-14 14:04:19 -0800 | [diff] [blame] | 432 | DXSDK_PATH |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 433 | |
| 434 | endif |
| 435 | |
| 436 | # For pattern rules below, so all are treated the same |
| 437 | DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval) |
| 438 | DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir) |
| 439 | DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil) |
| 440 | |
| 441 | # Complete variable check |
| 442 | variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST) |
| 443 | variable_list: $(DO_PRINTVAL_LIST) variable_check |
| 444 | |
| 445 | # Pattern rule for printing out a variable |
| 446 | %.printval: |
| 447 | @$(ECHO) " ALT_$* - $($*.desc)" |
| 448 | @$(ECHO) " \t $*=$($*)" |
| 449 | |
| 450 | # Pattern rule for checking to see if a variable with a directory exists |
| 451 | %.checkdir: |
| 452 | @if [ ! -d $($*) ] ; then \ |
| 453 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 454 | fi |
| 455 | |
| 456 | # Pattern rule for checking to see if a variable with a file exists |
| 457 | %.checkfil: |
| 458 | @if [ ! -f $($*) ] ; then \ |
| 459 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 460 | fi |
| 461 | |
| 462 | # Misc notes on help |
| 463 | notes_help: |
| 464 | @$(ECHO) "\ |
| 465 | --- Notes --- \n\ |
| 466 | - All builds use same output directory unless overridden with \n\ |
| 467 | \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\ |
| 468 | \t to use the clean target first. \n\ |
| 469 | - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\ |
| 470 | \t builds or previous release JDK builds will work. \n\ |
| 471 | - The fastest builds have been when the sources and the BOOTDIR are on \n\ |
| 472 | \t local disk. \n\ |
| 473 | " |
| 474 | |
| 475 | examples_help: |
| 476 | @$(ECHO) "\ |
| 477 | --- Examples --- \n\ |
| 478 | $(MAKE) fastdebug_build \n\ |
| 479 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 480 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\ |
| 481 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 482 | $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\ |
| 483 | $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\ |
| 484 | " |
| 485 | |
| 486 | ################################################################ |
Kelly O'Hair | d77b051 | 2010-12-23 18:41:57 -0800 | [diff] [blame] | 487 | # Source bundling |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 488 | ################################################################ |
| 489 | ifeq ($(BUNDLE_RULES_AVAILABLE), true) |
| 490 | include $(BUNDLE_RULES) |
| 491 | endif |
| 492 | |
| 493 | ################################################################ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 494 | # rule to test |
| 495 | ################################################################ |
| 496 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 497 | .NOTPARALLEL: test_run |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 498 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 499 | test: |
| 500 | $(MAKE) test_run |
| 501 | |
| 502 | test_run: test_clean test_start test_summary |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 503 | |
| 504 | test_start: |
| 505 | @$(ECHO) "Tests started at `$(DATE)`" |
| 506 | |
| 507 | test_clean: |
| 508 | $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt |
| 509 | |
| 510 | test_summary: $(OUTPUTDIR)/test_failures.txt |
| 511 | @$(ECHO) "#################################################" |
| 512 | @$(ECHO) "Tests completed at `$(DATE)`" |
| 513 | @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \ |
| 514 | || $(ECHO) "No TEST STATS seen in log" ) |
| 515 | @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt" |
| 516 | @$(ECHO) "#################################################" |
| 517 | @if [ -s $< ] ; then \ |
| 518 | $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \ |
| 519 | $(CAT) $<; \ |
| 520 | exit 1; \ |
| 521 | else \ |
| 522 | $(ECHO) "Success! No failures detected"; \ |
| 523 | fi |
| 524 | |
| 525 | # Get failure list from log |
| 526 | $(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt |
| 527 | @$(RM) $@ |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 528 | @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 529 | |
| 530 | # Get log file of all tests run |
| 531 | JDK_TO_TEST := $(shell \ |
Kelly O'Hair | eebc4b1 | 2011-05-16 08:40:01 -0700 | [diff] [blame] | 532 | if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then \ |
| 533 | $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; \ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 534 | elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \ |
| 535 | $(ECHO) "$(ABS_OUTPUTDIR)"; \ |
| 536 | elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \ |
| 537 | $(ECHO) "$(PRODUCT_HOME)"; \ |
| 538 | fi \ |
| 539 | ) |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 540 | TEST_TARGETS=all |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 541 | $(OUTPUTDIR)/test_log.txt: |
| 542 | $(RM) $@ |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 543 | ( $(CD) test && \ |
| 544 | $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 545 | ) | tee $@ |
| 546 | |
| 547 | ################################################################ |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 548 | # JPRT rule to build |
| 549 | ################################################################ |
| 550 | |
| 551 | include ./make/jprt.gmk |
| 552 | |
| 553 | ################################################################ |
| 554 | # PHONY |
| 555 | ################################################################ |
| 556 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 557 | .PHONY: all test test_run test_start test_summary test_clean \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 558 | generic_build_repo_series \ |
| 559 | what clobber insane \ |
| 560 | dev dev-build dev-sanity dev-clobber \ |
| 561 | product_build \ |
| 562 | fastdebug_build \ |
| 563 | debug_build \ |
| 564 | build_product_image \ |
| 565 | build_debug_image \ |
| 566 | build_fastdebug_image \ |
| 567 | create_fresh_product_bootdir \ |
| 568 | create_fresh_debug_bootdir \ |
| 569 | create_fresh_fastdebug_bootdir \ |
| 570 | generic_debug_build |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 571 | |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 572 | # Force target |
| 573 | FRC: |
| 574 | |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 575 | endif # Original Makefile logic |
| 576 | |