X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=commands%2Fmake.py;h=45b3155faa48e4185497a402e85b19e55f499114;hb=11c99a29802614c1c09c32e7c803959bfcc3c721;hp=9d885b33bf16ca4d9cdbe50294f70008227d0b03;hpb=2f38beaea8436fdb26d4f2516340cf33361d0b95;p=tools%2Fsat.git diff --git a/commands/make.py b/commands/make.py index 9d885b3..45b3155 100644 --- a/commands/make.py +++ b/commands/make.py @@ -24,10 +24,10 @@ import src # Define all possible option for the make command : sat make parser = src.options.Options() parser.add_option('p', 'products', 'list2', 'products', - _('products to configure. This option can be' + _('Optional: products to configure. This option can be' ' passed several time to configure several products.')) parser.add_option('o', 'option', 'string', 'option', - _('Option to add to the make command.'), "") + _('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 @@ -121,7 +121,14 @@ def make_product(p_name_info, make_option, config, logger): logger.write(header, 3) logger.write("\n", 4, False) logger.flush() - + + # Do nothing if he product is not compilable + if ("properties" in p_info and "compilation" in p_info.properties and + p_info.properties.compilation == "no"): + log_step(logger, header, "ignored") + logger.write("\n", 3, False) + return 0 + # Instantiate the class that manages all the construction commands # like cmake, make, make install, make test, environment management, etc... builder = src.compilation.Builder(config, logger, p_info) @@ -134,20 +141,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 - if not src.product.product_has_script(p_info): - 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 + + nb_proc, make_opt_without_j = get_nb_proc(p_info, config, make_option) + log_step(logger, header, "MAKE -j" + str(nb_proc)) + if src.architecture.is_windows(): + res = builder.wmake(nb_proc, make_opt_without_j) else: - scrit_path_display = src.printcolors.printcLabel(p_info.compil_script) - log_step(logger, header, "SCRIPT " + scrit_path_display) - len_end_line += len(scrit_path_display) - res_s = builder.do_script_build(p_info.compil_script) - log_res_step(logger, res_s) - res += res_s + res = builder.make(nb_proc, make_opt_without_j) + log_res_step(logger, res) # Log the result if res > 0: @@ -201,7 +202,8 @@ def description(): :rtype: str ''' return _("The make command executes the \"make\" command in" - " the build directory") + " the build directory.\nexample:\nsat make SALOME-master " + "--products Python,KERNEL,GUI") def run(args, runner, logger): '''method that is called when salomeTools is called with make parameter. @@ -213,7 +215,7 @@ def run(args, runner, logger): # check that the command has been called with an application src.check_config_has_application( runner.cfg ) - # Get the list of products to threat + # Get the list of products to treat products_infos = get_products_list(options, runner.cfg, logger) # Print some informations @@ -227,6 +229,8 @@ def run(args, runner, logger): # Call the function that will loop over all the products and execute # the right command(s) + if options.option is None: + options.option = "" res = make_all_products(runner.cfg, products_infos, options.option, logger) # Print the final state