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