Makefile

changeset 912
a667caba1e84
parent 796
b1e9396fb8af
child 919
cd3825b29830
     1.1 --- a/Makefile	Thu Nov 07 08:16:05 2013 -0800
     1.2 +++ b/Makefile	Thu Nov 14 10:53:23 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  #
     1.5 -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8  #
     1.9  # This code is free software; you can redistribute it and/or modify it
    1.10 @@ -23,549 +23,112 @@
    1.11  # questions.
    1.12  #
    1.13  
    1.14 -# If NEWBUILD is defined, use the new build-infra Makefiles and configure.
    1.15 -#     See NewMakefile.gmk for more information.
    1.16 +# This must be the first rule
    1.17 +default:
    1.18  
    1.19 -# If not specified, select what the default build is
    1.20 -ifndef NEWBUILD
    1.21 -  NEWBUILD=true
    1.22 +# Inclusion of this pseudo-target will cause make to execute this file
    1.23 +# serially, regardless of -j. Recursively called makefiles will not be
    1.24 +# affected, however. This is required for correct dependency management.
    1.25 +.NOTPARALLEL:
    1.26 +
    1.27 +# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
    1.28 +# /usr/ccs/bin/make lacks basically every other flow control mechanism.
    1.29 +TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
    1.30 +
    1.31 +# Assume we have GNU make, but check version.
    1.32 +ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
    1.33 +  $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
    1.34  endif
    1.35  
    1.36 -ifeq ($(NEWBUILD),true)
    1.37 +# Locate this Makefile
    1.38 +ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
    1.39 +  makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
    1.40 +else
    1.41 +  makefile_path:=$(lastword $(MAKEFILE_LIST))
    1.42 +endif
    1.43 +root_dir:=$(dir $(makefile_path))
    1.44  
    1.45 -  # The new top level Makefile
    1.46 -  include NewMakefile.gmk
    1.47 +# ... and then we can include our helper functions
    1.48 +include $(root_dir)/make/MakeHelpers.gmk
    1.49  
    1.50 -else # Original Makefile logic
    1.51 +$(eval $(call ParseLogLevel))
    1.52 +$(eval $(call ParseConfAndSpec))
    1.53  
    1.54 -BUILD_PARENT_DIRECTORY=.
    1.55 +# Now determine if we have zero, one or several configurations to build.
    1.56 +ifeq ($(SPEC),)
    1.57 +  # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
    1.58 +else
    1.59 +  ifeq ($(words $(SPEC)),1)
    1.60 +    # We are building a single configuration. This is the normal case. Execute the Main.gmk file.
    1.61 +    include $(root_dir)/make/Main.gmk
    1.62 +  else
    1.63 +    # We are building multiple configurations.
    1.64 +    # First, find out the valid targets
    1.65 +    # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
    1.66 +    # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
    1.67 +    all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
    1.68 +        $(MAKE) -p -q -f make/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
    1.69 +        grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
    1.70  
    1.71 -# Basename of any originally supplied ALT_OUTPUTDIR directory
    1.72 -ifndef ORIG_OUTPUTDIR_BASENAME
    1.73 -  ifdef ALT_OUTPUTDIR
    1.74 -    ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
    1.75 -  else
    1.76 -    ORIG_OUTPUTDIR_BASENAME  = $(PLATFORM)-$(ARCH)
    1.77 -  endif
    1.78 -endif
    1.79 -export ORIG_OUTPUTDIR_BASENAME
    1.80 +    $(all_phony_targets):
    1.81 +	@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
    1.82 +	    $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
    1.83  
    1.84 -# The three possible directories created for output (3 build flavors)
    1.85 -OUTPUTDIR_BASENAME-          = $(ORIG_OUTPUTDIR_BASENAME)
    1.86 -OUTPUTDIR_BASENAME-debug     = $(ORIG_OUTPUTDIR_BASENAME)-debug
    1.87 -OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
    1.88 +    .PHONY: $(all_phony_targets)
    1.89  
    1.90 -# Relative path to a debug output area
    1.91 -REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
    1.92 -
    1.93 -# The created jdk image directory
    1.94 -JDK_IMAGE_DIRNAME = j2sdk-image
    1.95 -JDK_IMAGE_DIR     = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
    1.96 -ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
    1.97 -
    1.98 -# Relative path from an output directory to the image directory
    1.99 -REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
   1.100 -REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
   1.101 -REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
   1.102 -
   1.103 -ifndef TOPDIR
   1.104 -  TOPDIR:=.
   1.105 -endif
   1.106 -
   1.107 -ifndef JDK_TOPDIR
   1.108 -  JDK_TOPDIR=$(TOPDIR)/jdk
   1.109 -endif
   1.110 -ifndef JDK_MAKE_SHARED_DIR
   1.111 -  JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
   1.112 -endif
   1.113 -
   1.114 -default: all
   1.115 -
   1.116 -include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
   1.117 -include ./make/Defs-internal.gmk
   1.118 -include ./make/sanity-rules.gmk
   1.119 -include ./make/hotspot-rules.gmk
   1.120 -include ./make/langtools-rules.gmk
   1.121 -include ./make/corba-rules.gmk
   1.122 -include ./make/jaxp-rules.gmk
   1.123 -include ./make/jaxws-rules.gmk
   1.124 -include ./make/jdk-rules.gmk
   1.125 -include ./make/nashorn-rules.gmk
   1.126 -include ./make/install-rules.gmk
   1.127 -include ./make/sponsors-rules.gmk
   1.128 -include ./make/deploy-rules.gmk
   1.129 -
   1.130 -all:: sanity
   1.131 -
   1.132 -ifeq ($(SKIP_FASTDEBUG_BUILD), false)
   1.133 -  all:: fastdebug_build
   1.134 -endif
   1.135 -
   1.136 -ifeq ($(SKIP_DEBUG_BUILD), false)
   1.137 -  all:: debug_build
   1.138 -endif
   1.139 -
   1.140 -all:: all_product_build 
   1.141 -
   1.142 -all_product_build::
   1.143 -
   1.144 -# Everything for a full product build
   1.145 -ifeq ($(SKIP_PRODUCT_BUILD), false)
   1.146 -
   1.147 -  all_product_build:: product_build
   1.148 -
   1.149 -  ifeq ($(BUILD_INSTALL), true)
   1.150 -    all_product_build:: $(INSTALL)
   1.151 -    clobber:: install-clobber
   1.152 -  endif
   1.153 -
   1.154 -  ifeq ($(BUILD_SPONSORS), true)
   1.155 -    all_product_build:: $(SPONSORS)
   1.156 -    clobber:: sponsors-clobber
   1.157 -  endif
   1.158 -
   1.159 -  ifneq ($(SKIP_COMPARE_IMAGES), true)
   1.160 -    all_product_build:: compare-image
   1.161 -  endif
   1.162 -
   1.163 -endif
   1.164 -
   1.165 -define StartTimer
   1.166 -	$(MKDIR) -p $(BUILDTIMESDIR)
   1.167 -	$(RM) $(BUILDTIMESDIR)/build_time_*
   1.168 -	$(call RecordStartTime,TOTAL)
   1.169 -endef
   1.170 -
   1.171 -define StopTimer
   1.172 -	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
   1.173 -endef
   1.174 -
   1.175 -# Generic build of basic repo series
   1.176 -generic_build_repo_series:: $(SOURCE_TIPS)
   1.177 -	$(MKDIR) -p $(JDK_IMAGE_DIR)
   1.178 -	@$(call StartTimer)
   1.179 -
   1.180 -ifeq ($(BUILD_LANGTOOLS), true)
   1.181 -  generic_build_repo_series:: langtools
   1.182 -  clobber:: langtools-clobber
   1.183 -endif
   1.184 -
   1.185 -ifeq ($(BUILD_CORBA), true)
   1.186 -  generic_build_repo_series:: corba
   1.187 -  clobber:: corba-clobber
   1.188 -endif
   1.189 -
   1.190 -ifeq ($(BUILD_JAXP), true)
   1.191 -  generic_build_repo_series:: jaxp
   1.192 -  clobber:: jaxp-clobber
   1.193 -endif
   1.194 -
   1.195 -ifeq ($(BUILD_JAXWS), true)
   1.196 -  generic_build_repo_series:: jaxws
   1.197 -  clobber:: jaxws-clobber
   1.198 -endif
   1.199 -
   1.200 -ifeq ($(BUILD_HOTSPOT), true)
   1.201 -  generic_build_repo_series:: $(HOTSPOT) 
   1.202 -  clobber:: hotspot-clobber
   1.203 -endif
   1.204 -
   1.205 -ifeq ($(BUILD_JDK), true)
   1.206 -  generic_build_repo_series:: $(JDK_JAVA_EXE)
   1.207 -  clobber:: jdk-clobber
   1.208 -endif
   1.209 -
   1.210 -ifeq ($(BUILD_NASHORN), true)
   1.211 -  generic_build_repo_series:: $(NASHORN)
   1.212 -  clobber:: nashorn-clobber
   1.213 -endif
   1.214 -
   1.215 -ifeq ($(BUILD_DEPLOY), true)
   1.216 -  generic_build_repo_series:: $(DEPLOY)
   1.217 -  clobber:: deploy-clobber
   1.218 -endif
   1.219 -
   1.220 -generic_build_repo_series::
   1.221 -	@$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
   1.222 -
   1.223 -# The debug build, fastdebug or debug. Needs special handling.
   1.224 -#  Note that debug builds do NOT do INSTALL steps, but must be done
   1.225 -#  after the product build and before the INSTALL step of the product build.
   1.226 -#
   1.227 -#   DEBUG_NAME is fastdebug or debug
   1.228 -#   ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
   1.229 -#   The resulting image directory (j2sdk-image) is used by the install makefiles
   1.230 -#     to create a debug install bundle jdk-*-debug-** bundle (tar or zip) 
   1.231 -#     which will install in the debug or fastdebug subdirectory of the
   1.232 -#     normal product install area.
   1.233 -#     The install process needs to know what the DEBUG_NAME is, so
   1.234 -#     look for INSTALL_DEBUG_NAME in the install rules.
   1.235 -#
   1.236 -#   NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
   1.237 -#         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
   1.238 -#         not be the same location.
   1.239 -#
   1.240 -
   1.241 -# Location of fresh bootdir output
   1.242 -ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
   1.243 -FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
   1.244 -FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
   1.245 -  
   1.246 -create_fresh_product_bootdir: FRC
   1.247 -	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   1.248 -		GENERATE_DOCS=false \
   1.249 -		BOOT_CYCLE_SETTINGS= \
   1.250 -		build_product_image
   1.251 -
   1.252 -create_fresh_debug_bootdir: FRC
   1.253 -	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   1.254 -		GENERATE_DOCS=false \
   1.255 -		BOOT_CYCLE_DEBUG_SETTINGS= \
   1.256 -		build_debug_image
   1.257 -
   1.258 -create_fresh_fastdebug_bootdir: FRC
   1.259 -	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   1.260 -		GENERATE_DOCS=false \
   1.261 -		BOOT_CYCLE_DEBUG_SETTINGS= \
   1.262 -		build_fastdebug_image
   1.263 -
   1.264 -# Create boot image?
   1.265 -ifeq ($(SKIP_BOOT_CYCLE),false)
   1.266 -  ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
   1.267 -    DO_BOOT_CYCLE=true
   1.268    endif
   1.269  endif
   1.270  
   1.271 +# Include this after a potential spec file has been included so that the bundles target
   1.272 +# has access to the spec variables.
   1.273 +include $(root_dir)/make/Jprt.gmk
   1.274  
   1.275 +# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
   1.276 +# If you addd more global targets, please update the variable global_targets in MakeHelpers.
   1.277  
   1.278 -ifeq ($(DO_BOOT_CYCLE),true)
   1.279 -  
   1.280 -  # Create the bootdir to use in the build
   1.281 -  product_build:: create_fresh_product_bootdir
   1.282 -  debug_build:: create_fresh_debug_bootdir
   1.283 -  fastdebug_build:: create_fresh_fastdebug_bootdir
   1.284 +help:
   1.285 +	$(info )
   1.286 +	$(info OpenJDK Makefile help)
   1.287 +	$(info =====================)
   1.288 +	$(info )
   1.289 +	$(info Common make targets)
   1.290 +	$(info .  make [default]         # Compile all product in langtools, hotspot, jaxp, jaxws,)
   1.291 +	$(info .                         # corba and jdk)
   1.292 +	$(info .  make all               # Compile everything, all repos and images)
   1.293 +	$(info .  make images            # Create complete j2sdk and j2re images)
   1.294 +	$(info .  make docs              # Create javadocs)
   1.295 +	$(info .  make overlay-images    # Create limited images for sparc 64 bit platforms)
   1.296 +	$(info .  make profiles          # Create complete j2re compact profile images)
   1.297 +	$(info .  make bootcycle-images  # Build images twice, second time with newly build JDK)
   1.298 +	$(info .  make install           # Install the generated images locally)
   1.299 +	$(info .  make clean             # Remove all files generated by make, but not those)
   1.300 +	$(info .                         # generated by configure)
   1.301 +	$(info .  make dist-clean        # Remove all files, including configuration)
   1.302 +	$(info .  make help              # Give some help on using make)
   1.303 +	$(info .  make test              # Run tests, default is all tests (see TEST below))
   1.304 +	$(info )
   1.305 +	$(info Targets for specific components)
   1.306 +	$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test))
   1.307 +	$(info .  make <component>       # Build <component> and everything it depends on. )
   1.308 +	$(info .  make <component>-only  # Build <component> only, without dependencies. This)
   1.309 +	$(info .                         # is faster but can result in incorrect build results!)
   1.310 +	$(info .  make clean-<component> # Remove files generated by make for <component>)
   1.311 +	$(info )
   1.312 +	$(info Useful make variables)
   1.313 +	$(info .  make CONF=             # Build all configurations (note, assignment is empty))
   1.314 +	$(info .  make CONF=<substring>  # Build the configuration(s) with a name matching)
   1.315 +	$(info .                         # <substring>)
   1.316 +	$(info )
   1.317 +	$(info .  make LOG=<loglevel>    # Change the log level from warn to <loglevel>)
   1.318 +	$(info .                         # Available log levels are:)
   1.319 +	$(info .                         # 'warn' (default), 'info', 'debug' and 'trace')
   1.320 +	$(info .                         # To see executed command lines, use LOG=debug)
   1.321 +	$(info )
   1.322 +	$(info .  make JOBS=<n>          # Run <n> parallel make jobs)
   1.323 +	$(info .                         # Note that -jN does not work as expected!)
   1.324 +	$(info )
   1.325 +	$(info .  make test TEST=<test>  # Only run the given test or tests, e.g.)
   1.326 +	$(info .                         # make test TEST="jdk_lang jdk_net")
   1.327 +	$(info )
   1.328  
   1.329 -  # Define variables to be used now for the boot jdk
   1.330 -  BOOT_CYCLE_SETTINGS= \
   1.331 -     ALT_BOOTDIR=$(FRESH_BOOTDIR) \
   1.332 -     ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
   1.333 -  BOOT_CYCLE_DEBUG_SETTINGS= \
   1.334 -     ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
   1.335 -     ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
   1.336 -
   1.337 -else
   1.338 -
   1.339 -  # Use the supplied ALT_BOOTDIR as the boot
   1.340 -  BOOT_CYCLE_SETTINGS=
   1.341 -  BOOT_CYCLE_DEBUG_SETTINGS=
   1.342 -
   1.343 -endif
   1.344 -
   1.345 -build_product_image:
   1.346 -	$(MAKE) \
   1.347 -	        SKIP_FASTDEBUG_BUILD=true \
   1.348 -	        SKIP_DEBUG_BUILD=true \
   1.349 -	        $(BOOT_CYCLE_SETTINGS) \
   1.350 -	        generic_build_repo_series
   1.351 -
   1.352 -#   NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
   1.353 -#         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
   1.354 -#         not be the same location.
   1.355 -
   1.356 -generic_debug_build:
   1.357 -	$(MAKE) \
   1.358 -		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
   1.359 -	        DEBUG_NAME=$(DEBUG_NAME) \
   1.360 -		GENERATE_DOCS=false \
   1.361 -	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
   1.362 -		generic_build_repo_series
   1.363 -
   1.364 -build_debug_image:
   1.365 -	$(MAKE) DEBUG_NAME=debug generic_debug_build
   1.366 -
   1.367 -build_fastdebug_image:
   1.368 -	$(MAKE) DEBUG_NAME=fastdebug generic_debug_build
   1.369 -
   1.370 -# Build final image
   1.371 -product_build:: build_product_image
   1.372 -debug_build:: build_debug_image
   1.373 -fastdebug_build:: build_fastdebug_image
   1.374 -
   1.375 -# The source tips are stored with the relative path to the repo.
   1.376 -#   This file will be used when constructing the jdk image.
   1.377 -source_tips: $(SOURCE_TIPS)
   1.378 -	$(CAT) $<
   1.379 -$(SOURCE_TIPS): FRC
   1.380 -	@$(prep-target)
   1.381 -	@$(call GetSourceTips)
   1.382 -
   1.383 -clobber:: REPORT_BUILD_TIMES=
   1.384 -clobber:: 
   1.385 -	$(RM) -r $(OUTPUTDIR)/*
   1.386 -	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
   1.387 -
   1.388 -clean: clobber
   1.389 -
   1.390 -#
   1.391 -# Dev builds
   1.392 -#
   1.393 -
   1.394 -dev : dev-build
   1.395 -
   1.396 -dev-build:
   1.397 -	$(MAKE) DEV_ONLY=true all
   1.398 -dev-sanity:
   1.399 -	$(MAKE) DEV_ONLY=true sanity
   1.400 -dev-clobber:
   1.401 -	$(MAKE) DEV_ONLY=true clobber
   1.402 -
   1.403 -#
   1.404 -# Quick jdk verification build
   1.405 -#
   1.406 -jdk_only:
   1.407 -	$(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
   1.408 -
   1.409 -
   1.410 -#
   1.411 -# Quick jdk verification fastdebug build
   1.412 -#
   1.413 -jdk_fastdebug_only:
   1.414 -	$(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
   1.415 -	    BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
   1.416 -
   1.417 -#
   1.418 -# Quick deploy verification fastdebug build
   1.419 -#
   1.420 -deploy_fastdebug_only:
   1.421 -	$(MAKE) \
   1.422 -	    DEBUG_NAME=fastdebug \
   1.423 -	    BUILD_HOTSPOT=false \
   1.424 -	    BUILD_JDK=false \
   1.425 -	    BUILD_LANGTOOLS=false \
   1.426 -	    BUILD_NASHORN=false \
   1.427 -	    BUILD_CORBA=false \
   1.428 -	    BUILD_JAXP=false \
   1.429 -	    BUILD_JAXWS=false \
   1.430 -	    BUILD_INSTALL=false \
   1.431 -	    BUILD_SPONSORS=false \
   1.432 -	    generic_debug_build
   1.433 -
   1.434 -#
   1.435 -# Product build (skip debug builds)
   1.436 -#
   1.437 -product_only:
   1.438 -	$(MAKE) SKIP_FASTDEBUG_BUILD=true all
   1.439 -
   1.440 -#
   1.441 -# Check target
   1.442 -#
   1.443 -
   1.444 -check: variable_check
   1.445 -
   1.446 -#
   1.447 -# Help target
   1.448 -#
   1.449 -help: intro_help target_help variable_help notes_help examples_help
   1.450 -
   1.451 -# Intro help message
   1.452 -intro_help:
   1.453 -	@$(ECHO) "\
   1.454 -Makefile for the JDK builds (all the JDK). \n\
   1.455 -"
   1.456 -
   1.457 -# Target help
   1.458 -target_help:
   1.459 -	@$(ECHO) "\
   1.460 ---- Common Targets ---  \n\
   1.461 -all               -- build the core JDK (default target) \n\
   1.462 -help              -- Print out help information \n\
   1.463 -check             -- Check make variable values for correctness \n\
   1.464 -sanity            -- Perform detailed sanity checks on system and settings \n\
   1.465 -fastdebug_build   -- build the core JDK in 'fastdebug' mode (-g -O) \n\
   1.466 -debug_build       -- build the core JDK in 'debug' mode (-g) \n\
   1.467 -clean             -- remove all built and imported files \n\
   1.468 -clobber           -- same as clean \n\
   1.469 -"
   1.470 -
   1.471 -# Variable help (only common ones used by this Makefile)
   1.472 -variable_help: variable_help_intro variable_list variable_help_end
   1.473 -variable_help_intro:
   1.474 -	@$(ECHO) "--- Common Variables ---"
   1.475 -variable_help_end:
   1.476 -	@$(ECHO) " "
   1.477 -
   1.478 -# One line descriptions for the variables
   1.479 -OUTPUTDIR.desc             = Output directory
   1.480 -PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
   1.481 -SLASH_JAVA.desc            = Root of all build tools, e.g. /java or J:
   1.482 -BOOTDIR.desc               = JDK used to boot the build
   1.483 -JDK_IMPORT_PATH.desc       = JDK used to import components of the build
   1.484 -COMPILER_PATH.desc         = Compiler install directory
   1.485 -CACERTS_FILE.desc          = Location of certificates file
   1.486 -DEVTOOLS_PATH.desc         = Directory containing zip and gnumake
   1.487 -CUPS_HEADERS_PATH.desc     = Include directory location for CUPS header files
   1.488 -
   1.489 -# Make variables to print out (description and value)
   1.490 -VARIABLE_PRINTVAL_LIST +=       \
   1.491 -    OUTPUTDIR                   \
   1.492 -    PARALLEL_COMPILE_JOBS       \
   1.493 -    SLASH_JAVA                  \
   1.494 -    BOOTDIR                     \
   1.495 -    JDK_IMPORT_PATH             \
   1.496 -    COMPILER_PATH               \
   1.497 -    CACERTS_FILE                \
   1.498 -    DEVTOOLS_PATH
   1.499 -
   1.500 -# Make variables that should refer to directories that exist
   1.501 -VARIABLE_CHECKDIR_LIST +=       \
   1.502 -    SLASH_JAVA                  \
   1.503 -    BOOTDIR                     \
   1.504 -    JDK_IMPORT_PATH             \
   1.505 -    COMPILER_PATH               \
   1.506 -    DEVTOOLS_PATH 
   1.507 -
   1.508 -# Make variables that should refer to files that exist
   1.509 -VARIABLE_CHECKFIL_LIST +=       \
   1.510 -    CACERTS_FILE
   1.511 -
   1.512 -# For pattern rules below, so all are treated the same
   1.513 -DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
   1.514 -DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
   1.515 -DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
   1.516 -
   1.517 -# Complete variable check
   1.518 -variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
   1.519 -variable_list: $(DO_PRINTVAL_LIST) variable_check
   1.520 -
   1.521 -# Pattern rule for printing out a variable
   1.522 -%.printval:
   1.523 -	@$(ECHO) "  ALT_$* - $($*.desc)"
   1.524 -	@$(ECHO) "  \t $*=$($*)"
   1.525 -
   1.526 -# Pattern rule for checking to see if a variable with a directory exists
   1.527 -%.checkdir:
   1.528 -	@if [ ! -d $($*) ] ; then \
   1.529 -	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
   1.530 -	fi
   1.531 -
   1.532 -# Pattern rule for checking to see if a variable with a file exists
   1.533 -%.checkfil:
   1.534 -	@if [ ! -f $($*) ] ; then \
   1.535 -	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
   1.536 -	fi
   1.537 -
   1.538 -# Misc notes on help
   1.539 -notes_help:
   1.540 -	@$(ECHO) "\
   1.541 ---- Notes --- \n\
   1.542 -- All builds use same output directory unless overridden with \n\
   1.543 - \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
   1.544 - \t to use the clean target first. \n\
   1.545 -- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
   1.546 - \t builds or previous release JDK builds will work. \n\
   1.547 -- The fastest builds have been when the sources and the BOOTDIR are on \n\
   1.548 - \t local disk. \n\
   1.549 -"
   1.550 -
   1.551 -examples_help:
   1.552 -	@$(ECHO) "\
   1.553 ---- Examples --- \n\
   1.554 -  $(MAKE) fastdebug_build \n\
   1.555 -  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
   1.556 -  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
   1.557 -  $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
   1.558 -  $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
   1.559 -  $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
   1.560 -"
   1.561 -
   1.562 -################################################################
   1.563 -# Source bundling
   1.564 -################################################################
   1.565 -ifeq ($(BUNDLE_RULES_AVAILABLE), true)
   1.566 -  include $(BUNDLE_RULES)
   1.567 -endif
   1.568 -
   1.569 -################################################################
   1.570 -# rule to test
   1.571 -################################################################
   1.572 -
   1.573 -.NOTPARALLEL: test_run
   1.574 -
   1.575 -test:
   1.576 -	$(MAKE) test_run
   1.577 -
   1.578 -test_run: test_clean test_start test_summary
   1.579 -
   1.580 -test_start:
   1.581 -	@$(ECHO) "Tests started at `$(DATE)`"
   1.582 -
   1.583 -test_clean:
   1.584 -	$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
   1.585 -
   1.586 -test_summary: $(OUTPUTDIR)/test_failures.txt
   1.587 -	@$(ECHO) "#################################################"
   1.588 -	@$(ECHO) "Tests completed at `$(DATE)`"
   1.589 -	@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
   1.590 -          || $(ECHO) "No TEST STATS seen in log" )
   1.591 -	@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
   1.592 -	@$(ECHO) "#################################################"
   1.593 -	@if [ -s $< ] ; then                                           \
   1.594 -          $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
   1.595 -          $(CAT) $<;                                                   \
   1.596 -          exit 1;                                                      \
   1.597 -        else                                                           \
   1.598 -          $(ECHO) "Success! No failures detected";                     \
   1.599 -        fi
   1.600 -
   1.601 -# Get failure list from log
   1.602 -$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
   1.603 -	@$(RM) $@
   1.604 -	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
   1.605 -
   1.606 -# Get log file of all tests run
   1.607 -JDK_TO_TEST := $(shell 							\
   1.608 -  if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then 				\
   1.609 -    $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; 					\
   1.610 -  elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then 				\
   1.611 -    $(ECHO) "$(ABS_OUTPUTDIR)"; 					\
   1.612 -  elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then 	\
   1.613 -    $(ECHO) "$(PRODUCT_HOME)"; 						\
   1.614 -  fi 									\
   1.615 -)
   1.616 -TEST_TARGETS=all
   1.617 -$(OUTPUTDIR)/test_log.txt:
   1.618 -	$(RM) $@
   1.619 -	( $(CD) test &&                                                     \
   1.620 -          $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
   1.621 -        ) | tee $@
   1.622 -
   1.623 -################################################################
   1.624 -# JPRT rule to build
   1.625 -################################################################
   1.626 -
   1.627 -include ./make/jprt.gmk
   1.628 -
   1.629 -################################################################
   1.630 -#  PHONY
   1.631 -################################################################
   1.632 -
   1.633 -.PHONY: all  test test_run test_start test_summary test_clean \
   1.634 -	generic_build_repo_series \
   1.635 -	what clobber insane \
   1.636 -        dev dev-build dev-sanity dev-clobber \
   1.637 -        product_build \
   1.638 -        fastdebug_build \
   1.639 -        debug_build  \
   1.640 -        build_product_image  \
   1.641 -        build_debug_image  \
   1.642 -        build_fastdebug_image \
   1.643 -        create_fresh_product_bootdir \
   1.644 -        create_fresh_debug_bootdir \
   1.645 -        create_fresh_fastdebug_bootdir \
   1.646 -        generic_debug_build
   1.647 -
   1.648 -# Force target
   1.649 -FRC:
   1.650 -
   1.651 -endif # Original Makefile logic
   1.652 -
   1.653 +.PHONY: help

mercurial