Salome HOME
unification des launcher python et exe, pour passage au mode exe du lanceur salome
[tools/sat.git] / commands / make.py
index 4b15ee14546e98c998dd407b09c2606a2ecf3b23..b3e6aaf54829f54df7b6589d1f1dccae38adbd12 100644 (file)
@@ -24,46 +24,10 @@ import src
 # Define all possible option for the make command :  sat make <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('Optional: products to configure. This option can be'
-    ' passed several time to configure several products.'))
+    _('Optional: products to configure. This option accepts a comma separated list.'))
 parser.add_option('o', 'option', 'string', 'option',
     _('Optional: Option to add to the make command.'), "")
 
-def get_products_list(options, cfg, logger):
-    '''method that gives the product list with their informations from 
-       configuration regarding the passed options.
-    
-    :param options Options: The Options instance that stores the commands 
-                            arguments
-    :param cfg Config: The global configuration
-    :param logger Logger: The logger instance to use for the display and 
-                          logging
-    :return: The list of (product name, product_informations).
-    :rtype: List
-    '''
-    # Get the products to be prepared, regarding the options
-    if options.products is None:
-        # No options, get all products sources
-        products = cfg.APPLICATION.products
-    else:
-        # if option --products, check that all products of the command line
-        # are present in the application.
-        products = options.products
-        for p in products:
-            if p not in cfg.APPLICATION.products:
-                raise src.SatException(_("Product %(product)s "
-                            "not defined in application %(application)s") %
-                        { 'product': p, 'application': cfg.VARS.application} )
-    
-    # Construct the list of tuple containing 
-    # the products name and their definition
-    products_infos = src.product.get_products_infos(products, cfg)
-    
-    products_infos = [pi for pi in products_infos if not(
-                                     src.product.product_is_native(pi[1]) or 
-                                     src.product.product_is_fixed(pi[1]))]
-    
-    return products_infos
 
 def log_step(logger, header, step):
     logger.write("\r%s%s" % (header, " " * 20), 3)
@@ -141,12 +105,14 @@ def make_product(p_name_info, make_option, config, logger):
     # Execute buildconfigure, configure if the product is autotools
     # Execute cmake if the product is cmake
     len_end_line = 20
-    res = 0
+
     nb_proc, make_opt_without_j = get_nb_proc(p_info, config, make_option)
     log_step(logger, header, "MAKE -j" + str(nb_proc))
-    res_m = builder.make(nb_proc, make_opt_without_j)
-    log_res_step(logger, res_m)
-    res += res_m
+    if src.architecture.is_windows():
+        res = builder.wmake(nb_proc, make_opt_without_j)
+    else:
+        res = builder.make(nb_proc, make_opt_without_j)
+    log_res_step(logger, res)
     
     # Log the result
     if res > 0:
@@ -200,9 +166,7 @@ def description():
     :rtype: str
     '''
     return _("The make command executes the \"make\" command in"
-             " the build directory.\nIn case of a product that is constructed "
-             "using a script (build_source :  \"script\"), then the make "
-             "command executes the script.\n\nexample:\nsat make SALOME-master "
+             " the build directory.\nexample:\nsat make SALOME-master "
              "--products Python,KERNEL,GUI")
   
 def run(args, runner, logger):
@@ -216,7 +180,7 @@ def run(args, runner, logger):
     src.check_config_has_application( runner.cfg )
 
     # Get the list of products to treat
-    products_infos = get_products_list(options, runner.cfg, logger)
+    products_infos = src.product.get_products_list(options, runner.cfg, logger)
     
     # Print some informations
     logger.write(_('Executing the make command in the build '