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