make/Init.gmk
changeset 45211 4abe601baa45
parent 44465 26fabd8abee9
child 45822 f8fca310fb7b
equal deleted inserted replaced
45210:a54893aaee2a 45211:4abe601baa45
     1 #
     1 #
     2 # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    49   # a configuration. This will define ALL_GLOBAL_TARGETS.
    49   # a configuration. This will define ALL_GLOBAL_TARGETS.
    50   include $(topdir)/make/Help.gmk
    50   include $(topdir)/make/Help.gmk
    51 
    51 
    52   # Targets provided by Init.gmk.
    52   # Targets provided by Init.gmk.
    53   ALL_INIT_TARGETS := print-modules print-targets print-configuration \
    53   ALL_INIT_TARGETS := print-modules print-targets print-configuration \
    54       reconfigure pre-compare-build post-compare-build
    54       print-tests reconfigure pre-compare-build post-compare-build
    55 
    55 
    56   # CALLED_TARGETS is the list of targets that the user provided,
    56   # CALLED_TARGETS is the list of targets that the user provided,
    57   # or "default" if unspecified.
    57   # or "default" if unspecified.
    58   CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
    58   CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
    59 
    59 
    64   # external part, e.g. bash completion, is trying to understand our targets),
    64   # external part, e.g. bash completion, is trying to understand our targets),
    65   # we will skip SPEC location and the sanity checks.
    65   # we will skip SPEC location and the sanity checks.
    66   ifeq ($(CALLED_SPEC_TARGETS), )
    66   ifeq ($(CALLED_SPEC_TARGETS), )
    67     ONLY_GLOBAL_TARGETS := true
    67     ONLY_GLOBAL_TARGETS := true
    68   endif
    68   endif
    69   ifneq ($(findstring qp, $(MAKEFLAGS)),)
    69   ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
    70     ONLY_GLOBAL_TARGETS := true
    70     ONLY_GLOBAL_TARGETS := true
    71   endif
    71   endif
    72 
    72 
    73   ifeq ($(ONLY_GLOBAL_TARGETS), true)
    73   ifeq ($(ONLY_GLOBAL_TARGETS), true)
    74     ############################################################################
    74     ############################################################################
   115     $(eval $(call CheckInvalidMakeFlags))
   115     $(eval $(call CheckInvalidMakeFlags))
   116 
   116 
   117     # Check that CONF_CHECK is valid.
   117     # Check that CONF_CHECK is valid.
   118     $(eval $(call ParseConfCheckOption))
   118     $(eval $(call ParseConfCheckOption))
   119 
   119 
   120     # Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE and MAKE_LOG_FLAGS.
   120     # Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS.
   121     $(eval $(call ParseLogLevel))
   121     $(eval $(call ParseLogLevel))
   122 
   122 
   123     # After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
   123     # After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
   124     $(eval $(call ParseConfAndSpec))
   124     $(eval $(call ParseConfAndSpec))
   125 
   125 
   169 	      $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
   169 	      $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
   170         endif
   170         endif
   171 
   171 
   172     MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
   172     MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
   173         USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
   173         USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
   174         LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) LOG_CMDLINES=$(LOG_CMDLINES) \
   174         $(MAKE_LOG_VARS) \
   175         INIT_TARGETS="$(INIT_TARGETS)" \
   175         INIT_TARGETS="$(INIT_TARGETS)" \
   176         SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
   176         SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
   177         PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
   177         PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
   178 
   178 
   179     # Now the init and main targets will be called, once for each SPEC. The
   179     # Now the init and main targets will be called, once for each SPEC. The
   248 
   248 
   249   print-targets:
   249   print-targets:
   250 	( cd $(TOPDIR) && \
   250 	( cd $(TOPDIR) && \
   251 	    $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
   251 	    $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
   252 	    NO_RECIPES=true print-targets )
   252 	    NO_RECIPES=true print-targets )
       
   253 
       
   254   print-tests:
       
   255 	( cd $(TOPDIR) && \
       
   256 	    $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
       
   257 	    NO_RECIPES=true print-tests )
   253 
   258 
   254   print-configuration:
   259   print-configuration:
   255 	  $(ECHO) $(CONFIGURE_COMMAND_LINE)
   260 	  $(ECHO) $(CONFIGURE_COMMAND_LINE)
   256 
   261 
   257   reconfigure:
   262   reconfigure:
   308 	        exit $$exitcode ) )
   313 	        exit $$exitcode ) )
   309 	    $(call CleanupSmartJavac)
   314 	    $(call CleanupSmartJavac)
   310 	    $(call StopGlobalTimer)
   315 	    $(call StopGlobalTimer)
   311 	    $(call ReportBuildTimes)
   316 	    $(call ReportBuildTimes)
   312           endif
   317           endif
       
   318 	  if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
       
   319 	    exit 1 ; \
       
   320 	  fi
   313 	  $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE)
   321 	  $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE)
       
   322 	  $(call ReportProfileTimes)
   314         endif
   323         endif
   315 
   324 
   316     on-failure:
   325     on-failure:
   317 	$(call CleanupSmartJavac)
   326 	$(call CleanupSmartJavac)
   318 	$(call StopGlobalTimer)
   327 	$(call StopGlobalTimer)
   319 	$(call ReportBuildTimes)
   328 	$(call ReportBuildTimes)
   320 	$(call PrintFailureReports)
   329 	$(call PrintFailureReports)
   321 	$(call PrintBuildLogFailures)
   330 	$(call PrintBuildLogFailures)
       
   331 	$(call ReportProfileTimes)
   322 	$(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n"
   332 	$(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n"
   323         ifneq ($(COMPARE_BUILD), )
   333         ifneq ($(COMPARE_BUILD), )
   324 	  $(call CleanupCompareBuild)
   334 	  $(call CleanupCompareBuild)
   325         endif
   335         endif
   326 
   336