< prev index next >

make/InitSupport.gmk

Print this page




  36 
  37   # COMMA is defined in spec.gmk, but that is not included yet
  38   COMMA := ,
  39 
  40   # Include the corresponding closed file, if present.
  41   ifneq ($(CUSTOM_MAKE_DIR), )
  42     -include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
  43   endif
  44 
  45   ##############################################################################
  46   # Helper functions for the initial part of Init.gmk, before the spec file is
  47   # loaded. Most of these functions provide parsing and setting up make options
  48   # from the command-line.
  49   ##############################################################################
  50 
  51   # Make control variables, handled by Init.gmk
  52   INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
  53       COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS
  54 
  55   # All known make control variables
  56   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
  57 
  58   # Define a simple reverse function.
  59   # Should maybe move to MakeBase.gmk, but we can't include that file now.
  60   reverse = \
  61       $(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
  62           $(firstword $(1))
  63 
  64   # The variable MAKEOVERRIDES contains variable assignments from the command
  65   # line, but in reverse order to what the user entered.
  66   # The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
  67   COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
  68 
  69   # A list like FOO="val1" BAR="val2" containing all user-supplied make
  70   # variables that we should propagate.
  71   # The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
  72   USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
  73       $(subst \ ,\#,$(MAKEOVERRIDES))))
  74 
  75   # Setup information about available configurations, if any.
  76   ifneq ($(CUSTOM_ROOT), )


 407         # Compare first and second build. Ignore any error code from compare.sh.
 408         $(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
 409         $(if $(COMPARE_BUILD_COMP_DIR), \
 410           +(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
 411               -2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
 412               $(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
 413           +(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
 414               -o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
 415         )
 416   endef
 417 
 418   define PrintFailureReports
 419         $(if $(filter none, $(LOG_REPORT)), , \
 420           $(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
 421             $(PRINTF) "\n=== Output from failing command(s) repeated here ===\n" $(NEWLINE) \
 422             $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \
 423                 $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" $(NEWLINE) \
 424                 $(if $(filter all, $(LOG_REPORT)), \
 425                   $(GREP) -v -e "^Note: including file:" <  $(logfile) || true $(NEWLINE) \
 426                 , \
 427                   ($(GREP) -v -e "^Note: including file:" <  $(logfile) || true) | $(HEAD) -n 15 $(NEWLINE) \
 428                   if test `$(WC) -l < $(logfile)` -gt 15; then \
 429                     $(ECHO) "   ... (rest of output omitted)" ; \
 430                   fi $(NEWLINE) \
 431                 ) \
 432             ) \
 433             $(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" $(NEWLINE) \
 434             $(PRINTF) "=== End of repeated output ===\n" \
 435           ) \
 436         )
 437   endef
 438 
 439   define PrintBuildLogFailures
 440         $(if $(filter none, $(LOG_REPORT)), , \
 441           if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then  \
 442             $(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \
 443             $(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
 444             $(PRINTF) "=== End of repeated output ===\n" ; \
 445             $(PRINTF) "\nHint: Try searching the build log for the name of the first failed target.\n" ; \
 446           else \
 447             $(PRINTF) "\nNo indication of failed target found.\n" ; \
 448             $(PRINTF) "Hint: Try searching the build log for '] Error'.\n" ; \




  36 
  37   # COMMA is defined in spec.gmk, but that is not included yet
  38   COMMA := ,
  39 
  40   # Include the corresponding closed file, if present.
  41   ifneq ($(CUSTOM_MAKE_DIR), )
  42     -include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
  43   endif
  44 
  45   ##############################################################################
  46   # Helper functions for the initial part of Init.gmk, before the spec file is
  47   # loaded. Most of these functions provide parsing and setting up make options
  48   # from the command-line.
  49   ##############################################################################
  50 
  51   # Make control variables, handled by Init.gmk
  52   INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
  53       COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS
  54 
  55   # All known make control variables
  56   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
  57 
  58   # Define a simple reverse function.
  59   # Should maybe move to MakeBase.gmk, but we can't include that file now.
  60   reverse = \
  61       $(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
  62           $(firstword $(1))
  63 
  64   # The variable MAKEOVERRIDES contains variable assignments from the command
  65   # line, but in reverse order to what the user entered.
  66   # The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
  67   COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
  68 
  69   # A list like FOO="val1" BAR="val2" containing all user-supplied make
  70   # variables that we should propagate.
  71   # The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
  72   USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
  73       $(subst \ ,\#,$(MAKEOVERRIDES))))
  74 
  75   # Setup information about available configurations, if any.
  76   ifneq ($(CUSTOM_ROOT), )


 407         # Compare first and second build. Ignore any error code from compare.sh.
 408         $(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
 409         $(if $(COMPARE_BUILD_COMP_DIR), \
 410           +(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
 411               -2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
 412               $(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
 413           +(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
 414               -o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
 415         )
 416   endef
 417 
 418   define PrintFailureReports
 419         $(if $(filter none, $(LOG_REPORT)), , \
 420           $(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
 421             $(PRINTF) "\n=== Output from failing command(s) repeated here ===\n" $(NEWLINE) \
 422             $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \
 423                 $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" $(NEWLINE) \
 424                 $(if $(filter all, $(LOG_REPORT)), \
 425                   $(GREP) -v -e "^Note: including file:" <  $(logfile) || true $(NEWLINE) \
 426                 , \
 427                   ($(GREP) -v -e "^Note: including file:" <  $(logfile) || true) | $(HEAD) -n 12 $(NEWLINE) \
 428                   if test `$(WC) -l < $(logfile)` -gt 12; then \
 429                     $(ECHO) "   ... (rest of output omitted)" ; \
 430                   fi $(NEWLINE) \
 431                 ) \
 432             ) \
 433             $(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" $(NEWLINE) \
 434             $(PRINTF) "=== End of repeated output ===\n" \
 435           ) \
 436         )
 437   endef
 438 
 439   define PrintBuildLogFailures
 440         $(if $(filter none, $(LOG_REPORT)), , \
 441           if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then  \
 442             $(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \
 443             $(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
 444             $(PRINTF) "=== End of repeated output ===\n" ; \
 445             $(PRINTF) "\nHint: Try searching the build log for the name of the first failed target.\n" ; \
 446           else \
 447             $(PRINTF) "\nNo indication of failed target found.\n" ; \
 448             $(PRINTF) "Hint: Try searching the build log for '] Error'.\n" ; \


< prev index next >