make/Init.gmk
changeset 45770 115c8ed31e9d
parent 45763 2a2e56f4c03b
child 45822 f8fca310fb7b
equal deleted inserted replaced
45769:2ed643787f98 45770:115c8ed31e9d
     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     ############################################################################
   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)
   314         endif
   322         endif
   315 
   323 
   316     on-failure:
   324     on-failure:
   317 	$(call CleanupSmartJavac)
   325 	$(call CleanupSmartJavac)
   318 	$(call StopGlobalTimer)
   326 	$(call StopGlobalTimer)
   319 	$(call ReportBuildTimes)
   327 	$(call ReportBuildTimes)
   320 	$(call PrintFailureReports)
   328 	$(call PrintFailureReports)
   321 	$(call PrintBuildLogFailures)
   329 	$(call PrintBuildLogFailures)
   322 	$(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n"
   330 	$(PRINTF) "Hint: See common/doc/building.html#troubleshooting for assistance.\n\n"
   323         ifneq ($(COMPARE_BUILD), )
   331         ifneq ($(COMPARE_BUILD), )
   324 	  $(call CleanupCompareBuild)
   332 	  $(call CleanupCompareBuild)
   325         endif
   333         endif
   326 
   334 
   327     # Support targets for COMPARE_BUILD, used for makefile development
   335     # Support targets for COMPARE_BUILD, used for makefile development