From: Kevin Day Date: Fri, 25 Jun 2021 02:10:29 +0000 (-0500) Subject: Update: Redesign Featureless Make's -d/--define to append instead of overwrite. X-Git-Tag: 0.5.4~4 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=6cc315f7a41957fe610baa11460a0985184fd5d3;p=fll Update: Redesign Featureless Make's -d/--define to append instead of overwrite. The built in defines can be large and complex. The defines passed through the program arguments should be for exceptional or situational purposes. By using append instead of overwrite, the -d/--define better operates as an exceptional or situational process. --- diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 1180116..2b1bc06 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -28,7 +28,7 @@ extern "C" { fprintf(output.stream, "%c", f_string_eol_s[0]); - fll_program_print_help_option(output, context, fake_short_define, fake_long_define, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Override defines from settings file with this define."); + fll_program_print_help_option(output, context, fake_short_define, fake_long_define, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Append an additional define after defines from settings file."); fll_program_print_help_option(output, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this fakefile."); fll_program_print_help_option(output, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use this mode when processing the build settings."); fll_program_print_help_option(output, context, fake_short_process, fake_long_process, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Process name for storing build states."); diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index a746c27..d90a6e0 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -95,91 +95,84 @@ extern "C" { } } + f_array_length_t i = 0; + if (F_status_is_error_not(*status)) { - for (f_array_length_t i = 0; i < data_build.setting.build_libraries.used; ++i) { + for (i = 0; i < data_build.setting.build_libraries.used; ++i) { *status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i].string, data_build.setting.build_libraries.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } - for (f_array_length_t i = 0; i < data_build.setting.flags_all.used && F_status_is_error_not(*status); ++i) { + for (i = 0; i < data_build.setting.flags_all.used && F_status_is_error_not(*status); ++i) { *status = fll_execute_arguments_add(data_build.setting.flags_all.array[i].string, data_build.setting.flags_all.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for - for (f_array_length_t i = 0; i < data_build.setting.flags_shared.used && F_status_is_error_not(*status); ++i) { + for (i = 0; i < data_build.setting.flags_shared.used && F_status_is_error_not(*status); ++i) { *status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i].string, data_build.setting.flags_shared.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for if (is_library) { - for (f_array_length_t j = 0; j < data_build.setting.flags_library.used && F_status_is_error_not(*status); ++j) { + for (i = 0; i < data_build.setting.flags_library.used && F_status_is_error_not(*status); ++i) { - *status = fll_execute_arguments_add(data_build.setting.flags_library.array[j].string, data_build.setting.flags_library.array[j].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.flags_library.array[i].string, data_build.setting.flags_library.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } else { - for (f_array_length_t i = 0; i < data_build.setting.flags_program.used && F_status_is_error_not(*status); ++i) { + for (i = 0; i < data_build.setting.flags_program.used && F_status_is_error_not(*status); ++i) { *status = fll_execute_arguments_add(data_build.setting.flags_program.array[i].string, data_build.setting.flags_program.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } - if (main.define.used) { - f_array_length_t length = 0; - f_array_length_t i = 0; + for (; i < data_build.setting.defines_all.used && F_status_is_error_not(*status); ++i) { - for (; i < main.define.used && F_status_is_error_not(*status); ++i) { + *status = fll_execute_arguments_add(data_build.setting.defines_all.array[i].string, data_build.setting.defines_all.array[i].used, arguments); + if (F_status_is_error(*status)) break; + } // for - *status = fll_execute_arguments_add(main.define.array[i].string, main.define.array[i].used, arguments); + if (is_shared) { + for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_error_not(*status); ++i) { + + *status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } else { - f_array_length_t length = 0; - f_array_length_t i = 0; + for (i = 0; i < data_build.setting.defines_static.used && F_status_is_error_not(*status); ++i) { - for (; i < data_build.setting.defines_all.used && F_status_is_error_not(*status); ++i) { - - *status = fll_execute_arguments_add(data_build.setting.defines_all.array[i].string, data_build.setting.defines_all.array[i].used, arguments); + *status = fll_execute_arguments_add(data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for + } - if (is_shared) { - for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_error_not(*status); ++i) { - - *status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used, arguments); - if (F_status_is_error(*status)) break; - } // for - } - else { - for (i = 0; i < data_build.setting.defines_static.used && F_status_is_error_not(*status); ++i) { + if (is_library) { + for (i = 0; i < data_build.setting.defines_library.used && F_status_is_error_not(*status); ++i) { - *status = fll_execute_arguments_add(data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used, arguments); - if (F_status_is_error(*status)) break; - } // for - } + *status = fll_execute_arguments_add(data_build.setting.defines_library.array[i].string, data_build.setting.defines_library.array[i].used, arguments); + if (F_status_is_error(*status)) break; + } // for + } + else { + for (i = 0; i < data_build.setting.defines_program.used && F_status_is_error_not(*status); ++i) { - if (is_library) { - for (i = 0; i < data_build.setting.defines_library.used && F_status_is_error_not(*status); ++i) { + *status = fll_execute_arguments_add(data_build.setting.defines_program.array[i].string, data_build.setting.defines_program.array[i].used, arguments); + if (F_status_is_error(*status)) break; + } // for + } - *status = fll_execute_arguments_add(data_build.setting.defines_library.array[i].string, data_build.setting.defines_library.array[i].used, arguments); - if (F_status_is_error(*status)) break; - } // for - } - else { - for (i = 0; i < data_build.setting.defines_program.used && F_status_is_error_not(*status); ++i) { + for (i = 0; i < main.define.used && F_status_is_error_not(*status); ++i) { - *status = fll_execute_arguments_add(data_build.setting.defines_program.array[i].string, data_build.setting.defines_program.array[i].used, arguments); - if (F_status_is_error(*status)) break; - } // for - } - } + *status = fll_execute_arguments_add(main.define.array[i].string, main.define.array[i].used, arguments); + if (F_status_is_error(*status)) break; + } // for } #endif // _di_fake_build_arguments_standard_add_