From 890c9a2b04493ce5e97bd9fe458d178e76490c59 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 4 Sep 2020 23:44:45 -0500 Subject: [PATCH] Feature: featureless make should support custom source paths in data/build/settings. The standard path is used by the featureless linux library. If any other project, such as bzip2, has its own directory structure provide a way to more likely support that when using the build operation. This is not intended to handle all possible cases. This is only intended to handle simple cases such as with bzip2. For more complex builds the fakefile and the make operation should instead be used. This adds a path_standard setting that is a yes/no boolean for designating if/when to follow the standard source path structure or not. When this is 'yes', then the standard sources path such as 'sources/c/' is used or when -S/--sources is supplied then the path would be 'XXX/c/' when using "-S xxx/" as an example. When this is 'no', then the sources path specified by a new setting 'path_sources' is used but when -S/--sources is supplied then the path would be 'XXX/' when using "-S xxx/" as an example. The result of this change moves the "sources/" directory from required to optional. This directory is no longer checked for during the check required directories process. The bootstrap.sh script is exclusively intended to be used for compiling the featureless linux library. Therefore, the 'path_standard' and 'path_sources' are unimplemented within that script (beyond being defined in the variable list). --- build/scripts/bootstrap.sh | 56 +++++++------- level_0/f_account/data/build/settings | 2 + level_0/f_color/data/build/settings | 2 + level_0/f_console/data/build/settings | 2 + level_0/f_conversion/data/build/settings | 2 + level_0/f_directory/data/build/settings | 2 + level_0/f_environment/data/build/settings | 2 + level_0/f_file/data/build/settings | 2 + level_0/f_fss/data/build/settings | 2 + level_0/f_iki/data/build/settings | 2 + level_0/f_memory/data/build/settings | 2 + level_0/f_path/data/build/settings | 2 + level_0/f_pipe/data/build/settings | 2 + level_0/f_print/data/build/settings | 2 + level_0/f_serialize/data/build/settings | 2 + level_0/f_socket/data/build/settings | 2 + level_0/f_status/data/build/settings | 2 + level_0/f_string/data/build/settings | 2 + level_0/f_type/data/build/settings | 2 + level_0/f_utf/data/build/settings | 2 + level_1/fl_color/data/build/settings | 2 + level_1/fl_console/data/build/settings | 2 + level_1/fl_conversion/data/build/settings | 2 + level_1/fl_directory/data/build/settings | 2 + level_1/fl_environment/data/build/settings | 2 + level_1/fl_fss/data/build/settings | 2 + level_1/fl_iki/data/build/settings | 2 + level_1/fl_print/data/build/settings | 2 + level_1/fl_status/data/build/settings | 2 + level_1/fl_string/data/build/settings | 2 + level_1/fl_utf/data/build/settings | 2 + level_1/fl_utf_file/data/build/settings | 2 + level_2/fll_execute/data/build/settings | 2 + level_2/fll_file/data/build/settings | 2 + level_2/fll_fss/data/build/settings | 2 + level_2/fll_path/data/build/settings | 2 + level_2/fll_program/data/build/settings | 2 + level_2/fll_status/data/build/settings | 2 + level_3/byte_dump/data/build/settings | 2 + level_3/fake/c/fake.h | 2 - level_3/fake/c/private-build.c | 89 ++++++++++++++++++---- level_3/fake/c/private-build.h | 12 ++- level_3/fake/c/private-fake.c | 16 ++-- level_3/fake/c/private-make.c | 10 ++- level_3/fake/data/build/settings | 2 + level_3/fake/data/build/settings-example-bzip2 | 2 + .../fake/data/build/settings-example-bzip2recover | 2 + level_3/fake/documents/settings.txt | 8 ++ level_3/fake/specifications/settings.txt | 2 + level_3/firewall/data/build/settings | 2 + level_3/fss_basic_list_read/data/build/settings | 2 + level_3/fss_basic_list_write/data/build/settings | 2 + level_3/fss_basic_read/data/build/settings | 2 + level_3/fss_basic_write/data/build/settings | 2 + level_3/fss_extended_list_read/data/build/settings | 2 + level_3/fss_extended_read/data/build/settings | 2 + level_3/fss_extended_write/data/build/settings | 2 + level_3/fss_status_code/data/build/settings | 2 + level_3/iki_read/data/build/settings | 2 + level_3/init/data/build/settings | 2 + level_3/status_code/data/build/settings | 2 + 61 files changed, 245 insertions(+), 56 deletions(-) diff --git a/build/scripts/bootstrap.sh b/build/scripts/bootstrap.sh index 6341a17..bb3169d 100644 --- a/build/scripts/bootstrap.sh +++ b/build/scripts/bootstrap.sh @@ -435,32 +435,34 @@ bootstrap_id() { "path_program_script") echo -n 28;; "path_program_shared") echo -n 29;; "path_program_static") echo -n 30;; - "process_post") echo -n 31;; - "process_pre") echo -n 32;; - "project_name") echo -n 33;; - "search_exclusive") echo -n 34;; - "search_shared") echo -n 35;; - "search_static") echo -n 36;; - "version_major") echo -n 37;; - "version_micro") echo -n 38;; - "version_minor") echo -n 39;; - "version_target") echo -n 40;; - - "build_libraries-$mode") echo -n 41;; - "build_sources_headers-$mode") echo -n 42;; - "build_sources_library-$mode") echo -n 43;; - "build_sources_program-$mode") echo -n 44;; - "build_sources_setting-$mode") echo -n 45;; - "build_sources_script-$mode") echo -n 46;; - "defines_all-$mode") echo -n 47;; - "defines_shared-$mode") echo -n 48;; - "defines_static-$mode") echo -n 49;; - "environment-$mode") echo -n 50;; - "flags_all-$mode") echo -n 51;; - "flags_library-$mode") echo -n 52;; - "flags_program-$mode") echo -n 53;; - "flags_shared-$mode") echo -n 54;; - "flags_static-$mode") echo -n 55;; + "path_sources") echo -n 31;; + "path_standard") echo -n 32;; + "process_post") echo -n 33;; + "process_pre") echo -n 34;; + "project_name") echo -n 35;; + "search_exclusive") echo -n 36;; + "search_shared") echo -n 37;; + "search_static") echo -n 38;; + "version_major") echo -n 39;; + "version_micro") echo -n 40;; + "version_minor") echo -n 41;; + "version_target") echo -n 42;; + + "build_libraries-$mode") echo -n 43;; + "build_sources_headers-$mode") echo -n 44;; + "build_sources_library-$mode") echo -n 45;; + "build_sources_program-$mode") echo -n 46;; + "build_sources_setting-$mode") echo -n 47;; + "build_sources_script-$mode") echo -n 48;; + "defines_all-$mode") echo -n 49;; + "defines_shared-$mode") echo -n 50;; + "defines_static-$mode") echo -n 51;; + "environment-$mode") echo -n 52;; + "flags_all-$mode") echo -n 53;; + "flags_library-$mode") echo -n 54;; + "flags_program-$mode") echo -n 55;; + "flags_shared-$mode") echo -n 56;; + "flags_static-$mode") echo -n 57;; esac } @@ -488,7 +490,7 @@ bootstrap_load_settings() { exit $failure fi - for i in build_compiler build_language build_libraries build_linker build_script build_shared build_sources_headers build_sources_library build_sources_program build_sources_setting build_sources_script build_static defines_all defines_shared defines_static environment flags_all flags_library flags_program flags_shared flags_static modes modes_default path_language path_headers path_library_script path_library_shared path_library_static path_program_script path_program_shared path_program_static process_post process_pre project_name search_exclusive search_shared search_static version_major version_micro version_minor ; do + for i in build_compiler build_language build_libraries build_linker build_script build_shared build_sources_headers build_sources_library build_sources_program build_sources_setting build_sources_script build_static defines_all defines_shared defines_static environment flags_all flags_library flags_program flags_shared flags_static modes modes_default path_language path_headers path_library_script path_library_shared path_library_static path_program_script path_program_shared path_program_static path_sources path_standard process_post process_pre project_name search_exclusive search_shared search_static version_major version_micro version_minor ; do variables[$(bootstrap_id $i)]=$(grep -s -o "^[[:space:]]*$i[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*$i\>||" -e 's|^[[:space:]]*||') done } diff --git a/level_0/f_account/data/build/settings b/level_0/f_account/data/build/settings index 82ded25..5d28964 100644 --- a/level_0/f_account/data/build/settings +++ b/level_0/f_account/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_color/data/build/settings b/level_0/f_color/data/build/settings index 4d9de0b..c4f5eac 100644 --- a/level_0/f_color/data/build/settings +++ b/level_0/f_color/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_console/data/build/settings b/level_0/f_console/data/build/settings index 327133d..7dab937 100644 --- a/level_0/f_console/data/build/settings +++ b/level_0/f_console/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_conversion/data/build/settings b/level_0/f_conversion/data/build/settings index 182ed6e..11624cc 100644 --- a/level_0/f_conversion/data/build/settings +++ b/level_0/f_conversion/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_directory/data/build/settings b/level_0/f_directory/data/build/settings index 62041c8..01c4e24 100644 --- a/level_0/f_directory/data/build/settings +++ b/level_0/f_directory/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_environment/data/build/settings b/level_0/f_environment/data/build/settings index e140d64..97dc09d 100644 --- a/level_0/f_environment/data/build/settings +++ b/level_0/f_environment/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_file/data/build/settings b/level_0/f_file/data/build/settings index a8ba777..953619c 100644 --- a/level_0/f_file/data/build/settings +++ b/level_0/f_file/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index 2aed800..5b74602 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_iki/data/build/settings b/level_0/f_iki/data/build/settings index 570317e..d17147d 100644 --- a/level_0/f_iki/data/build/settings +++ b/level_0/f_iki/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_memory/data/build/settings b/level_0/f_memory/data/build/settings index d55eb1f..8dbc496 100644 --- a/level_0/f_memory/data/build/settings +++ b/level_0/f_memory/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_path/data/build/settings b/level_0/f_path/data/build/settings index 0c0f908..fc6701a 100644 --- a/level_0/f_path/data/build/settings +++ b/level_0/f_path/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_pipe/data/build/settings b/level_0/f_pipe/data/build/settings index df155e8..1147df1 100644 --- a/level_0/f_pipe/data/build/settings +++ b/level_0/f_pipe/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_print/data/build/settings b/level_0/f_print/data/build/settings index c4d061c..54be37c 100644 --- a/level_0/f_print/data/build/settings +++ b/level_0/f_print/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_serialize/data/build/settings b/level_0/f_serialize/data/build/settings index fc7659d..0d08928 100644 --- a/level_0/f_serialize/data/build/settings +++ b/level_0/f_serialize/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_socket/data/build/settings b/level_0/f_socket/data/build/settings index e20a3f6..9b4dc47 100644 --- a/level_0/f_socket/data/build/settings +++ b/level_0/f_socket/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_status/data/build/settings b/level_0/f_status/data/build/settings index a324308..7b35729 100644 --- a/level_0/f_status/data/build/settings +++ b/level_0/f_status/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_string/data/build/settings b/level_0/f_string/data/build/settings index a3a80b2..fbcd0d4 100644 --- a/level_0/f_string/data/build/settings +++ b/level_0/f_string/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_type/data/build/settings b/level_0/f_type/data/build/settings index b29c3c8..93b9eb9 100644 --- a/level_0/f_type/data/build/settings +++ b/level_0/f_type/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_0/f_utf/data/build/settings b/level_0/f_utf/data/build/settings index 6d506b8..5c149bb 100644 --- a/level_0/f_utf/data/build/settings +++ b/level_0/f_utf/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_color/data/build/settings b/level_1/fl_color/data/build/settings index b1243a1..7fec93b 100644 --- a/level_1/fl_color/data/build/settings +++ b/level_1/fl_color/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_console/data/build/settings b/level_1/fl_console/data/build/settings index 41e2041..491a237 100644 --- a/level_1/fl_console/data/build/settings +++ b/level_1/fl_console/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_conversion/data/build/settings b/level_1/fl_conversion/data/build/settings index 36f5aa9..6105dee 100644 --- a/level_1/fl_conversion/data/build/settings +++ b/level_1/fl_conversion/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_directory/data/build/settings b/level_1/fl_directory/data/build/settings index 3353f3c..6184d2c 100644 --- a/level_1/fl_directory/data/build/settings +++ b/level_1/fl_directory/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_environment/data/build/settings b/level_1/fl_environment/data/build/settings index df41342..3988b5a 100644 --- a/level_1/fl_environment/data/build/settings +++ b/level_1/fl_environment/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_fss/data/build/settings b/level_1/fl_fss/data/build/settings index 57a5588..0539c66 100644 --- a/level_1/fl_fss/data/build/settings +++ b/level_1/fl_fss/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_iki/data/build/settings b/level_1/fl_iki/data/build/settings index ff67114..5b94f71 100644 --- a/level_1/fl_iki/data/build/settings +++ b/level_1/fl_iki/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_print/data/build/settings b/level_1/fl_print/data/build/settings index 19fe593..2068a95 100644 --- a/level_1/fl_print/data/build/settings +++ b/level_1/fl_print/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_status/data/build/settings b/level_1/fl_status/data/build/settings index 647294e..e582323 100644 --- a/level_1/fl_status/data/build/settings +++ b/level_1/fl_status/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_string/data/build/settings b/level_1/fl_string/data/build/settings index 1693949..d17a1e9 100644 --- a/level_1/fl_string/data/build/settings +++ b/level_1/fl_string/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_utf/data/build/settings b/level_1/fl_utf/data/build/settings index f0fa132..0533a88 100644 --- a/level_1/fl_utf/data/build/settings +++ b/level_1/fl_utf/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_1/fl_utf_file/data/build/settings b/level_1/fl_utf_file/data/build/settings index a772548..83edb99 100644 --- a/level_1/fl_utf_file/data/build/settings +++ b/level_1/fl_utf_file/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_execute/data/build/settings b/level_2/fll_execute/data/build/settings index a5531af..a70371b 100644 --- a/level_2/fll_execute/data/build/settings +++ b/level_2/fll_execute/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_file/data/build/settings b/level_2/fll_file/data/build/settings index fa37f7d..ac1cfb8 100644 --- a/level_2/fll_file/data/build/settings +++ b/level_2/fll_file/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_fss/data/build/settings b/level_2/fll_fss/data/build/settings index 450ac05..5983b60 100644 --- a/level_2/fll_fss/data/build/settings +++ b/level_2/fll_fss/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_path/data/build/settings b/level_2/fll_path/data/build/settings index 53312c0..26fa3f2 100644 --- a/level_2/fll_path/data/build/settings +++ b/level_2/fll_path/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_program/data/build/settings b/level_2/fll_program/data/build/settings index 3d303a9..e73e732 100644 --- a/level_2/fll_program/data/build/settings +++ b/level_2/fll_program/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_2/fll_status/data/build/settings b/level_2/fll_status/data/build/settings index f57a4a3..2665e87 100644 --- a/level_2/fll_status/data/build/settings +++ b/level_2/fll_status/data/build/settings @@ -36,6 +36,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index 963be4c..c87f4a3 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index a370e22..da8ab33 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -120,7 +120,6 @@ extern "C" { #define fake_path_part_script "script" f_path_separator #define fake_path_part_settings "settings" f_path_separator #define fake_path_part_shared "shared" f_path_separator - #define fake_path_part_sources "sources" f_path_separator #define fake_path_part_stage "stage" f_path_separator #define fake_path_part_static "static" f_path_separator @@ -139,7 +138,6 @@ extern "C" { #define fake_path_part_script_length 7 #define fake_path_part_settings_length 9 #define fake_path_part_shared_length 7 - #define fake_path_part_sources_length 8 #define fake_path_part_stage_length 6 #define fake_path_part_static_length 7 #endif // _di_fake_path_ diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index fe720f0..e31ab31 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -597,10 +597,17 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static_t *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources; - if (data_build.setting.build_language == fake_build_language_type_cpp) { - path_sources = &data.path_sources_cpp; + if (data_build.setting.path_standard) { + path_sources = &data.path_sources_c; + + if (data_build.setting.build_language == fake_build_language_type_cpp) { + path_sources = &data.path_sources_cpp; + } + } + else if (data.parameters[fake_parameter_path_sources].result != f_console_result_additional) { + path_sources = &data_build.setting.path_sources; } f_string_length_t source_length = 0; @@ -1260,6 +1267,8 @@ extern "C" { fake_build_setting_name_path_program_script, fake_build_setting_name_path_program_shared, fake_build_setting_name_path_program_static, + fake_build_setting_name_path_sources, + fake_build_setting_name_path_standard, fake_build_setting_name_process_post, fake_build_setting_name_process_pre, fake_build_setting_name_project_name, @@ -1304,6 +1313,8 @@ extern "C" { fake_build_setting_name_path_program_script_length, fake_build_setting_name_path_program_shared_length, fake_build_setting_name_path_program_static_length, + fake_build_setting_name_path_sources_length, + fake_build_setting_name_path_standard_length, fake_build_setting_name_process_post_length, fake_build_setting_name_process_pre_length, fake_build_setting_name_project_name_length, @@ -1330,6 +1341,8 @@ extern "C" { f_string_dynamics_t path_program_script = f_string_dynamics_t_initialize; f_string_dynamics_t path_program_shared = f_string_dynamics_t_initialize; f_string_dynamics_t path_program_static = f_string_dynamics_t_initialize; + f_string_dynamics_t path_sources = f_string_dynamics_t_initialize; + f_string_dynamics_t path_standard = f_string_dynamics_t_initialize; f_string_dynamics_t process_post = f_string_dynamics_t_initialize; f_string_dynamics_t process_pre = f_string_dynamics_t_initialize; f_string_dynamics_t project_name = f_string_dynamics_t_initialize; @@ -1373,6 +1386,8 @@ extern "C" { &path_program_script, &path_program_shared, &path_program_static, + &path_sources, + &path_standard, &process_post, &process_pre, &project_name, @@ -1496,6 +1511,8 @@ extern "C" { fake_build_setting_name_path_program_script, fake_build_setting_name_path_program_shared, fake_build_setting_name_path_program_static, + fake_build_setting_name_path_sources, + fake_build_setting_name_path_standard, fake_build_setting_name_process_post, fake_build_setting_name_process_pre, fake_build_setting_name_project_name, @@ -1523,6 +1540,8 @@ extern "C" { &path_program_script, &path_program_shared, &path_program_static, + &path_sources, + &path_standard, &process_post, &process_pre, &project_name, @@ -1551,6 +1570,8 @@ extern "C" { 0, 0, 0, + &setting->path_standard, + 0, 0, 0, &setting->search_exclusive, @@ -1573,6 +1594,8 @@ extern "C" { &setting->path_program_script, &setting->path_program_shared, &setting->path_program_static, + &setting->path_sources, + 0, &setting->process_post, &setting->process_pre, &setting->project_name, @@ -1613,6 +1636,8 @@ extern "C" { 0, 0, 0, + 0, + 0, &setting->version_target, }; @@ -1632,6 +1657,8 @@ extern "C" { 2, 2, 2, + 2, + 1, 3, 3, 3, @@ -1644,7 +1671,7 @@ extern "C" { 5, }; - for (f_array_length_t i = 0; i < 24; i++) { + for (f_array_length_t i = 0; i < 26; i++) { if (settings_single_source[i]->used == 0) continue; if (settings_single_source[i]->used > 1) { @@ -1789,6 +1816,8 @@ extern "C" { f_macro_string_dynamics_t_delete_simple(path_program_script); f_macro_string_dynamics_t_delete_simple(path_program_shared); f_macro_string_dynamics_t_delete_simple(path_program_static); + f_macro_string_dynamics_t_delete_simple(path_sources); + f_macro_string_dynamics_t_delete_simple(path_standard); f_macro_string_dynamics_t_delete_simple(process_post); f_macro_string_dynamics_t_delete_simple(process_pre); f_macro_string_dynamics_t_delete_simple(project_name); @@ -2055,10 +2084,17 @@ extern "C" { f_string_length_t source_length = 0; f_string_length_t destination_length = 0; - const f_string_static_t *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources; - if (data_build.setting.build_language == fake_build_language_type_cpp) { - path_sources = &data.path_sources_cpp; + if (data_build.setting.path_standard) { + path_sources = &data.path_sources_c; + + if (data_build.setting.build_language == fake_build_language_type_cpp) { + path_sources = &data.path_sources_cpp; + } + } + else if (data.parameters[fake_parameter_path_sources].result != f_console_result_additional) { + path_sources = &data_build.setting.path_sources; } for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) { @@ -2250,10 +2286,17 @@ extern "C" { } else { if (data_build.setting.build_sources_headers.used) { - const f_string_static_t *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources; - if (data_build.setting.build_language == fake_build_language_type_cpp) { - path_sources = &data.path_sources_cpp; + if (data_build.setting.path_standard) { + path_sources = &data.path_sources_c; + + if (data_build.setting.build_language == fake_build_language_type_cpp) { + path_sources = &data.path_sources_cpp; + } + } + else if (data.parameters[fake_parameter_path_sources].result != f_console_result_additional) { + path_sources = &data_build.setting.path_sources; } f_string_static_t path_headers = f_string_static_t_initialize; @@ -2335,10 +2378,17 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static_t *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources; - if (data_build.setting.build_language == fake_build_language_type_cpp) { - path_sources = &data.path_sources_cpp; + if (data_build.setting.path_standard) { + path_sources = &data.path_sources_c; + + if (data_build.setting.build_language == fake_build_language_type_cpp) { + path_sources = &data.path_sources_cpp; + } + } + else if (data.parameters[fake_parameter_path_sources].result != f_console_result_additional) { + path_sources = &data_build.setting.path_sources; } f_string_length_t source_length = 0; @@ -2427,10 +2477,17 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static_t *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources; - if (data_build.setting.build_language == fake_build_language_type_cpp) { - path_sources = &data.path_sources_cpp; + if (data_build.setting.path_standard) { + path_sources = &data.path_sources_c; + + if (data_build.setting.build_language == fake_build_language_type_cpp) { + path_sources = &data.path_sources_cpp; + } + } + else if (data.parameters[fake_parameter_path_sources].result != f_console_result_additional) { + path_sources = &data_build.setting.path_sources; } f_string_length_t source_length = 0; diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index db78e22..ac33349 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -22,6 +22,8 @@ extern "C" { bool build_shared; bool build_static; + bool path_standard; + bool search_exclusive; bool search_shared; bool search_static; @@ -36,6 +38,7 @@ extern "C" { f_string_dynamic_t path_program_script; f_string_dynamic_t path_program_shared; f_string_dynamic_t path_program_static; + f_string_dynamic_t path_sources; f_string_dynamic_t process_post; f_string_dynamic_t process_pre; f_string_dynamic_t project_name; @@ -71,6 +74,8 @@ extern "C" { F_true, \ F_true, \ F_true, \ + F_true, \ + f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ @@ -117,6 +122,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(setting.path_program_script) \ f_macro_string_dynamic_t_delete_simple(setting.path_program_shared) \ f_macro_string_dynamic_t_delete_simple(setting.path_program_static) \ + f_macro_string_dynamic_t_delete_simple(setting.path_sources) \ f_macro_string_dynamic_t_delete_simple(setting.process_post) \ f_macro_string_dynamic_t_delete_simple(setting.process_pre) \ f_macro_string_dynamic_t_delete_simple(setting.project_name) \ @@ -172,6 +178,8 @@ extern "C" { #define fake_build_setting_name_path_program_script "path_program_script" #define fake_build_setting_name_path_program_shared "path_program_shared" #define fake_build_setting_name_path_program_static "path_program_static" + #define fake_build_setting_name_path_sources "path_sources" + #define fake_build_setting_name_path_standard "path_standard" #define fake_build_setting_name_process_post "process_post" #define fake_build_setting_name_process_pre "process_pre" #define fake_build_setting_name_project_name "project_name" @@ -214,6 +222,8 @@ extern "C" { #define fake_build_setting_name_path_program_script_length 19 #define fake_build_setting_name_path_program_shared_length 19 #define fake_build_setting_name_path_program_static_length 19 + #define fake_build_setting_name_path_sources_length 12 + #define fake_build_setting_name_path_standard_length 13 #define fake_build_setting_name_process_post_length 12 #define fake_build_setting_name_process_pre_length 11 #define fake_build_setting_name_project_name_length 12 @@ -225,7 +235,7 @@ extern "C" { #define fake_build_setting_name_version_minor_length 13 #define fake_build_setting_name_version_target_length 14 - #define fake_build_setting_total 41 + #define fake_build_setting_total 43 #define fake_build_setting_default_version "0" diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index cfe6e3c..fee84c5 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -30,7 +30,12 @@ extern "C" { { int result = 0; - *status = fll_execute_program_environment(program.string, arguments, environment.names, environment.values, &result); + if (program.used) { + *status = fll_execute_program_environment(program.string, arguments, environment.names, environment.values, &result); + } + else { + *status = F_status_set_error(F_file_found_not); + } if (result != 0) { *status = F_status_set_error(F_failure); @@ -40,7 +45,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to find program '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", program.string); + fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", program.used ? program.string : ""); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' for executing."); } } @@ -888,42 +893,37 @@ extern "C" { const f_string_t parameters_name[] = { fake_long_path_build, fake_long_path_data, - fake_long_path_sources, fake_long_path_work, }; const f_string_t parameter_defaults[] = { fake_default_path_build, fake_default_path_data, - fake_default_path_sources, fake_default_path_work, }; const f_string_length_t parameter_default_lengths[] = { fake_default_path_build_length, fake_default_path_data_length, - fake_default_path_sources_length, fake_default_path_work_length, }; const f_string_dynamic_t *parameters_value[] = { &data.path_build, &data.path_data, - &data.path_sources, &data.path_work, }; const bool parameters_required[] = { F_false, F_true, - F_true, F_false, }; struct stat directory_stat; f_status_t status = F_none; - for (uint8_t i = 0; i < 4; i++) { + for (uint8_t i = 0; i < 3; i++) { if (parameters_value[i]->used > 0) { memset(&directory_stat, 0, sizeof(struct stat)); diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 068d8c8..a9f97a8 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -1063,6 +1063,7 @@ extern "C" { fake_build_setting_name_build_script, fake_build_setting_name_build_shared, fake_build_setting_name_build_static, + fake_build_setting_name_path_standard, fake_build_setting_name_search_exclusive, fake_build_setting_name_search_shared, fake_build_setting_name_search_static, @@ -1072,6 +1073,7 @@ extern "C" { fake_build_setting_name_build_script_length, fake_build_setting_name_build_shared_length, fake_build_setting_name_build_static_length, + fake_build_setting_name_path_standard_length, fake_build_setting_name_search_exclusive_length, fake_build_setting_name_search_shared_length, fake_build_setting_name_search_static_length, @@ -1081,12 +1083,13 @@ extern "C" { data_make->setting_build.build_script, data_make->setting_build.build_shared, data_make->setting_build.build_static, + data_make->setting_build.path_standard, data_make->setting_build.search_exclusive, data_make->setting_build.search_shared, data_make->setting_build.search_static, }; - for (uint8_t i = 0; i < 6; i++) { + for (uint8_t i = 0; i < 7; i++) { status = fl_string_dynamic_partial_compare_string(bool_name[i], data_make->buffer, bool_length[i], range_name); if (status == F_equal_to) { @@ -1116,6 +1119,7 @@ extern "C" { fake_build_setting_name_path_program_script, fake_build_setting_name_path_program_shared, fake_build_setting_name_path_program_static, + fake_build_setting_name_path_sources, fake_build_setting_name_process_post, fake_build_setting_name_process_pre, fake_build_setting_name_project_name, @@ -1135,6 +1139,7 @@ extern "C" { fake_build_setting_name_path_program_script_length, fake_build_setting_name_path_program_shared_length, fake_build_setting_name_path_program_static_length, + fake_build_setting_name_path_sources_length, fake_build_setting_name_process_post_length, fake_build_setting_name_process_pre_length, fake_build_setting_name_project_name_length, @@ -1154,6 +1159,7 @@ extern "C" { data_make->setting_build.path_program_script, data_make->setting_build.path_program_shared, data_make->setting_build.path_program_static, + data_make->setting_build.path_sources, data_make->setting_build.process_post, data_make->setting_build.process_pre, data_make->setting_build.project_name, @@ -1162,7 +1168,7 @@ extern "C" { data_make->setting_build.version_minor, }; - for (uint8_t i = 0; i < 16; i++) { + for (uint8_t i = 0; i < 17; i++) { status = fl_string_dynamic_partial_compare_string(dynamic_name[i], data_make->buffer, dynamic_length[i], range_name); if (status == F_equal_to) { diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index 2d1ce37..e0b9cfe 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fake/data/build/settings-example-bzip2 b/level_3/fake/data/build/settings-example-bzip2 index a4e6f4d..d409f84 100644 --- a/level_3/fake/data/build/settings-example-bzip2 +++ b/level_3/fake/data/build/settings-example-bzip2 @@ -39,6 +39,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard no search_exclusive yes search_shared yes diff --git a/level_3/fake/data/build/settings-example-bzip2recover b/level_3/fake/data/build/settings-example-bzip2recover index 5004eb2..fd53c1d 100644 --- a/level_3/fake/data/build/settings-example-bzip2recover +++ b/level_3/fake/data/build/settings-example-bzip2recover @@ -39,6 +39,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard no search_exclusive yes search_shared yes diff --git a/level_3/fake/documents/settings.txt b/level_3/fake/documents/settings.txt index a232b32..d339346 100644 --- a/level_3/fake/documents/settings.txt +++ b/level_3/fake/documents/settings.txt @@ -136,6 +136,14 @@ Settings Documentation: path_program_static\: A sub-path representing when the built shared program files are placed. + path_sources\: + A sub-path representing when the built shared program files are placed. + + path_standard\: + When "yes", the sources path will be built using the sources path with the language, such as "sources/c/", ignoring "path_sources" completely. + When "no", the default sources path structure is not used and instead "path_sources" is used. + When the parameter -S/--sources is specified, such as "-S xxx", then when "yes" is used path would be "xxx/c/" and when "no" path would be "xxx/". + project_name\: The name of the project. If program sources are specified, then this will be used as the program name. diff --git a/level_3/fake/specifications/settings.txt b/level_3/fake/specifications/settings.txt index 0ef3624..2e5047d 100644 --- a/level_3/fake/specifications/settings.txt +++ b/level_3/fake/specifications/settings.txt @@ -41,6 +41,8 @@ Settings Specification: "path_program_script": Must be a single valid path. "path_program_shared": Must be a single valid path. "path_program_static": Must be a single valid path. + "path_sources": Must only be a valid directory path or not specified. + "path_standard": Must only one of: "yes" or "no". "project_name": Must only contain characters allowed in a filename. "process_post": Must contain only a single valid filename. "process_pre": Must contain only a single valid filename. diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 7755289..ed21384 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 28831ba..ff5c8d8 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index 71e0677..147f7c9 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index a23f0c0..759f938 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 3ab73d9..d392fa1 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index 568dd96..ef05779 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 7afeeb1..d918345 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index f5b7471..5249e33 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 326b6b1..a8b9c6e 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index af608ee..8eedb02 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/init/data/build/settings b/level_3/init/data/build/settings index cab8836..4f70f18 100644 --- a/level_3/init/data/build/settings +++ b/level_3/init/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 8d35094..4752256 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -38,6 +38,8 @@ path_library_static static path_program_script script path_program_shared shared path_program_static static +path_sources +path_standard yes search_exclusive yes search_shared yes -- 1.8.3.1