make/InitSupport.gmk
changeset 34491 307c28cb36c2
parent 34101 a1db3b482137
child 34594 7e0595aab028
equal deleted inserted replaced
34490:eb1c1d3d7647 34491:307c28cb36c2
    38   # loaded. Most of these functions provide parsing and setting up make options
    38   # loaded. Most of these functions provide parsing and setting up make options
    39   # from the command-line.
    39   # from the command-line.
    40   ##############################################################################
    40   ##############################################################################
    41 
    41 
    42   # Make control variables, handled by Init.gmk
    42   # Make control variables, handled by Init.gmk
    43   INIT_CONTROL_VARIABLES := LOG CONF SPEC JOBS CONF_CHECK COMPARE_BUILD
    43   INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK COMPARE_BUILD
    44 
    44 
    45   # All known make control variables
    45   # All known make control variables
    46   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
    46   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
    47 
    47 
    48   # Define a simple reverse function.
    48   # Define a simple reverse function.
   167       ifneq ($$(origin CONF), undefined)
   167       ifneq ($$(origin CONF), undefined)
   168         # We also have a CONF argument. We can't have both.
   168         # We also have a CONF argument. We can't have both.
   169         $$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
   169         $$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
   170         $$(error Cannot continue)
   170         $$(error Cannot continue)
   171       endif
   171       endif
       
   172       ifneq ($$(origin CONF_NAME), undefined)
       
   173         # We also have a CONF_NAME argument. We can't have both.
       
   174         $$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
       
   175         $$(error Cannot continue)
       
   176       endif
   172       ifeq ($$(wildcard $$(SPEC)),)
   177       ifeq ($$(wildcard $$(SPEC)),)
   173         $$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
   178         $$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
   174         $$(error Cannot continue)
   179         $$(error Cannot continue)
   175       endif
   180       endif
   176       ifeq ($$(filter /%, $$(SPEC)),)
   181       ifeq ($$(filter /%, $$(SPEC)),)
   189         $$(info Please run 'bash configure' to create a configuration.)
   194         $$(info Please run 'bash configure' to create a configuration.)
   190         $$(info )
   195         $$(info )
   191         $$(error Cannot continue)
   196         $$(error Cannot continue)
   192       endif
   197       endif
   193 
   198 
   194       ifneq ($$(origin CONF), undefined)
   199       ifneq ($$(origin CONF_NAME), undefined)
       
   200         ifneq ($$(origin CONF), undefined)
       
   201           # We also have a CONF argument. We can't have both.
       
   202           $$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
       
   203           $$(error Cannot continue)
       
   204         endif
       
   205         matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
       
   206         ifeq ($$(matching_conf),)
       
   207           $$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
       
   208           $$(info Available configurations in $$(build_dir):)
       
   209           $$(foreach var, $$(all_confs), $$(info * $$(var)))
       
   210           $$(error Cannot continue)
       
   211         else ifneq ($$(words $$(matching_conf)), 1)
       
   212           $$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
       
   213           $$(info Available configurations in $$(build_dir):)
       
   214           $$(foreach var, $$(all_confs), $$(info * $$(var)))
       
   215           $$(error Cannot continue)
       
   216         else
       
   217           $$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
       
   218         endif
       
   219         # Create a SPEC definition. This will contain the path to exactly one spec file.
       
   220         SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
       
   221       else ifneq ($$(origin CONF), undefined)
   195         # User have given a CONF= argument.
   222         # User have given a CONF= argument.
   196         ifeq ($$(CONF),)
   223         ifeq ($$(CONF),)
   197           # If given CONF=, match all configurations
   224           # If given CONF=, match all configurations
   198           matching_confs := $$(strip $$(all_confs))
   225           matching_confs := $$(strip $$(all_confs))
   199         else
   226         else