J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 2 | # Copyright (c) 1995, 2009, 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 | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 26 | BUILD_PARENT_DIRECTORY=. |
| 27 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 28 | ifndef TOPDIR |
Kelly O'Hair | fb56a9a | 2008-03-25 14:38:56 -0700 | [diff] [blame] | 29 | TOPDIR:=. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 30 | endif |
| 31 | |
| 32 | ifndef CONTROL_TOPDIR |
Kelly O'Hair | fb56a9a | 2008-03-25 14:38:56 -0700 | [diff] [blame] | 33 | CONTROL_TOPDIR=$(TOPDIR) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 34 | endif |
| 35 | |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 36 | # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true) |
| 37 | OPENJDK_SOURCETREE=$(TOPDIR)/openjdk |
| 38 | OPENJDK_BUILDDIR:=$(shell \ |
Kelly O'Hair | fb56a9a | 2008-03-25 14:38:56 -0700 | [diff] [blame] | 39 | if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \ |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 40 | echo "$(OPENJDK_SOURCETREE)"; \ |
| 41 | else \ |
| 42 | echo "."; \ |
| 43 | fi) |
| 44 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 45 | ifndef JDK_TOPDIR |
| 46 | JDK_TOPDIR=$(TOPDIR)/jdk |
| 47 | endif |
| 48 | ifndef JDK_MAKE_SHARED_DIR |
| 49 | JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared |
| 50 | endif |
| 51 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 52 | # For start and finish echo lines |
| 53 | TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE) |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 54 | DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'` |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 55 | START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)" |
| 56 | FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)" |
| 57 | |
| 58 | default: all |
| 59 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 60 | include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 61 | include ./make/Defs-internal.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 62 | include ./make/sanity-rules.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 63 | include ./make/hotspot-rules.gmk |
| 64 | include ./make/langtools-rules.gmk |
| 65 | include ./make/corba-rules.gmk |
| 66 | include ./make/jaxp-rules.gmk |
| 67 | include ./make/jaxws-rules.gmk |
| 68 | include ./make/jdk-rules.gmk |
| 69 | include ./make/install-rules.gmk |
| 70 | include ./make/sponsors-rules.gmk |
| 71 | include ./make/deploy-rules.gmk |
| 72 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 73 | # What "all" means |
| 74 | all:: |
| 75 | @$(START_ECHO) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 76 | |
Kelly O'Hair | 179908e | 2008-08-17 09:56:25 -0700 | [diff] [blame] | 77 | all:: openjdk_check sanity |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 78 | |
| 79 | ifeq ($(SKIP_FASTDEBUG_BUILD), false) |
| 80 | all:: fastdebug_build |
| 81 | endif |
| 82 | |
| 83 | ifeq ($(SKIP_DEBUG_BUILD), false) |
| 84 | all:: debug_build |
| 85 | endif |
| 86 | |
| 87 | ifneq ($(SKIP_OPENJDK_BUILD), true) |
| 88 | all:: openjdk_build |
| 89 | endif |
| 90 | |
Kelly O'Hair | 179908e | 2008-08-17 09:56:25 -0700 | [diff] [blame] | 91 | all:: all_product_build |
| 92 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 93 | all:: |
| 94 | @$(FINISH_ECHO) |
| 95 | |
| 96 | # Everything for a full product build |
| 97 | all_product_build:: |
| 98 | @$(START_ECHO) |
| 99 | |
| 100 | ifeq ($(SKIP_PRODUCT_BUILD), false) |
| 101 | |
| 102 | all_product_build:: product_build |
| 103 | |
| 104 | ifeq ($(BUILD_INSTALL), true) |
| 105 | all_product_build:: $(INSTALL) |
| 106 | clobber:: install-clobber |
| 107 | endif |
| 108 | |
| 109 | ifeq ($(BUILD_SPONSORS), true) |
| 110 | all_product_build:: $(SPONSORS) |
| 111 | clobber:: sponsors-clobber |
| 112 | endif |
| 113 | |
| 114 | ifneq ($(SKIP_COMPARE_IMAGES), true) |
| 115 | all_product_build:: compare-image |
| 116 | endif |
| 117 | |
| 118 | endif |
| 119 | |
| 120 | all_product_build:: |
| 121 | @$(FINISH_ECHO) |
| 122 | |
| 123 | # Generis build of basic repo series |
| 124 | generic_build_repo_series:: |
| 125 | $(MKDIR) -p $(OUTPUTDIR) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 126 | $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 127 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 128 | ifeq ($(BUILD_LANGTOOLS), true) |
| 129 | generic_build_repo_series:: langtools |
| 130 | clobber:: langtools-clobber |
| 131 | endif |
| 132 | |
| 133 | ifeq ($(BUILD_CORBA), true) |
| 134 | generic_build_repo_series:: corba |
| 135 | clobber:: corba-clobber |
| 136 | endif |
| 137 | |
| 138 | ifeq ($(BUILD_JAXP), true) |
| 139 | generic_build_repo_series:: jaxp |
| 140 | clobber:: jaxp-clobber |
| 141 | endif |
| 142 | |
| 143 | ifeq ($(BUILD_JAXWS), true) |
| 144 | generic_build_repo_series:: jaxws |
| 145 | clobber:: jaxws-clobber |
| 146 | endif |
| 147 | |
| 148 | ifeq ($(BUILD_HOTSPOT), true) |
| 149 | generic_build_repo_series:: $(HOTSPOT) |
| 150 | clobber:: hotspot-clobber |
| 151 | endif |
| 152 | |
| 153 | ifeq ($(BUILD_JDK), true) |
| 154 | generic_build_repo_series:: $(JDK_JAVA_EXE) |
| 155 | clobber:: jdk-clobber |
| 156 | endif |
| 157 | |
| 158 | ifeq ($(BUILD_DEPLOY), true) |
| 159 | generic_build_repo_series:: $(DEPLOY) |
| 160 | clobber:: deploy-clobber |
| 161 | endif |
| 162 | |
| 163 | ifeq ($(BUILD_JDK), true) |
| 164 | ifeq ($(BUNDLE_RULES_AVAILABLE), true) |
| 165 | generic_build_repo_series:: openjdk-binary-plugs-bundles |
| 166 | endif |
| 167 | endif |
| 168 | |
| 169 | # The debug build, fastdebug or debug. Needs special handling. |
| 170 | # Note that debug builds do NOT do INSTALL steps, but must be done |
| 171 | # after the product build and before the INSTALL step of the product build. |
| 172 | # |
| 173 | # DEBUG_NAME is fastdebug or debug |
| 174 | # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix |
| 175 | # The resulting j2sdk-image is used by the install makefiles to create a |
| 176 | # debug install bundle jdk-*-debug-** bundle (tar or zip) |
| 177 | # which will install in the debug or fastdebug subdirectory of the |
| 178 | # normal product install area. |
| 179 | # The install process needs to know what the DEBUG_NAME is, so |
| 180 | # look for INSTALL_DEBUG_NAME in the install rules. |
| 181 | # |
| 182 | |
| 183 | # Location of fresh bootdir output |
| 184 | ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk |
| 185 | FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image |
| 186 | FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image |
| 187 | |
| 188 | create_fresh_product_bootdir: FRC |
| 189 | @$(START_ECHO) |
| 190 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 191 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 192 | BOOT_CYCLE_SETTINGS= \ |
| 193 | build_product_image |
| 194 | @$(FINISH_ECHO) |
| 195 | |
| 196 | create_fresh_debug_bootdir: FRC |
| 197 | @$(START_ECHO) |
| 198 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 199 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 200 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 201 | build_debug_image |
| 202 | @$(FINISH_ECHO) |
| 203 | |
| 204 | create_fresh_fastdebug_bootdir: FRC |
| 205 | @$(START_ECHO) |
| 206 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 207 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 208 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 209 | build_fastdebug_image |
| 210 | @$(FINISH_ECHO) |
| 211 | |
| 212 | # Create boot image? |
| 213 | ifeq ($(SKIP_BOOT_CYCLE),false) |
| 214 | ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
| 215 | DO_BOOT_CYCLE=true |
| 216 | endif |
| 217 | endif |
| 218 | |
| 219 | ifeq ($(DO_BOOT_CYCLE),true) |
| 220 | |
| 221 | # Create the bootdir to use in the build |
| 222 | product_build:: create_fresh_product_bootdir |
| 223 | debug_build:: create_fresh_debug_bootdir |
| 224 | fastdebug_build:: create_fresh_fastdebug_bootdir |
| 225 | |
| 226 | # Define variables to be used now for the boot jdk |
| 227 | BOOT_CYCLE_SETTINGS= \ |
| 228 | ALT_BOOTDIR=$(FRESH_BOOTDIR) \ |
| 229 | ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR) |
| 230 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 231 | ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \ |
| 232 | ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR) |
| 233 | |
| 234 | else |
| 235 | |
| 236 | # Use the supplied ALT_BOOTDIR as the boot |
| 237 | BOOT_CYCLE_SETTINGS= |
| 238 | BOOT_CYCLE_DEBUG_SETTINGS= |
| 239 | |
| 240 | endif |
| 241 | |
| 242 | build_product_image: |
| 243 | @$(START_ECHO) |
| 244 | $(MAKE) \ |
| 245 | SKIP_FASTDEBUG_BUILD=true \ |
| 246 | SKIP_DEBUG_BUILD=true \ |
| 247 | $(BOOT_CYCLE_SETTINGS) \ |
| 248 | generic_build_repo_series |
| 249 | @$(FINISH_ECHO) |
| 250 | |
| 251 | generic_debug_build: |
| 252 | @$(START_ECHO) |
| 253 | $(MAKE) \ |
| 254 | ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \ |
| 255 | DEBUG_NAME=$(DEBUG_NAME) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 256 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 257 | $(BOOT_CYCLE_DEBUG_SETTINGS) \ |
| 258 | generic_build_repo_series |
| 259 | @$(FINISH_ECHO) |
| 260 | |
| 261 | build_debug_image: |
| 262 | $(MAKE) DEBUG_NAME=debug generic_debug_build |
| 263 | |
| 264 | build_fastdebug_image: |
| 265 | $(MAKE) DEBUG_NAME=fastdebug generic_debug_build |
| 266 | |
| 267 | # Build final image |
| 268 | product_build:: build_product_image |
| 269 | debug_build:: build_debug_image |
| 270 | fastdebug_build:: build_fastdebug_image |
| 271 | |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 272 | # Check on whether we really can build the openjdk, need source etc. |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 273 | openjdk_check: FRC |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 274 | ifneq ($(SKIP_OPENJDK_BUILD), true) |
| 275 | @$(ECHO) " " |
| 276 | @$(ECHO) "=================================================" |
| 277 | @if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \ |
| 278 | $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \ |
| 279 | exit 1; \ |
| 280 | else \ |
| 281 | $(ECHO) "OpenJDK will be built after JDK is built"; \ |
| 282 | $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \ |
| 283 | fi |
| 284 | @$(ECHO) "=================================================" |
| 285 | @$(ECHO) " " |
| 286 | endif |
| 287 | |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 288 | # If we have bundle rules, we have a chance here to do a complete cycle |
| 289 | # build, of production and open build. |
| 290 | # FIXUP: We should create the openjdk source bundle and build that? |
| 291 | # But how do we reliable create or get at a formal openjdk source tree? |
| 292 | # The one we have needs to be trimmed of built bits and closed dirs. |
| 293 | # The repositories might not be available. |
| 294 | # The openjdk source bundle is probably not available. |
| 295 | |
| 296 | ifneq ($(SKIP_OPENJDK_BUILD), true) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 297 | ifeq ($(BUILD_JDK), true) |
| 298 | ifeq ($(BUNDLE_RULES_AVAILABLE), true) |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 299 | |
| 300 | OPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME) |
| 301 | OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output |
| 302 | OPENJDK_BUILD_NAME \ |
| 303 | = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE) |
| 304 | OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip |
| 305 | BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image |
| 306 | ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
| 307 | OPENJDK_BOOTDIR=$(BOOTDIR) |
| 308 | OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH) |
| 309 | else |
| 310 | OPENJDK_BOOTDIR=$(BUILT_IMAGE) |
| 311 | OPENJDK_IMPORTJDK=$(BUILT_IMAGE) |
| 312 | endif |
| 313 | |
| 314 | openjdk_build: |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 315 | @$(START_ECHO) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 316 | @$(ECHO) " " |
| 317 | @$(ECHO) "=================================================" |
| 318 | @$(ECHO) "Starting openjdk build" |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 319 | @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)" |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 320 | @$(ECHO) "=================================================" |
| 321 | @$(ECHO) " " |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 322 | $(RM) -r $(OPENJDK_OUTPUTDIR) |
| 323 | $(MKDIR) -p $(OPENJDK_OUTPUTDIR) |
| 324 | ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \ |
| 325 | OPENJDK=true \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 326 | GENERATE_DOCS=false \ |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 327 | ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \ |
| 328 | ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \ |
| 329 | ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \ |
| 330 | ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \ |
| 331 | ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \ |
| 332 | product_build ) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 333 | $(RM) $(OPENJDK_BUILD_BINARY_ZIP) |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 334 | ( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \ |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 335 | $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .) |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 336 | $(RM) -r $(OPENJDK_OUTPUTDIR) |
| 337 | @$(ECHO) " " |
| 338 | @$(ECHO) "=================================================" |
| 339 | @$(ECHO) "Finished openjdk build" |
| 340 | @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)" |
| 341 | @$(ECHO) "=================================================" |
| 342 | @$(ECHO) " " |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 343 | @$(FINISH_ECHO) |
Kelly O'Hair | 6b9d629 | 2008-03-09 13:11:51 -0700 | [diff] [blame] | 344 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 345 | endif |
| 346 | endif |
| 347 | endif |
| 348 | |
| 349 | clobber:: |
| 350 | $(RM) -r $(OUTPUTDIR)/* |
| 351 | $(RM) -r $(OUTPUTDIR)-debug/* |
| 352 | $(RM) -r $(OUTPUTDIR)-fastdebug/* |
| 353 | -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) |
| 354 | |
| 355 | clean: clobber |
| 356 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 357 | # |
| 358 | # Dev builds |
| 359 | # |
| 360 | |
| 361 | dev : dev-build |
| 362 | |
| 363 | dev-build: |
| 364 | $(MAKE) DEV_ONLY=true all |
| 365 | dev-sanity: |
| 366 | $(MAKE) DEV_ONLY=true sanity |
| 367 | dev-clobber: |
| 368 | $(MAKE) DEV_ONLY=true clobber |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 369 | |
| 370 | # |
| 371 | # Quick jdk verification build |
| 372 | # |
| 373 | jdk_only: |
| 374 | $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all |
| 375 | |
| 376 | |
| 377 | # |
| 378 | # Quick jdk verification fastdebug build |
| 379 | # |
| 380 | jdk_fastdebug_only: |
| 381 | $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \ |
| 382 | BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build |
| 383 | |
| 384 | # |
| 385 | # Quick deploy verification fastdebug build |
| 386 | # |
| 387 | deploy_fastdebug_only: |
| 388 | $(MAKE) \ |
| 389 | DEBUG_NAME=fastdebug \ |
| 390 | BUILD_HOTSPOT=false \ |
| 391 | BUILD_JDK=false \ |
| 392 | BUILD_LANGTOOLS=false \ |
| 393 | BUILD_CORBA=false \ |
| 394 | BUILD_JAXP=false \ |
| 395 | BUILD_JAXWS=false \ |
| 396 | BUILD_INSTALL=false \ |
| 397 | BUILD_SPONSORS=false \ |
| 398 | generic_debug_build |
| 399 | |
| 400 | # |
| 401 | # Product build (skip debug builds) |
| 402 | # |
| 403 | product_only: |
| 404 | $(MAKE) SKIP_FASTDEBUG_BUILD=true all |
| 405 | |
| 406 | # |
| 407 | # Check target |
| 408 | # |
| 409 | |
| 410 | check: variable_check |
| 411 | |
| 412 | # |
| 413 | # Help target |
| 414 | # |
| 415 | help: intro_help target_help variable_help notes_help examples_help |
| 416 | |
| 417 | # Intro help message |
| 418 | intro_help: |
| 419 | @$(ECHO) "\ |
| 420 | Makefile for the JDK builds (all the JDK). \n\ |
| 421 | " |
| 422 | |
| 423 | # Target help |
| 424 | target_help: |
| 425 | @$(ECHO) "\ |
| 426 | --- Common Targets --- \n\ |
| 427 | all -- build the core JDK (default target) \n\ |
| 428 | help -- Print out help information \n\ |
| 429 | check -- Check make variable values for correctness \n\ |
| 430 | sanity -- Perform detailed sanity checks on system and settings \n\ |
| 431 | fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\ |
| 432 | debug_build -- build the core JDK in 'debug' mode (-g) \n\ |
| 433 | clean -- remove all built and imported files \n\ |
| 434 | clobber -- same as clean \n\ |
| 435 | " |
| 436 | |
| 437 | # Variable help (only common ones used by this Makefile) |
| 438 | variable_help: variable_help_intro variable_list variable_help_end |
| 439 | variable_help_intro: |
| 440 | @$(ECHO) "--- Common Variables ---" |
| 441 | variable_help_end: |
| 442 | @$(ECHO) " " |
| 443 | |
| 444 | # One line descriptions for the variables |
| 445 | OUTPUTDIR.desc = Output directory |
| 446 | PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count |
| 447 | SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: |
| 448 | BOOTDIR.desc = JDK used to boot the build |
| 449 | JDK_IMPORT_PATH.desc = JDK used to import components of the build |
| 450 | COMPILER_PATH.desc = Compiler install directory |
| 451 | CACERTS_FILE.desc = Location of certificates file |
| 452 | DEVTOOLS_PATH.desc = Directory containing zip and gnumake |
| 453 | CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files |
| 454 | DXSDK_PATH.desc = Root directory of DirectX SDK |
| 455 | MSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe) |
| 456 | MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll |
| 457 | |
| 458 | # Make variables to print out (description and value) |
| 459 | VARIABLE_PRINTVAL_LIST += \ |
| 460 | OUTPUTDIR \ |
| 461 | PARALLEL_COMPILE_JOBS \ |
| 462 | SLASH_JAVA \ |
| 463 | BOOTDIR \ |
| 464 | JDK_IMPORT_PATH \ |
| 465 | COMPILER_PATH \ |
| 466 | CACERTS_FILE \ |
| 467 | DEVTOOLS_PATH |
| 468 | |
| 469 | # Make variables that should refer to directories that exist |
| 470 | VARIABLE_CHECKDIR_LIST += \ |
| 471 | SLASH_JAVA \ |
| 472 | BOOTDIR \ |
| 473 | JDK_IMPORT_PATH \ |
| 474 | COMPILER_PATH \ |
| 475 | DEVTOOLS_PATH |
| 476 | |
| 477 | # Make variables that should refer to files that exist |
| 478 | VARIABLE_CHECKFIL_LIST += \ |
| 479 | CACERTS_FILE |
| 480 | |
| 481 | # Some are windows specific |
| 482 | ifeq ($(PLATFORM), windows) |
| 483 | |
| 484 | VARIABLE_PRINTVAL_LIST += \ |
| 485 | DXSDK_PATH \ |
| 486 | MSDEVTOOLS_PATH \ |
| 487 | MSVCRT_DLL_PATH |
| 488 | |
| 489 | VARIABLE_CHECKDIR_LIST += \ |
| 490 | DXSDK_PATH \ |
| 491 | MSDEVTOOLS_PATH \ |
| 492 | MSVCRT_DLL_PATH |
| 493 | |
| 494 | endif |
| 495 | |
| 496 | # For pattern rules below, so all are treated the same |
| 497 | DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval) |
| 498 | DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir) |
| 499 | DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil) |
| 500 | |
| 501 | # Complete variable check |
| 502 | variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST) |
| 503 | variable_list: $(DO_PRINTVAL_LIST) variable_check |
| 504 | |
| 505 | # Pattern rule for printing out a variable |
| 506 | %.printval: |
| 507 | @$(ECHO) " ALT_$* - $($*.desc)" |
| 508 | @$(ECHO) " \t $*=$($*)" |
| 509 | |
| 510 | # Pattern rule for checking to see if a variable with a directory exists |
| 511 | %.checkdir: |
| 512 | @if [ ! -d $($*) ] ; then \ |
| 513 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 514 | fi |
| 515 | |
| 516 | # Pattern rule for checking to see if a variable with a file exists |
| 517 | %.checkfil: |
| 518 | @if [ ! -f $($*) ] ; then \ |
| 519 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 520 | fi |
| 521 | |
| 522 | # Misc notes on help |
| 523 | notes_help: |
| 524 | @$(ECHO) "\ |
| 525 | --- Notes --- \n\ |
| 526 | - All builds use same output directory unless overridden with \n\ |
| 527 | \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\ |
| 528 | \t to use the clean target first. \n\ |
| 529 | - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\ |
| 530 | \t builds or previous release JDK builds will work. \n\ |
| 531 | - The fastest builds have been when the sources and the BOOTDIR are on \n\ |
| 532 | \t local disk. \n\ |
| 533 | " |
| 534 | |
| 535 | examples_help: |
| 536 | @$(ECHO) "\ |
| 537 | --- Examples --- \n\ |
| 538 | $(MAKE) fastdebug_build \n\ |
| 539 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 540 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\ |
| 541 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 542 | $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\ |
| 543 | $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\ |
| 544 | " |
| 545 | |
| 546 | ################################################################ |
| 547 | # Source and binary plug bundling |
| 548 | ################################################################ |
| 549 | ifeq ($(BUNDLE_RULES_AVAILABLE), true) |
| 550 | include $(BUNDLE_RULES) |
| 551 | endif |
| 552 | |
| 553 | ################################################################ |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 554 | # JPRT rule to build |
| 555 | ################################################################ |
| 556 | |
| 557 | include ./make/jprt.gmk |
| 558 | |
| 559 | ################################################################ |
| 560 | # PHONY |
| 561 | ################################################################ |
| 562 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 563 | .PHONY: all \ |
| 564 | generic_build_repo_series \ |
| 565 | what clobber insane \ |
| 566 | dev dev-build dev-sanity dev-clobber \ |
| 567 | product_build \ |
| 568 | fastdebug_build \ |
| 569 | debug_build \ |
| 570 | build_product_image \ |
| 571 | build_debug_image \ |
| 572 | build_fastdebug_image \ |
| 573 | create_fresh_product_bootdir \ |
| 574 | create_fresh_debug_bootdir \ |
| 575 | create_fresh_fastdebug_bootdir \ |
| 576 | generic_debug_build |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 577 | |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 578 | # Force target |
| 579 | FRC: |
| 580 | |