]> Kevux Git Server - fll/commitdiff
Bugfix: Add stage setting to standards to prevent build state file conflicts.
authorKevin Day <Kevin@kevux.org>
Thu, 1 Aug 2024 02:33:32 +0000 (21:33 -0500)
committerKevin Day <Kevin@kevux.org>
Thu, 1 Aug 2024 03:08:26 +0000 (22:08 -0500)
The build state stage files are conflicting in some cases.
The old solution to this problem has been observed as insufficient.
The different build settings might have the same exact file name.

I have tossed around the idea of a settings Object such as "stage" in the past but I had previously opted against it.
I now believe that skipping over this was a mistake.

Add a new feature to the standards to fix this bug.
The "stage" value may now be specified.
The fakefile files accept the "stage" setting and passes the result along to any build settings.
The settings files accept the "stage" setting and uses the value by appending it to the stage files.

Only a single value is supported.
The forward and backward slashes are explicitly prohibited.
Other special characters are recommended to be avoided given the possibility of local file system problems.
Rather than erroring out, this slashes are stripped out.

The bootstrap.sh script is updated to support this.
The support for "stage" in the boostrap.sh script is very limited.

22 files changed:
build/scripts/bootstrap.sh
level_3/fake/c/main/build.c
level_3/fake/c/main/build.h
level_3/fake/c/main/build/load.c
level_3/fake/c/main/build/load.h
level_3/fake/c/main/build/print/warning.c
level_3/fake/c/main/build/print/warning.h
level_3/fake/c/main/build/string.c
level_3/fake/c/main/build/string.h
level_3/fake/c/main/common/string.c
level_3/fake/c/main/common/string.h
level_3/fake/c/main/common/type.c
level_3/fake/c/main/common/type.h
level_3/fake/c/main/fake.c
level_3/fake/c/main/make/load_fakefile.c
level_3/fake/c/main/make/load_fakefile.h
level_3/fake/c/main/make/operate.c
level_3/fake/c/main/make/operate_process_type.c
level_3/fake/documents/fakefile.txt
level_3/fake/documents/settings.txt
level_3/fake/specifications/fakefile.txt
level_3/fake/specifications/settings.txt

index 1644837d6efee5e00de1bc89588d95fd4b8787e0..b5d6c74f9bb52befec17ba4cd2b00a9e0b36daa5 100644 (file)
@@ -44,6 +44,7 @@ bootstrap_main() {
 
   local key=
   local -A variables=()
+  local define_extra=
   local failure=0
   local settings_name=settings
   local settings_file=
@@ -61,6 +62,7 @@ bootstrap_main() {
   local path_sources=sources/
   local path_language=c/
   local path_work=
+  local process=
   local project_built=
   local project_built_shared=
   local project_built_static=
@@ -69,8 +71,7 @@ bootstrap_main() {
   local override_path_data=
   local override_path_sources=
   local override_path_work=
-  local define_extra=
-  local process=
+  local stage=
   local verbosity=normal
   local verbose=
   local verbose_common=
@@ -259,8 +260,16 @@ bootstrap_main() {
     project_built="${project_built}-${process}"
   fi
 
-  project_built_shared="${project_built}.shared"
-  project_built_static="${project_built}.static"
+  key=
+  stage=
+  bootstrap_id "stage"
+  if [[ ${variables[${key}]} != "" ]] ; then
+    stage="-${variables[${key}]}"
+  fi
+
+  project_built="${project_built}${stage}"
+  project_built_shared="${project_built}${stage}.shared"
+  project_built_static="${project_built}${stage}.static"
 
   if [[ ${modes_available} == "" ]] ; then
     if [[ ${modes} != "" ]] ; then
@@ -609,164 +618,168 @@ bootstrap_id() {
     "search_exclusive") let key=80;;
     "search_shared") let key=81;;
     "search_static") let key=82;;
-    "version_file") let key=83;;
-    "version_major") let key=84;;
-    "version_major_prefix") let key=85;;
-    "version_micro") let key=86;;
-    "version_micro_prefix") let key=87;;
-    "version_minor") let key=88;;
-    "version_minor_prefix") let key=89;;
-    "version_nano") let key=90;;
-    "version_nano_prefix") let key=91;;
-    "version_target") let key=92;;
-
-    "build_compiler-mode") let key=93;;
-    "build_indexer-mode") let key=94;;
-    "build_indexer_arguments-mode") let key=95;;
-    "build_language-mode") let key=96;;
-    "build_libraries-mode") let key=97;;
-    "build_libraries_shared-mode") let key=98;;
-    "build_libraries_static-mode") let key=99;;
-    "build_name-mode") let key=100;;
-    "build_objects_library-mode") let key=101;;
-    "build_objects_library_shared-mode") let key=102;;
-    "build_objects_library_static-mode") let key=103;;
-    "build_objects_program-mode") let key=104;;
-    "build_objects_program_shared-mode") let key=105;;
-    "build_objects_program_static-mode") let key=106;;
-    "build_script-mode") let key=107;;
-    "build_shared-mode") let key=108;;
-    "build_sources_documentation-mode") let key=109;;
-    "build_sources_headers-mode") let key=110;;
-    "build_sources_headers_shared-mode") let key=111;;
-    "build_sources_headers_static-mode") let key=112;;
-    "build_sources_library-mode") let key=113;;
-    "build_sources_library_shared-mode") let key=114;;
-    "build_sources_library_static-mode") let key=115;;
-    "build_sources_object-mode") let key=116;;
-    "build_sources_object_shared-mode") let key=117;;
-    "build_sources_object_static-mode") let key=118;;
-    "build_sources_program-mode") let key=119;;
-    "build_sources_program_shared-mode") let key=120;;
-    "build_sources_program_static-mode") let key=121;;
-    "build_sources_script-mode") let key=122;;
-    "build_sources_setting-mode") let key=123;;
-    "build_static-mode") let key=124;;
-    "defines-mode") let key=125;;
-    "defines_library-mode") let key=126;;
-    "defines_library_shared-mode") let key=127;;
-    "defines_library_static-mode") let key=128;;
-    "defines_object-mode") let key=129;;
-    "defines_object_shared-mode") let key=130;;
-    "defines_object_static-mode") let key=131;;
-    "defines_program-mode") let key=132;;
-    "defines_program_shared-mode") let key=133;;
-    "defines_program_static-mode") let key=134;;
-    "defines_shared-mode") let key=135;;
-    "defines_static-mode") let key=136;;
-    "environment-mode") let key=137;;
-    "flags-mode") let key=138;;
-    "flags_library-mode") let key=139;;
-    "flags_library_shared-mode") let key=140;;
-    "flags_library_static-mode") let key=141;;
-    "flags_object-mode") let key=142;;
-    "flags_object_shared-mode") let key=143;;
-    "flags_object_static-mode") let key=144;;
-    "flags_program-mode") let key=145;;
-    "flags_program_shared-mode") let key=146;;
-    "flags_program_static-mode") let key=147;;
-    "flags_shared-mode") let key=148;;
-    "flags_static-mode") let key=149;;
-    "has_path_standard-mode") let key=150;;
-    "path_headers-mode") let key=151;;
-    "path_language-mode") let key=152;;
-    "path_library_script-mode") let key=153;;
-    "path_library_shared-mode") let key=154;;
-    "path_library_static-mode") let key=155;;
-    "path_object_script-mode") let key=156;;
-    "path_object_shared-mode") let key=157;;
-    "path_object_static-mode") let key=158;;
-    "path_program_script-mode") let key=159;;
-    "path_program_shared-mode") let key=160;;
-    "path_program_static-mode") let key=161;;
-    "path_sources-mode") let key=162;;
-    "path_sources_headers-mode") let key=163;;
-    "path_sources_library-mode") let key=164;;
-    "path_sources_object-mode") let key=165;;
-    "path_sources_program-mode") let key=166;;
-    "path_sources_script-mode") let key=167;;
-    "preserve_path_headers-mode") let key=168;;
-    "process_post-mode") let key=169;;
-    "process_pre-mode") let key=170;;
-    "search_exclusive-mode") let key=171;;
-    "search_shared-mode") let key=172;;
-    "search_static-mode") let key=173;;
-    "version_file-mode") let key=174;;
-    "version_major-mode") let key=175;;
-    "version_major_prefix-mode") let key=176;;
-    "version_micro-mode") let key=177;;
-    "version_micro_prefix-mode") let key=178;;
-    "version_minor-mode") let key=179;;
-    "version_minor_prefix-mode") let key=180;;
-    "version_nano-mode") let key=181;;
-    "version_nano_prefix-mode") let key=182;;
-    "version_target-mode") let key=183;;
-
-    "has-build_compiler") let key=184;;
-    "has-build_indexer") let key=185;;
-    "has-build_indexer_arguments") let key=186;;
-    "has-build_name") let key=187;;
-    "has-has_path_standard") let key=188;;
-    "has-path_library_script") let key=189;;
-    "has-path_library_shared") let key=190;;
-    "has-path_library_static") let key=191;;
-    "has-path_object_script") let key=192;;
-    "has-path_object_shared") let key=193;;
-    "has-path_object_static") let key=194;;
-    "has-path_program_script") let key=195;;
-    "has-path_program_shared") let key=196;;
-    "has-path_program_static") let key=197;;
-    "has-path_sources") let key=198;;
-    "has-path_sources_headers") let key=199;;
-    "has-path_sources_library") let key=200;;
-    "has-path_sources_object") let key=201;;
-    "has-path_sources_program") let key=202;;
-    "has-path_sources_script") let key=203;;
-    "has-search_exclusive") let key=204;;
-    "has-search_shared") let key=205;;
-    "has-search_static") let key=206;;
-    "has-version_major_prefix") let key=207;;
-    "has-version_micro_prefix") let key=208;;
-    "has-version_minor_prefix") let key=209;;
-    "has-version_nano_prefix") let key=210;;
-
-    "has-build_compiler-mode") let key=207;;
-    "has-build_indexer-mode") let key=208;;
-    "has-build_indexer_arguments-mode") let key=209;;
-    "has-build_name-mode") let key=210;;
-    "has-has_path_standard-mode") let key=211;;
-    "has-path_library_script-mode") let key=212;;
-    "has-path_library_shared-mode") let key=213;;
-    "has-path_library_static-mode") let key=214;;
-    "has-path_object_script-mode") let key=215;;
-    "has-path_object_shared-mode") let key=216;;
-    "has-path_object_static-mode") let key=217;;
-    "has-path_program_script-mode") let key=218;;
-    "has-path_program_shared-mode") let key=219;;
-    "has-path_program_static-mode") let key=220;;
-    "has-path_sources-mode") let key=221;;
-    "has-path_sources_headers-mode") let key=222;;
-    "has-path_sources_library-mode") let key=223;;
-    "has-path_sources_object-mode") let key=224;;
-    "has-path_sources_program-mode") let key=225;;
-    "has-path_sources_script-mode") let key=226;;
-    "has-search_exclusive-mode") let key=227;;
-    "has-search_shared-mode") let key=228;;
-    "has-search_static-mode") let key=229;;
-    "has-version_major_prefix-mode") let key=230;;
-    "has-version_micro_prefix-mode") let key=231;;
-    "has-version_minor_prefix-mode") let key=232;;
-    "has-version_nano_prefix-mode") let key=233;;
+    "stage") let key=83;;
+    "version_file") let key=84;;
+    "version_major") let key=85;;
+    "version_major_prefix") let key=86;;
+    "version_micro") let key=87;;
+    "version_micro_prefix") let key=88;;
+    "version_minor") let key=89;;
+    "version_minor_prefix") let key=90;;
+    "version_nano") let key=91;;
+    "version_nano_prefix") let key=92;;
+    "version_target") let key=93;;
+
+    "build_compiler-mode") let key=94;;
+    "build_indexer-mode") let key=95;;
+    "build_indexer_arguments-mode") let key=96;;
+    "build_language-mode") let key=97;;
+    "build_libraries-mode") let key=98;;
+    "build_libraries_shared-mode") let key=99;;
+    "build_libraries_static-mode") let key=100;;
+    "build_name-mode") let key=101;;
+    "build_objects_library-mode") let key=102;;
+    "build_objects_library_shared-mode") let key=103;;
+    "build_objects_library_static-mode") let key=104;;
+    "build_objects_program-mode") let key=105;;
+    "build_objects_program_shared-mode") let key=106;;
+    "build_objects_program_static-mode") let key=107;;
+    "build_script-mode") let key=108;;
+    "build_shared-mode") let key=109;;
+    "build_sources_documentation-mode") let key=110;;
+    "build_sources_headers-mode") let key=111;;
+    "build_sources_headers_shared-mode") let key=112;;
+    "build_sources_headers_static-mode") let key=113;;
+    "build_sources_library-mode") let key=114;;
+    "build_sources_library_shared-mode") let key=115;;
+    "build_sources_library_static-mode") let key=116;;
+    "build_sources_object-mode") let key=117;;
+    "build_sources_object_shared-mode") let key=118;;
+    "build_sources_object_static-mode") let key=119;;
+    "build_sources_program-mode") let key=120;;
+    "build_sources_program_shared-mode") let key=121;;
+    "build_sources_program_static-mode") let key=122;;
+    "build_sources_script-mode") let key=123;;
+    "build_sources_setting-mode") let key=124;;
+    "build_static-mode") let key=125;;
+    "defines-mode") let key=126;;
+    "defines_library-mode") let key=127;;
+    "defines_library_shared-mode") let key=128;;
+    "defines_library_static-mode") let key=129;;
+    "defines_object-mode") let key=130;;
+    "defines_object_shared-mode") let key=131;;
+    "defines_object_static-mode") let key=132;;
+    "defines_program-mode") let key=133;;
+    "defines_program_shared-mode") let key=134;;
+    "defines_program_static-mode") let key=135;;
+    "defines_shared-mode") let key=136;;
+    "defines_static-mode") let key=137;;
+    "environment-mode") let key=138;;
+    "flags-mode") let key=139;;
+    "flags_library-mode") let key=140;;
+    "flags_library_shared-mode") let key=141;;
+    "flags_library_static-mode") let key=142;;
+    "flags_object-mode") let key=143;;
+    "flags_object_shared-mode") let key=144;;
+    "flags_object_static-mode") let key=145;;
+    "flags_program-mode") let key=146;;
+    "flags_program_shared-mode") let key=147;;
+    "flags_program_static-mode") let key=148;;
+    "flags_shared-mode") let key=149;;
+    "flags_static-mode") let key=150;;
+    "has_path_standard-mode") let key=151;;
+    "path_headers-mode") let key=152;;
+    "path_language-mode") let key=153;;
+    "path_library_script-mode") let key=154;;
+    "path_library_shared-mode") let key=155;;
+    "path_library_static-mode") let key=156;;
+    "path_object_script-mode") let key=157;;
+    "path_object_shared-mode") let key=158;;
+    "path_object_static-mode") let key=159;;
+    "path_program_script-mode") let key=160;;
+    "path_program_shared-mode") let key=161;;
+    "path_program_static-mode") let key=162;;
+    "path_sources-mode") let key=163;;
+    "path_sources_headers-mode") let key=164;;
+    "path_sources_library-mode") let key=165;;
+    "path_sources_object-mode") let key=166;;
+    "path_sources_program-mode") let key=167;;
+    "path_sources_script-mode") let key=168;;
+    "preserve_path_headers-mode") let key=169;;
+    "process_post-mode") let key=170;;
+    "process_pre-mode") let key=171;;
+    "search_exclusive-mode") let key=172;;
+    "search_shared-mode") let key=173;;
+    "search_static-mode") let key=174;;
+    "stage-mode") let key=175;;
+    "version_file-mode") let key=176;;
+    "version_major-mode") let key=177;;
+    "version_major_prefix-mode") let key=178;;
+    "version_micro-mode") let key=179;;
+    "version_micro_prefix-mode") let key=180;;
+    "version_minor-mode") let key=181;;
+    "version_minor_prefix-mode") let key=182;;
+    "version_nano-mode") let key=183;;
+    "version_nano_prefix-mode") let key=184;;
+    "version_target-mode") let key=185;;
+
+    "has-build_compiler") let key=186;;
+    "has-build_indexer") let key=187;;
+    "has-build_indexer_arguments") let key=188;;
+    "has-build_name") let key=189;;
+    "has-has_path_standard") let key=190;;
+    "has-path_library_script") let key=191;;
+    "has-path_library_shared") let key=192;;
+    "has-path_library_static") let key=193;;
+    "has-path_object_script") let key=194;;
+    "has-path_object_shared") let key=195;;
+    "has-path_object_static") let key=196;;
+    "has-path_program_script") let key=197;;
+    "has-path_program_shared") let key=198;;
+    "has-path_program_static") let key=199;;
+    "has-path_sources") let key=200;;
+    "has-path_sources_headers") let key=201;;
+    "has-path_sources_library") let key=202;;
+    "has-path_sources_object") let key=203;;
+    "has-path_sources_program") let key=204;;
+    "has-path_sources_script") let key=205;;
+    "has-search_exclusive") let key=206;;
+    "has-search_shared") let key=207;;
+    "has-search_static") let key=208;;
+    "has-stage") let key=209;;
+    "has-version_major_prefix") let key=210;;
+    "has-version_micro_prefix") let key=211;;
+    "has-version_minor_prefix") let key=212;;
+    "has-version_nano_prefix") let key=213;;
+
+    "has-build_compiler-mode") let key=214;;
+    "has-build_indexer-mode") let key=215;;
+    "has-build_indexer_arguments-mode") let key=216;;
+    "has-build_name-mode") let key=217;;
+    "has-has_path_standard-mode") let key=218;;
+    "has-path_library_script-mode") let key=219;;
+    "has-path_library_shared-mode") let key=220;;
+    "has-path_library_static-mode") let key=221;;
+    "has-path_object_script-mode") let key=222;;
+    "has-path_object_shared-mode") let key=223;;
+    "has-path_object_static-mode") let key=224;;
+    "has-path_program_script-mode") let key=225;;
+    "has-path_program_shared-mode") let key=226;;
+    "has-path_program_static-mode") let key=227;;
+    "has-path_sources-mode") let key=228;;
+    "has-path_sources_headers-mode") let key=229;;
+    "has-path_sources_library-mode") let key=230;;
+    "has-path_sources_object-mode") let key=231;;
+    "has-path_sources_program-mode") let key=232;;
+    "has-path_sources_script-mode") let key=233;;
+    "has-search_exclusive-mode") let key=234;;
+    "has-search_shared-mode") let key=235;;
+    "has-search_static-mode") let key=236;;
+    "has-stage-mode") let key=237;;
+    "has-version_major_prefix-mode") let key=238;;
+    "has-version_micro_prefix-mode") let key=239;;
+    "has-version_minor_prefix-mode") let key=240;;
+    "has-version_nano_prefix-mode") let key=241;;
   esac
 }
 
@@ -807,7 +820,7 @@ bootstrap_load_settings() {
   fi
 
   # Single value Objects.
-  for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
+  for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static stage version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
 
     bootstrap_id "${i}"
 
@@ -902,7 +915,7 @@ bootstrap_load_settings_mode() {
   for m in ${modes} ; do
 
     # Single value Objects.
-    for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
+    for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static stage version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
 
       bootstrap_id "${i}-mode"
 
@@ -2679,6 +2692,12 @@ bootstrap_operation_build_prepare_remaining() {
     bootstrap_id "search_static-mode"
     search_static=${variables[${key}]}
   fi
+
+  bootstrap_id "has-stage-mode"
+  if [[ ${variables[${key}]} == "yes" ]] ; then
+    bootstrap_id "stage-mode"
+    stage=${variables[${key}]}
+  fi
 }
 
 bootstrap_operation_build_prepare_settings() {
index a1f87b35b3e79abcd1ddbd1f76230a209e66c96f..7125457b52a3ad476854b150ea2fca329e388a7d 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fake_build_arguments_standard_add_
-  void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type) {
+  void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const uint8_t is_shared, const uint8_t type) {
 
     if (!data || !data->main || !data_build) return;
     if (F_status_is_error(data->main->setting.state.status)) return;
@@ -522,7 +522,7 @@ extern "C" {
 #endif // _di_fake_build_execute_process_script_
 
 #ifndef _di_fake_build_get_file_name_without_extension_
-  void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name) {
+  void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t * const name) {
 
     if (!data || !data->main) return;
     if (F_status_is_error(data->main->setting.state.status)) return;
@@ -556,7 +556,7 @@ extern "C" {
 #endif // _di_fake_build_get_file_name_without_extension_
 
 #ifndef _di_fake_build_objects_add_
-  void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t * const generic, const f_string_statics_t * const specific) {
+  void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t * const path, const f_string_statics_t * const generic, const f_string_statics_t * const specific) {
 
     if (!data || !data->main || !data_build || !path || !generic || !specific) return;
 
@@ -594,7 +594,7 @@ extern "C" {
 #endif // _di_fake_build_objects_add_
 
 #ifndef _di_fake_build_operate_
-  void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) {
+  void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const uint8_t process_pipe, const f_string_static_t fakefile_stage) {
 
     if (!data || !data->main) return;
     if (F_status_is_error(data->main->setting.state.status)) return;
@@ -621,7 +621,7 @@ extern "C" {
       fake_print_message_building(&main->program.message, build_arguments, &data_build.setting);
     }
 
-    fake_build_load_stage(data, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage);
+    fake_build_load_stage(data, &data_build, fakefile_stage, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage);
 
     fake_build_load_environment(data, &data_build, &data_build.environment);
 
index fc8d796c520b95a00e18f9cb521e7c2b775c0eb0..236d5cf166a17263502d65f373668227408cbbb7 100644 (file)
@@ -25,12 +25,16 @@ extern "C" {
  *   This modifies data.main.cache_argument.
  *   This modifies data.main.cache_arguments.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
  *     Errors (with error bit) from: fll_execute_arguments_add()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param is_shared
  *   Set to TRUE to designate that this is adding for a shared library/program.
  *   Set to FALSE to designate that this is adding for a static library/program.
@@ -40,7 +44,7 @@ extern "C" {
  * @see fll_execute_arguments_add()
  */
 #ifndef _di_fake_build_arguments_standard_add_
-  extern void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type);
+  extern void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const uint8_t is_shared, const uint8_t type);
 #endif // _di_fake_build_arguments_standard_add_
 
 /**
@@ -53,6 +57,8 @@ extern "C" {
  *   This modifies data.main.cache_map.
  *   This modifies data.main.cache_recurse_do.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -117,6 +123,8 @@ extern "C" {
  *   This modifies data.main.cache_argument.
  *   This modifies data.main.cache_arguments.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -129,6 +137,8 @@ extern "C" {
  *     Errors (with error bit) from: fake_build_touch()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param process_script
  *   The setting_data file name fo the appropriate process script.
  *   This is expected to be either setting.process_pre or setting.process_post.
@@ -157,6 +167,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -166,10 +178,12 @@ extern "C" {
  * @param name
  *   The processed filename.
  *
+ *   Must not be NULL.
+ *
  * @see f_file_name_base()
  */
 #ifndef _di_fake_build_get_file_name_without_extension_
-  extern void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name);
+  extern void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t * const name);
 #endif // _di_fake_build_get_file_name_without_extension_
 
 /**
@@ -181,23 +195,33 @@ extern "C" {
  *   This modifies data.main.cache_argument.
  *   This modifies data.main.cache_arguments.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
  *     Errors (with error bit) from: fll_execute_arguments_add()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param path
  *   The sub-path to find the object files within.
+ *
+ *   Must not be NULL.
  * @param generic
  *   The generic sources to add.
+ *
+ *   Must not be NULL.
  * @param specific
  *   The specific sources to add.
  *
+ *   Must not be NULL.
+ *
  * @see fll_execute_arguments_add()
  */
 #ifndef _di_fake_build_objects_add_
-  extern void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific);
+  extern void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t * const path, const f_string_statics_t * const generic, const f_string_statics_t * const specific);
 #endif // _di_fake_build_objects_add_
 
 /**
@@ -232,9 +256,6 @@ extern "C" {
  *     Errors (with error bit) from: fake_build_program_static()
  *     Errors (with error bit) from: fake_build_library_static_object()
  *     Errors (with error bit) from: fake_build_skeleton()
- * @param setting_file
- *   The name of the settings file to use.
- *   If setting_file.used is 0, then the default or program parameter supplied file is used.
  * @param build_arguments
  *   (optional) A set of custom arguments to pass to the build.
  *   The first argument represents the name of the settings file to use.
@@ -246,6 +267,10 @@ extern "C" {
  * @param process_pipe
  *   If TRUE, then use the program input pipe.
  *   If FALSE, then ignore the program input pipe.
+ * @param fakefile_stage
+ *   (optional) The stage setting value from the fakefile.
+ *
+ *   Set fakefile_stage.used to 0 to not use.
  *
  * @see fll_program_print_signal_received()
  *
@@ -266,7 +291,7 @@ extern "C" {
  * @see fake_build_skeleton()
  */
 #ifndef _di_fake_build_operate_
-  extern void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe);
+  extern void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const uint8_t process_pipe, const f_string_static_t fakefile_stage);
 #endif // _di_fake_build_operate_
 
 /**
@@ -275,6 +300,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -283,12 +310,18 @@ extern "C" {
  *     Errors (with error bit) from: f_string_dynamic_append_nulless()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param setting_path_source
  *   The source path from the build settings file.
+ *
+ *   Must not be NULL.
  * @param source
  *   The source string to append the build path source to.
  *   This gets reset by fake_string_dynamics_reset().
  *
+ *   Must not be NULL.
+ *
  * @see f_string_dynamic_append_assure()
  * @see f_string_dynamic_append_nulless()
  *
@@ -307,19 +340,29 @@ extern "C" {
  *   This modifies data.main.cache_argument.
  *   This modifies data.main.cache_arguments.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
  *     Errors (with error bit) from: fll_execute_arguments_add()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param source_path
  *   The source path to use, such as data_build.setting.path_sources.
+ *
+ *   Must not be NULL.
  * @param generic
  *   The generic sources to add.
+ *
+ *   Must not be NULL.
  * @param specific
  *   The specific sources to add.
  *
+ *   Must not be NULL.
+ *
  * @see fll_execute_arguments_add()
  */
 #ifndef _di_fake_build_sources_add_
@@ -332,6 +375,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This modifies data.main.cache_argument.
  *   This modifies data.main.cache_arguments.
  *
@@ -341,9 +386,13 @@ extern "C" {
  *     Errors (with error bit) from: fll_execute_arguments_add()
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param file
  *   The source object file to add.
  *
+ *   Must not be NULL.
+ *
  * @see fll_execute_arguments_add()
  */
 #ifndef _di_fake_build_sources_object_add_
@@ -356,6 +405,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
index f2cac68ca8f9885467081b78267ff9e745f2c603..a089a60c8fb32a2783a917543e78695ed659e086 100644 (file)
@@ -213,7 +213,7 @@ extern "C" {
 
     fake_main_t * const main = data->main;
 
-    bool error_printed = F_false;
+    uint8_t error_printed = F_false;
 
     f_string_dynamics_t build_compiler = f_string_dynamics_t_initialize;
     f_string_dynamics_t build_indexer = f_string_dynamics_t_initialize;
@@ -246,6 +246,7 @@ extern "C" {
     f_string_dynamics_t search_exclusive = f_string_dynamics_t_initialize;
     f_string_dynamics_t search_shared = f_string_dynamics_t_initialize;
     f_string_dynamics_t search_static = f_string_dynamics_t_initialize;
+    f_string_dynamics_t stage = f_string_dynamics_t_initialize;
     f_string_dynamics_t version_file = f_string_dynamics_t_initialize;
     f_string_dynamics_t version_major = f_string_dynamics_t_initialize;
     f_string_dynamics_t version_major_prefix = f_string_dynamics_t_initialize;
@@ -341,6 +342,7 @@ extern "C" {
       fake_build_setting_name_search_exclusive_s,
       fake_build_setting_name_search_shared_s,
       fake_build_setting_name_search_static_s,
+      fake_build_setting_name_stage_s,
       fake_build_setting_name_version_file_s,
       fake_build_setting_name_version_major_s,
       fake_build_setting_name_version_major_prefix_s,
@@ -437,6 +439,7 @@ extern "C" {
       &search_exclusive,
       &search_shared,
       &search_static,
+      &stage,
       &version_file,
       &version_major,
       &version_major_prefix,
@@ -533,6 +536,7 @@ extern "C" {
       F_false, // search_exclusive
       F_false, // search_shared
       F_false, // search_static
+      F_false, // stage
       F_false, // version_file
       F_false, // version_major
       F_false, // version_major_prefix
@@ -545,6 +549,9 @@ extern "C" {
       F_false, // version_target
     };
 
+    f_number_unsigned_t i = 0;
+    f_number_unsigned_t j = 0;
+
     f_string_t function = macro_fake_f(fll_fss_snatch_apart);
 
     main->setting.state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0);
@@ -565,9 +572,6 @@ extern "C" {
 
       bool found = F_false;
 
-      f_number_unsigned_t i = 0;
-      f_number_unsigned_t j = 0;
-
       for (; i < modes->used; ++i) {
 
         // Skip empty modes.
@@ -706,6 +710,7 @@ extern "C" {
         fake_build_setting_name_search_exclusive_s,
         fake_build_setting_name_search_shared_s,
         fake_build_setting_name_search_static_s,
+        fake_build_setting_name_stage_s,
         fake_build_setting_name_version_file_s,
         fake_build_setting_name_version_major_s,
         fake_build_setting_name_version_major_prefix_s,
@@ -750,6 +755,7 @@ extern "C" {
         &search_exclusive,
         &search_shared,
         &search_static,
+        &stage,
         &version_file,
         &version_major,
         &version_major_prefix,
@@ -762,7 +768,7 @@ extern "C" {
         &version_target,
       };
 
-      bool *settings_single_bool[] = {
+      uint8_t *settings_single_bool[] = {
         0,                                           // build_compiler
         0,                                           // build_indexer
         0,                                           // build_language
@@ -794,6 +800,7 @@ extern "C" {
         &setting->search_exclusive,                  // search_exclusive
         &setting->search_shared,                     // search_shared
         &setting->search_static,                     // search_static
+        0,                                           // stage
       };
 
       f_string_dynamic_t *settings_single_destination[] = {
@@ -828,6 +835,7 @@ extern "C" {
         0,                                           // search_exclusive
         0,                                           // search_shared
         0,                                           // search_static
+        &setting->stage,                             // stage
         0,                                           // version_file
         &setting->version_major,                     // version_major
         &setting->version_major_prefix,              // version_major_prefix
@@ -872,16 +880,17 @@ extern "C" {
         settings_matches[80], // search_exclusive
         settings_matches[81], // search_shared
         settings_matches[82], // search_static
-        settings_matches[83], // version_file
-        settings_matches[84], // version_major
-        settings_matches[85], // version_major_prefix
-        settings_matches[86], // version_micro
-        settings_matches[87], // version_micro_prefix
-        settings_matches[88], // version_minor
-        settings_matches[89], // version_minor_prefix
-        settings_matches[90], // version_nano
-        settings_matches[91], // version_nano_prefix
-        settings_matches[92], // version_target
+        settings_matches[83], // stage
+        settings_matches[84], // version_file
+        settings_matches[85], // version_major
+        settings_matches[86], // version_major_prefix
+        settings_matches[87], // version_micro
+        settings_matches[88], // version_micro_prefix
+        settings_matches[89], // version_minor
+        settings_matches[90], // version_minor_prefix
+        settings_matches[91], // version_nano
+        settings_matches[92], // version_nano_prefix
+        settings_matches[93], // version_target
       };
 
       const f_string_static_t settings_single_string_default[] = {
@@ -916,6 +925,7 @@ extern "C" {
         fake_build_setting_default_yes_s,            // search_exclusive
         f_string_empty_s,                            // search_shared
         f_string_empty_s,                            // search_static
+        f_string_empty_s,                            // stage
         f_string_empty_s,                            // version_file
         f_string_empty_s,                            // version_major
         fake_build_setting_default_version_prefix_s, // version_major_prefix
@@ -966,6 +976,7 @@ extern "C" {
         0,                                           // search_exclusive
         0,                                           // search_shared
         0,                                           // search_static
+        0,                                           // stage
         &setting->version_file,                      // version_file
         0,                                           // version_major
         0,                                           // version_major_prefix
@@ -1010,6 +1021,7 @@ extern "C" {
         0,                                           // search_exclusive
         0,                                           // search_shared
         0,                                           // search_static
+        0,                                           // stage
         fake_build_version_micro_e,                  // version_file
         0,                                           // version_major
         0,                                           // version_major_prefix
@@ -1054,6 +1066,7 @@ extern "C" {
         fake_common_setting_bool_yes_s,              // search_exclusive
         fake_common_setting_bool_yes_s,              // search_shared
         fake_common_setting_bool_yes_s,              // search_static
+        f_string_empty_s,                            // stage
         fake_build_version_micro_s,                  // version_file
         f_string_empty_s,                            // version_major
         f_string_empty_s,                            // version_major_prefix
@@ -1066,7 +1079,7 @@ extern "C" {
         fake_build_version_major_s,                  // version_target
       };
 
-      // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", "micro", or "nano".
+      // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", "micro", or "nano", 6 = literal, no slash.
       static const uint8_t settings_single_type[] = {
         3,                                           // build_compiler
         3,                                           // build_indexer
@@ -1099,6 +1112,7 @@ extern "C" {
         1,                                           // search_exclusive
         1,                                           // search_shared
         1,                                           // search_static
+        6,                                           // stage
         5,                                           // version_file
         3,                                           // version_major
         3,                                           // version_major_prefix
@@ -1111,7 +1125,7 @@ extern "C" {
         5,                                           // version_target
       };
 
-      for (f_number_unsigned_t i = 0; i < 41; ++i) {
+      for (i = 0; i < 42; ++i) {
 
         // Assign the default for literal and path types.
         if (!settings_single_matches[i] && settings_single_destination[i]) {
@@ -1199,6 +1213,25 @@ extern "C" {
               break;
             }
 
+            // Verify that there are no forward or backward slashes in the string.
+            if (settings_single_type[i] == 6) {
+              main->setting.state.status = F_okay;
+
+              for (j = 0; j < settings_single_source[i]->array[settings_single_source[i]->used - 1].used; ++j) {
+
+                if (settings_single_source[i]->array[settings_single_source[i]->used - 1].string[j] == f_string_ascii_slash_forward_s.string[0] || settings_single_source[i]->array[settings_single_source[i]->used - 1].string[j] == f_string_ascii_slash_backward_s.string[0]) {
+                  main->setting.state.status = F_warning;
+
+                  // Prevent the slash from being copied.
+                  settings_single_source[i]->array[settings_single_source[i]->used - 1].string[j] = 0;
+                }
+              } // for
+
+              if (main->setting.state.status == F_warning) {
+                fake_build_print_warning_setting_slash_not_allowed(&main->program.warning, settings_single_name[i], path_file);
+              }
+            }
+
             main->setting.state.status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]);
 
             if (F_status_is_error(main->setting.state.status)) {
@@ -1299,6 +1332,7 @@ extern "C" {
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_exclusive.array, &search_exclusive.used, &search_exclusive.size, &f_string_dynamics_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_shared.array, &search_shared.used, &search_shared.size, &f_string_dynamics_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &search_static.array, &search_static.used, &search_static.size, &f_string_dynamics_delete_callback);
+    f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &stage.array, &stage.used, &stage.size, &f_string_dynamics_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_file.array, &version_file.used, &version_file.size, &f_string_dynamics_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_major.array, &version_major.used, &version_major.size, &f_string_dynamics_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &version_major_prefix.array, &version_major_prefix.used, &version_major_prefix.size, &f_string_dynamics_delete_callback);
@@ -1391,9 +1425,9 @@ extern "C" {
 #endif // _di_fake_build_load_setting_override_
 
 #ifndef _di_fake_build_load_stage_
-  void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage) {
+  void fake_build_load_stage(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t fakefile_stage, const f_string_static_t settings_file, fake_build_stage_t * const stage) {
 
-    if (!data || !data->main || !stage) return;
+    if (!data || !data->main || !data_build || !stage) return;
     if (F_status_is_error(data->main->setting.state.status)) return;
     if (fake_signal_check(data->main)) return;
 
@@ -1484,6 +1518,22 @@ extern "C" {
         main->setting.state.status = f_string_dynamic_append_nulless(settings_file_base, values[i]);
       }
 
+      if (F_status_is_error_not(main->setting.state.status) && fakefile_stage.used) {
+        main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]);
+
+        if (F_status_is_error_not(main->setting.state.status)) {
+          main->setting.state.status = f_string_dynamic_append_nulless(fakefile_stage, values[i]);
+        }
+      }
+
+      if (F_status_is_error_not(main->setting.state.status) && data_build->setting.stage.used) {
+        main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]);
+
+        if (F_status_is_error_not(main->setting.state.status)) {
+          main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.stage, values[i]);
+        }
+      }
+
       if (F_status_is_error_not(main->setting.state.status)) {
         main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]);
       }
index e3cc6917875ac40c2247c69eb0567d926fe36ebe..575bddbcc1f597a683c1a5d43f5c07ab2ae8a78d 100644 (file)
@@ -22,6 +22,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -31,9 +33,13 @@ extern "C" {
  *     Errors (with error bit) from: fl_environment_load_names().
  * @param data_build
  *   The build data.
+ *
+ *   Must not be NULL.
  * @param environment
  *   The environment data.
  *
+ *   Must not be NULL.
+ *
  * @see fl_environment_load_name()
  * @see fl_environment_load_names()
  */
@@ -47,6 +53,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -70,6 +78,8 @@ extern "C" {
  *   If build_arguments.used is 0, then the default or program parameter supplied file is used.
  *   Set the first argument used length to 0 to use the default program parameter supplied file.
  *   Set the second argument used length to 0 without any further arguments to not use any modes.
+ *
+ *   Must not be NULL.
  * @param process_pipe
  *   If TRUE, then use the program input pipe.
  *   If FALSE, then ignore the program input pipe.
@@ -77,6 +87,8 @@ extern "C" {
  *   All build related setting data from the build setting file are loaded into this.
  *   These setting will have any specified mode property applied.
  *
+ *   Must not be NULL.
+ *
  * @see f_fss_apply_delimit()
  * @see f_string_dynamic_append_assure()
  * @see fll_fss_extended_read()
@@ -97,6 +109,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -107,6 +121,8 @@ extern "C" {
  *   All build related setting data from the build setting file are loaded into this.
  *   These setting will have any specified mode property applied.
  *
+ *   Must not be NULL.
+ *
  * @see f_string_dynamic_append_assure()
  */
 #ifndef _di_fake_build_load_setting_override_
@@ -119,6 +135,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -149,6 +167,8 @@ extern "C" {
  *   All build related setting data from the build setting file are loaded into this.
  *   These setting will have any specified mode property applied.
  *
+ *   Must not be NULL.
+ *
  * @see f_memory_array_increase_by()
  * @see f_path_directory_cleanup()
  * @see f_string_dynamic_append()
@@ -165,6 +185,8 @@ extern "C" {
  * @param data
  *   The program data.
  *
+ *   Must not be NULL.
+ *
  *   This alters data.main->setting.state.status:
  *     F_okay on success.
  *
@@ -172,17 +194,27 @@ extern "C" {
  *
  *     Errors (with error bit) from: f_file_name_base().
  *     Errors (with error bit) from: f_string_dynamic_append_nulless().
+ * @param data_build
+ *   The build data.
+ *
+ *   Must not be NULL.
+ * @param fakefile_stage
+ *   (optional) The stage setting value from the fakefile.
+ *
+ *   Set fakefile_stage.used to 0 to not use.
  * @param settings_file
  *   The path to the settings file.
  * @param stage
  *   All stage file paths.
  *
+ *   Must not be NULL.
+ *
  * @see f_file_name_base()
  * @see f_string_dynamic_append_nulless()
  * @see fll_program_print_signal_received()
  */
 #ifndef _di_fake_build_load_stage_
-  extern void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage);
+  extern void fake_build_load_stage(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t fakefile_stage, const f_string_static_t settings_file, fake_build_stage_t * const stage);
 #endif // _di_fake_build_load_stage_
 
 #ifdef __cplusplus
index 3ec8b46f7bcb8dede9838bfa9dc278f8b7cc9c9d..b229a4b4cd85c422ef94357727b9481d9e4ad276 100644 (file)
@@ -99,6 +99,26 @@ extern "C" {
   }
 #endif // _di_fake_build_print_warning_setting_required_default_to_
 
+#ifndef _di_fake_build_print_warning_setting_slash_not_allowed_
+  f_status_t fake_build_print_warning_setting_slash_not_allowed(fl_print_t * const print, const f_string_static_t name, const f_string_static_t path) {
+
+    if (!print) return F_status_set_error(F_output_not);
+    if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QThe setting '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
+    fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, name, print->notable);
+    fl_print_format("%[' in the file '%]", print->to, print->context, print->context);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, path, print->notable);
+    fl_print_format("%[' has and must not have forward or backward slashes, ignoring slashes.%]%r", print->to, print->context, print->context, f_string_eol_s);
+
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fake_build_print_warning_setting_slash_not_allowed_
+
 #ifndef _di_fake_build_print_warning_setting_version_may_only_be_
   f_status_t fake_build_print_warning_setting_version_may_only_be(fl_print_t * const print, const f_string_static_t name, const f_string_static_t path, const f_string_static_t default_to) {
 
index 4e475ffbb8dcdbb8979f469ce7531710c9faecce..662197b754d5a9f1b77d7f45fc35bb49f7fb2814 100644 (file)
@@ -163,6 +163,34 @@ extern "C" {
 #endif // _di_fake_build_print_warning_setting_required_default_to_
 
 /**
+ * Print warning message that the setting has and must not have forward or backward slashes.
+ *
+ * This will note that the slashes are removed.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This requires print.custom to be fake_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param name
+ *   The name for the setting.
+ * @param path
+ *   The path to the setting file.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_fake_build_print_warning_setting_slash_not_allowed_
+  extern f_status_t fake_build_print_warning_setting_slash_not_allowed(fl_print_t * const print, const f_string_static_t name, const f_string_static_t path);
+#endif // _di_fake_build_print_warning_setting_slash_not_allowed_
+
+/**
  * Print warning message that the setting may only be from a specific set of allowed version values.
  *
  * @param print
index 2888a35b1b6ce96e00720a2df2eb9ae177203dc3..3295f7eca2a83b747a11d1516263e9b2e8315071 100644 (file)
@@ -117,6 +117,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static
   const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length);
   const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length);
   const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length);
+  const f_string_static_t fake_build_setting_name_stage_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_stage_s, 0, FAKE_build_setting_name_stage_s_length);
   const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length);
   const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length);
   const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize_1(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length);
index 4dfed26ffec9836e1573cdb8ea51abc8a6dbc090..c64ee75a90b4dd7855c434dbfb57429eb71f7986 100644 (file)
@@ -175,6 +175,7 @@ extern "C" {
   #define FAKE_build_setting_name_search_exclusive_s             "search_exclusive"
   #define FAKE_build_setting_name_search_shared_s                "search_shared"
   #define FAKE_build_setting_name_search_static_s                "search_static"
+  #define FAKE_build_setting_name_stage_s                        "stage"
   #define FAKE_build_setting_name_version_file_s                 "version_file"
   #define FAKE_build_setting_name_version_major_s                "version_major"
   #define FAKE_build_setting_name_version_major_prefix_s         "version_major_prefix"
@@ -275,6 +276,7 @@ extern "C" {
   #define FAKE_build_setting_name_search_exclusive_s_length             16
   #define FAKE_build_setting_name_search_shared_s_length                13
   #define FAKE_build_setting_name_search_static_s_length                13
+  #define FAKE_build_setting_name_stage_s_length                        5
   #define FAKE_build_setting_name_version_file_s_length                 12
   #define FAKE_build_setting_name_version_major_s_length                13
   #define FAKE_build_setting_name_version_major_prefix_s_length         20
@@ -375,6 +377,7 @@ extern "C" {
   extern const f_string_static_t fake_build_setting_name_search_exclusive_s;
   extern const f_string_static_t fake_build_setting_name_search_shared_s;
   extern const f_string_static_t fake_build_setting_name_search_static_s;
+  extern const f_string_static_t fake_build_setting_name_stage_s;
   extern const f_string_static_t fake_build_setting_name_version_file_s;
   extern const f_string_static_t fake_build_setting_name_version_major_s;
   extern const f_string_static_t fake_build_setting_name_version_major_prefix_s;
index 1864825010959d22cab3ac159352d19e046fac38..f7e7898d92781ce12e5ff2a240fba758142afd44 100644 (file)
@@ -128,6 +128,7 @@ extern "C" {
   const f_string_static_t fake_make_setting_load_build_s = macro_f_string_static_t_initialize_1(FAKE_make_setting_load_build_s, 0, FAKE_make_setting_load_build_s_length);
   const f_string_static_t fake_make_setting_parameter_s = macro_f_string_static_t_initialize_1(FAKE_make_setting_parameter_s, 0, FAKE_make_setting_parameter_s_length);
   const f_string_static_t fake_make_setting_return_s = macro_f_string_static_t_initialize_1(FAKE_make_setting_return_s, 0, FAKE_make_setting_return_s_length);
+  const f_string_static_t fake_make_setting_stage_s = macro_f_string_static_t_initialize_1(FAKE_make_setting_stage_s, 0, FAKE_make_setting_stage_s_length);
 #endif // _di_fake_make_setting_t_
 
 #ifndef _di_fake_make_operation_
index d6661fa2b35ae3f5cc65585a000a550ecd7c769e..569a8a2b7baeddbb33701eece62ab3dc274738c5 100644 (file)
@@ -373,6 +373,7 @@ extern "C" {
   #define FAKE_make_setting_load_build_s        "load_build"
   #define FAKE_make_setting_parameter_s         "parameter"
   #define FAKE_make_setting_return_s            "return"
+  #define FAKE_make_setting_stage_s             "stage"
 
   #define FAKE_make_setting_compiler_s_length          8
   #define FAKE_make_setting_define_s_length            6
@@ -383,6 +384,7 @@ extern "C" {
   #define FAKE_make_setting_load_build_s_length        10
   #define FAKE_make_setting_parameter_s_length         9
   #define FAKE_make_setting_return_s_length            6
+  #define FAKE_make_setting_stage_s_length             5
 
   extern const f_string_static_t fake_make_setting_compiler_s;
   extern const f_string_static_t fake_make_setting_define_s;
@@ -393,6 +395,7 @@ extern "C" {
   extern const f_string_static_t fake_make_setting_load_build_s;
   extern const f_string_static_t fake_make_setting_parameter_s;
   extern const f_string_static_t fake_make_setting_return_s;
+  extern const f_string_static_t fake_make_setting_stage_s;
 #endif // _di_fake_make_setting_s_
 
 #ifndef _di_fake_make_operation_s_
index fbeeb263a1fb8cd56d122d70e488add4ca3a52af..4652476689539191e65e7d51d2a0a04f74c1a2fd 100644 (file)
@@ -42,6 +42,7 @@ extern "C" {
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->path_sources_script.string, &build_setting->path_sources_script.used, &build_setting->path_sources_script.size);
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_post.string, &build_setting->process_post.used, &build_setting->process_post.size);
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->process_pre.string, &build_setting->process_pre.used, &build_setting->process_pre.size);
+    f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->stage.string, &build_setting->stage.used, &build_setting->stage.size);
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_major.string, &build_setting->version_major.used, &build_setting->version_major.size);
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_major_prefix.string, &build_setting->version_major_prefix.used, &build_setting->version_major_prefix.size);
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_setting->version_micro.string, &build_setting->version_micro.used, &build_setting->version_micro.size);
@@ -273,6 +274,9 @@ extern "C" {
 #ifndef _di_fake_make_setting_delete_
   void fake_make_setting_delete(fake_make_setting_t * const setting_make) {
 
+    if (!setting_make) return;
+
+    f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting_make->stage.string, &setting_make->stage.used, &setting_make->stage.size);
     f_memory_arrays_resize(0, sizeof(f_string_map_multi_t), (void **) &setting_make->parameter.array, &setting_make->parameter.used, &setting_make->parameter.size, &f_string_map_multis_delete_callback);
   }
 #endif // _di_fake_make_setting_delete_
index fc4d36e8a6a92700499115a51e3da16401ef3785..996464ee5d76a23b7fa7dd05b47cd7d3ed1ae4b7 100644 (file)
@@ -397,6 +397,7 @@ extern "C" {
  *   - path_sources_script:         The path_sources_script setting.
  *   - process_post:                The process_post setting.
  *   - process_pre:                 The process_pre setting.
+ *   - stage:                       The stage setting.
  *   - version_major:               The version_major setting.
  *   - version_major_prefix:        The version_major_prefix setting.
  *   - version_micro:               The version_micro setting.
@@ -468,16 +469,16 @@ extern "C" {
     uint8_t version_file;
     uint8_t version_target;
 
-    bool build_script;
-    bool build_shared;
-    bool build_static;
+    uint8_t build_script;
+    uint8_t build_shared;
+    uint8_t build_static;
 
-    bool has_path_standard;
-    bool preserve_path_headers;
+    uint8_t has_path_standard;
+    uint8_t preserve_path_headers;
 
-    bool search_exclusive;
-    bool search_shared;
-    bool search_static;
+    uint8_t search_exclusive;
+    uint8_t search_shared;
+    uint8_t search_static;
 
     f_string_dynamic_t build_compiler;
     f_string_dynamic_t build_indexer;
@@ -501,6 +502,7 @@ extern "C" {
     f_string_dynamic_t path_sources_script;
     f_string_dynamic_t process_post;
     f_string_dynamic_t process_pre;
+    f_string_dynamic_t stage;
     f_string_dynamic_t version_major;
     f_string_dynamic_t version_major_prefix;
     f_string_dynamic_t version_micro;
@@ -607,6 +609,7 @@ extern "C" {
     f_string_dynamic_t_initialize, \
     f_string_dynamic_t_initialize, \
     f_string_dynamic_t_initialize, \
+    f_string_dynamic_t_initialize, \
     f_string_dynamics_t_initialize, \
     f_string_dynamics_t_initialize, \
     f_string_dynamics_t_initialize, \
@@ -661,7 +664,7 @@ extern "C" {
     f_string_dynamics_t_initialize, \
   }
 
-  #define fake_build_setting_total_d 93
+  #define fake_build_setting_total_d 94
 #endif // _di_fake_build_setting_t_
 
 /**
@@ -758,6 +761,7 @@ extern "C" {
  * Properties:
  *   - load_build: Designate loading the build settings.
  *   - fail:       Holds the fail state.
+ *   - stage:      The build stage name.
  *   - parameter:  The parameters array map.
  */
 #ifndef _di_fake_make_setting_t_
@@ -766,12 +770,14 @@ extern "C" {
 
     uint8_t fail;
 
+    f_string_dynamic_t stage;
     f_string_map_multis_t parameter;
   } fake_make_setting_t;
 
   #define fake_make_setting_t_initialize { \
     0, \
     0, \
+    f_string_dynamic_t_initialize, \
     f_string_map_multis_t_initialize, \
   }
 #endif // _di_fake_make_setting_t_
index c2355b012b5866551339d856ca1ef89c6950c91b..de88cb2cc9d080abe3adb79cf386e55de888c911 100644 (file)
@@ -131,7 +131,7 @@ extern "C" {
             }
 
             if (F_status_is_error_not(main->setting.state.status)) {
-              fake_build_operate(&data, 0, main->program.pipe & fll_program_data_pipe_input_e);
+              fake_build_operate(&data, 0, main->program.pipe & fll_program_data_pipe_input_e, f_string_empty_s);
               if (main->setting.state.status == F_child) break;
             }
           }
index 9f83b18837a53300b7f130edfbb83bba074724ce..e53b14ea707d41d142f32f6ac08c8f2f9b503158 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fake_make_load_fakefile_
-  void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe) {
+  void fake_make_load_fakefile(fake_make_data_t * const data_make, const uint8_t process_pipe) {
 
     if (!data_make || !data_make->data || !data_make->main) return;
     if (F_status_is_error(data_make->main->setting.state.status)) return;
@@ -224,23 +224,27 @@ extern "C" {
         for (f_number_unsigned_t i = 0; i < settings.objects.used; ++i) {
 
           if (f_compare_dynamic_partial_string(fake_make_setting_load_build_s.string, data_make->main->buffer, fake_make_setting_load_build_s.used, settings.objects.array[i]) == F_equal_to) {
-            fake_make_load_fakefile_setting_build(data_make, &settings.objects.array[i], &settings.contents.array[i]);
+            fake_make_load_fakefile_setting_build(data_make, settings.objects.array[i], &settings.contents.array[i]);
           }
           else if (f_compare_dynamic_partial_string(fake_make_setting_compiler_s.string, data_make->main->buffer, fake_make_setting_compiler_s.used, settings.objects.array[i]) == F_equal_to) {
-            fake_make_load_fakefile_setting_compiler(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_compiler);
+            fake_make_load_fakefile_setting_compiler(data_make, settings.objects.array[i], &settings.contents.array[i], &range_compiler);
           }
           else if (f_compare_dynamic_partial_string(fake_make_setting_environment_s.string, data_make->main->buffer, fake_make_setting_environment_s.used, settings.objects.array[i]) == F_equal_to) {
             fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]);
             if (F_status_is_error(data_make->main->setting.state.status)) break;
           }
           else if (f_compare_dynamic_partial_string(fake_make_setting_fail_s.string, data_make->main->buffer, fake_make_setting_fail_s.used, settings.objects.array[i]) == F_equal_to) {
-            fake_make_load_fakefile_setting_fail(data_make, &settings.objects.array[i], &settings.contents.array[i]);
+            fake_make_load_fakefile_setting_fail(data_make, settings.objects.array[i], &settings.contents.array[i]);
           }
           else if (f_compare_dynamic_partial_string(fake_make_setting_indexer_s.string, data_make->main->buffer, fake_make_setting_indexer_s.used, settings.objects.array[i]) == F_equal_to) {
-            fake_make_load_fakefile_setting_indexer(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_indexer);
+            fake_make_load_fakefile_setting_indexer(data_make, settings.objects.array[i], &settings.contents.array[i], &range_indexer);
           }
           else if (f_compare_dynamic_partial_string(fake_make_setting_parameter_s.string, data_make->main->buffer, fake_make_setting_parameter_s.used, settings.objects.array[i]) == F_equal_to) {
-            fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]);
+            fake_make_load_fakefile_setting_parameter(data_make, settings.objects.array[i], &settings.contents.array[i]);
+            if (F_status_is_error(data_make->main->setting.state.status)) break;
+          }
+          else if (f_compare_dynamic_partial_string(fake_make_setting_stage_s.string, data_make->main->buffer, fake_make_setting_stage_s.used, settings.objects.array[i]) == F_equal_to) {
+            fake_make_load_fakefile_setting_stage(data_make, settings.objects.array[i], &settings.contents.array[i]);
             if (F_status_is_error(data_make->main->setting.state.status)) break;
           }
         } // for
@@ -299,9 +303,9 @@ extern "C" {
 #endif // _di_fake_make_load_fakefile_
 
 #ifndef _di_fake_make_load_fakefile_setting_build_
-  void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content) {
+  void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content) {
 
-    if (!data_make || !data_make->data || !data_make->main || !object || !content) return;
+    if (!data_make || !data_make->data || !data_make->main || !content) return;
 
     if (content->used) {
       if (f_compare_dynamic_partial_string(fake_common_setting_bool_yes_s.string, data_make->main->buffer, fake_common_setting_bool_yes_s.used, content->array[0]) == F_equal_to) {
@@ -311,7 +315,7 @@ extern "C" {
         data_make->setting_make.load_build = F_false;
       }
       else {
-        fake_make_print_warning_setting_content_invalid(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, content->array[0], fake_make_item_settings_s);
+        fake_make_print_warning_setting_content_invalid(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, content->array[0], fake_make_item_settings_s);
       }
 
       if (content->used > 1) {
@@ -319,15 +323,15 @@ extern "C" {
       }
     }
     else {
-      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, fake_make_setting_load_build_s);
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_load_build_s);
     }
   }
 #endif // _di_fake_make_load_fakefile_setting_build_
 
 #ifndef _di_fake_make_load_fakefile_setting_compiler_
-  void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content, f_range_t **range_compiler) {
+  void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content, f_range_t ** const range_compiler) {
 
-    if (!data_make || !data_make->data || !data_make->main || !object || !content || !range_compiler) return;
+    if (!data_make || !data_make->data || !data_make->main || !content || !range_compiler) return;
 
     if (content->used) {
       *range_compiler = &content->array[content->used - 1];
@@ -337,7 +341,7 @@ extern "C" {
       }
     }
     else {
-      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, fake_make_setting_compiler_s);
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_compiler_s);
     }
   }
 #endif // _di_fake_make_load_fakefile_setting_compiler_
@@ -345,7 +349,7 @@ extern "C" {
 #ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_
   void fake_make_load_fakefile_setting_define_and_parameter(fake_make_data_t * const data_make, f_fss_set_t * const settings) {
 
-    if (!data_make || !data_make->data || !data_make->data || !data_make->main || !settings) return;
+    if (!data_make || !data_make->data || !data_make->main || !settings) return;
 
     f_string_map_multis_t define = f_string_map_multis_t_initialize;
 
@@ -429,7 +433,7 @@ extern "C" {
 #ifndef _di_fake_make_load_fakefile_setting_environment_
   void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_ranges_t * const content) {
 
-    if (!data_make || !data_make->data || !data_make->data || !data_make->main || !content) return;
+    if (!data_make || !data_make->data || !data_make->main || !content) return;
 
     f_string_dynamic_t name_define = f_string_dynamic_t_initialize;
 
@@ -513,9 +517,9 @@ extern "C" {
 #endif // _di_fake_make_load_fakefile_setting_environment_
 
 #ifndef _di_fake_make_load_fakefile_setting_fail_
-  void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content) {
+  void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content) {
 
-    if (!data_make || !data_make->data || !data_make->data || !data_make->main || !object || !content) return;
+    if (!data_make || !data_make->data || !data_make->main || !content) return;
 
     if (content->used) {
       if (f_compare_dynamic_partial_string(fake_make_operation_argument_exit_s.string, data_make->main->buffer, fake_make_operation_argument_exit_s.used, content->array[content->used - 1]) == F_equal_to) {
@@ -528,7 +532,7 @@ extern "C" {
         data_make->setting_make.fail = fake_make_operation_fail_ignore_e;
       }
       else {
-        fake_make_print_warning_setting_content_invalid(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, content->array[content->used - 1], fake_make_item_settings_s);
+        fake_make_print_warning_setting_content_invalid(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, content->array[content->used - 1], fake_make_item_settings_s);
       }
 
       if (content->used > 1) {
@@ -536,15 +540,15 @@ extern "C" {
       }
     }
     else {
-      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, fake_make_setting_fail_s);
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_fail_s);
     }
   }
 #endif // _di_fake_make_load_fakefile_setting_fail_
 
 #ifndef _di_fake_make_load_fakefile_setting_indexer_
-  void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content, f_range_t **range_indexer) {
+  void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content, f_range_t ** const range_indexer) {
 
-    if (!data_make || !data_make->data || !data_make->data || !data_make->main || !object || !content || !range_indexer) return;
+    if (!data_make || !data_make->data || !data_make->main || !content || !range_indexer) return;
 
     if (content->used) {
       *range_indexer = &content->array[content->used - 1];
@@ -554,15 +558,15 @@ extern "C" {
       }
     }
     else {
-      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, fake_make_setting_indexer_s);
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_indexer_s);
     }
   }
 #endif // _di_fake_make_load_fakefile_setting_indexer_
 
 #ifndef _di_fake_make_load_fakefile_setting_parameter_
-  void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content) {
+  void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content) {
 
-    if (!data_make || !data_make->data || !data_make->data || !data_make->main || !object || !content) return;
+    if (!data_make || !data_make->data || !data_make->main || !content) return;
 
     if (content->used) {
       if (f_compare_dynamic_partial_string(fake_make_setting_return_s.string, data_make->main->buffer, fake_make_setting_return_s.used, content->array[0]) == F_equal_to) {
@@ -595,13 +599,56 @@ extern "C" {
       }
     }
     else {
-      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, *object, fake_make_setting_return_s);
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_return_s);
     }
 
     data_make->main->setting.state.status = F_okay;
   }
 #endif // _di_fake_make_load_fakefile_setting_parameter_
 
+#ifndef _di_fake_make_load_fakefile_setting_stage_
+  void fake_make_load_fakefile_setting_stage(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content) {
+
+    if (!data_make || !data_make->data || !data_make->main || !content) return;
+
+    if (content->used) {
+      if (content->used > 1) {
+        fake_make_print_warning_setting_content_multiple(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, fake_make_setting_stage_s);
+      }
+
+      // Verify that there are no forward or backward slashes in the string.
+      for (f_number_unsigned_t i = content->array[content->used - 1].start; i <= content->array[content->used - 1].stop; ++i) {
+
+        if (data_make->main->buffer.string[i] == f_string_ascii_slash_forward_s.string[0] || data_make->main->buffer.string[i] == f_string_ascii_slash_backward_s.string[0]) {
+          data_make->main->setting.state.status = F_warning;
+
+          // Prevent the slash from being copied.
+          data_make->main->buffer.string[i] = 0;
+        }
+      } // for
+
+      if (data_make->main->setting.state.status == F_warning) {
+        fake_build_print_warning_setting_slash_not_allowed(&data_make->main->program.warning, fake_make_setting_stage_s, data_make->data->file_data_build_fakefile);
+      }
+
+      data_make->setting_make.stage.used = 0;
+
+      data_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, content->array[content->used - 1], &data_make->setting_make.stage);
+
+      if (F_status_is_error(data_make->main->setting.state.status)) {
+        fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+
+        return;
+      }
+    }
+    else {
+      fake_make_print_warning_setting_content_empty(&data_make->main->program.warning, data_make->data->file_data_build_fakefile, data_make->main->buffer, object, fake_make_setting_stage_s);
+    }
+
+    data_make->main->setting.state.status = F_okay;
+  }
+#endif // _di_fake_make_load_fakefile_setting_stage_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a68e1704bc28e4503e7d4ec094d6c013c07ff3b0..b1757c352dc0f48246083f88ca3d3a2b5a6adcda 100644 (file)
@@ -71,7 +71,7 @@ extern "C" {
  * @see fake_pipe_buffer()
  */
 #ifndef _di_fake_make_load_fakefile_
-  extern void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe);
+  extern void fake_make_load_fakefile(fake_make_data_t * const data_make, const uint8_t process_pipe);
 #endif // _di_fake_make_load_fakefile_
 
 /**
@@ -81,13 +81,17 @@ extern "C" {
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
  *   This does not alter data_make.main.setting.state.status.
+ *
+ *   Must not be NULL.
  * @param object
  *   The setting object.
  * @param content
  *   The setting content.
+ *
+ *   Must not be NULL.
  */
 #ifndef _di_fake_make_load_fakefile_setting_build_
-  extern void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content);
+  extern void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content);
 #endif // _di_fake_make_load_fakefile_setting_build_
 
 /**
@@ -96,16 +100,22 @@ extern "C" {
  * @param data_make
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
+ *   Must not be NULL.
+ *
  *   This does not alter data_make.main.setting.state.status.
  * @param object
  *   The setting object.
  * @param content
  *   The setting content.
+ *
+ *   Must not be NULL.
  * @param range_compiler
  *   A pointer to the range that representing the compiler setting within the buffer.
+ *
+ *   Must not be NULL.
  */
 #ifndef _di_fake_make_load_fakefile_setting_compiler_
-  extern void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content, f_range_t **range_compiler);
+  extern void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content, f_range_t ** const range_compiler);
 #endif // _di_fake_make_load_fakefile_setting_compiler_
 
 /**
@@ -114,6 +124,8 @@ extern "C" {
  * @param data_make
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
+ *   Must not be NULL.
+ *
  *   This alters data_make.main->setting.state.status:
  *     F_okay on success.
  *
@@ -127,6 +139,8 @@ extern "C" {
  * @param settings
  *   The settings data.
  *
+ *   Must not be NULL.
+ *
  * @see f_environment_set()
  * @see f_string_dynamic_mash()
  * @see f_string_dynamic_mash_nulless()
@@ -145,6 +159,8 @@ extern "C" {
  * @param data_make
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
+ *   Must not be NULL.
+ *
  *   This alters data_make.main->setting.state.status:
  *     F_okay on success.
  *
@@ -156,6 +172,8 @@ extern "C" {
  * @param content
  *   The setting content.
  *
+ *   Must not be NULL.
+ *
  * @see f_memory_array_increase()
  * @see f_memory_array_increase_by()
  * @see f_string_dynamic_append()
@@ -177,9 +195,11 @@ extern "C" {
  *   The setting object.
  * @param content
  *   The setting content.
+ *
+ *   Must not be NULL.
  */
 #ifndef _di_fake_make_load_fakefile_setting_fail_
-  extern void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content);
+  extern void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content);
 #endif // _di_fake_make_load_fakefile_setting_fail_
 
 /**
@@ -188,16 +208,22 @@ extern "C" {
  * @param data_make
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
+ *   Must not be NULL.
+ *
  *   This does not alter data_make.main.setting.state.status.
  * @param object
  *   The setting object.
  * @param content
  *   The setting content.
+ *
+ *   Must not be NULL.
  * @param range_indexer
  *   A pointer to the range that representing the indexer setting within the buffer.
+ *
+ *   Must not be NULL.
  */
 #ifndef _di_fake_make_load_fakefile_setting_indexer_
-  extern void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content, f_range_t **range_indexer);
+  extern void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content, f_range_t ** const range_indexer);
 #endif // _di_fake_make_load_fakefile_setting_indexer_
 
 /**
@@ -209,28 +235,53 @@ extern "C" {
  * @param data_make
  *   All make related setting data, including data from the fakefile and the build settings file.
  *
+ *   Must not be NULL.
+ *
  *   This alters data_make.main->setting.state.status:
  *     F_okay on success.
  *
- *     Errors (with error bit) from: f_string_append_assure().
  *     Errors (with error bit) from: f_string_dynamic_append_assure().
  *     Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- *     Errors (with error bit) from: fake_make_load_fakefile_setting_define_and_parameter().
  * @param object
  *   The setting object.
  * @param content
  *   The setting content.
  *
+ *   Must not be NULL.
+ *
  * @see f_string_append_assure()
  * @see f_string_dynamic_append_assure()
  * @see f_string_dynamic_partial_append_nulless()
- *
- * @see fake_make_load_fakefile_setting_define_and_parameter()
  */
 #ifndef _di_fake_make_load_fakefile_setting_parameter_
-  extern void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_range_t * const object, f_ranges_t * const content);
+  extern void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content);
 #endif // _di_fake_make_load_fakefile_setting_parameter_
 
+/**
+ * Load the fakefile setting "stage".
+ *
+ * @param data_make
+ *   All make related setting data, including data from the fakefile and the build settings file.
+ *
+ *   Must not be NULL.
+ *
+ *   This alters data_make.main->setting.state.status:
+ *     F_okay on success.
+ *
+ *     Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
+ * @param object
+ *   The setting object.
+ * @param content
+ *   The setting content.
+ *
+ *   Must not be NULL.
+ *
+ * @see f_string_dynamic_partial_append_nulless()
+ */
+#ifndef _di_fake_make_load_fakefile_setting_stage_
+  extern void fake_make_load_fakefile_setting_stage(fake_make_data_t * const data_make, const f_range_t object, f_ranges_t * const content);
+#endif // _di_fake_make_load_fakefile_setting_stage_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0a45c574ddb4ea7bb059a8c80ef8282aca6bc226..b62a19520181d355a065eeff663ae9c71de96dfd 100644 (file)
@@ -249,8 +249,8 @@ extern "C" {
     // 0x1 = has parameter, 0x2 = has define, 0x4 = has context, 0x8 = non-context data appended.
     uint8_t iki_type = 0;
 
-    bool unmatched = F_true;
-    bool separate = F_false;
+    uint8_t unmatched = F_true;
+    uint8_t separate = F_false;
 
     f_number_unsigned_t i = 0;
     f_number_unsigned_t j = 0;
index 2242a662f3b56ec94989950ef751668c8b3a3e53..85db0972917af56bb1bc5f5e4db54eaafb83b272 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 
     fake_main_t * const main = data_make->main;
 
-    fake_build_operate(data_make->data, main->cache_arguments.used ? &main->cache_arguments : 0, F_false);
+    fake_build_operate(data_make->data, main->cache_arguments.used ? &main->cache_arguments : 0, F_false, data_make->setting_make.stage);
     if (F_status_set_fine(main->setting.state.status) == F_interrupt) return;
 
     fake_make_operate_process_return(data_make, F_status_is_error(main->setting.state.status) ? 1 : 0);
index 1c261e293cbbf8d3c061c25f9582cb9e8c72185f..aa57baedd22492998b38e6069b1b7836b1aad6b8 100644 (file)
@@ -1,7 +1,7 @@
 # fss-0002 iki-0000
 #
 # license: open-standard-license-1.0-or-later
-# version 2024/03/23
+# version 2024/07/30
 #
 # This file (assumed to be named fakefile.txt) can be more easily read using the following iki_read commands:
 #   iki_read fakefile.txt +Q -w -rrr ASCII ASCII GCC GCC HTML HTML -WW character "'" "'" code '"' '"'
@@ -92,6 +92,13 @@ Fakefile Documentation:
       The parameter variable name code:"return" is used to store the return result of a code:"run" or code:"shell" operation.
       Setting this here only sets the default code:"return" parameter variable value.
 
+    - code:"stage"\:
+      This defines a name that is added to the build stage files to help uniquely identify build stages associated with this file.
+      This name must only have valid characters for a particular file system.
+      The variables allowed are different from file system to file system and so special characters should generally be avoided.
+
+      To help prevent problems with paths, slashes (forward slash and backward slash) are not allowed in the stage name.
+
   - code:"main"\:
     This is the main entry point when processing the file:"fakefile".
     This is processed top-down until the end of the list is reached.
index a962b34299cf1ad002275eb7aab76829feb8ac4c..e764d32be87f16c81b9d457bd3ba82d90f23d7eb 100644 (file)
@@ -1,7 +1,7 @@
 # fss-0002 iki-0000
 #
 # license: open-standard-license-1.0-or-later
-# version 2024/03/23
+# version 2024/07/30
 #
 # This file (assumed to be named settings.txt) can be more easily read using the following iki_read commands:
 #   iki_read settings.txt +Q -w -rrr ASCII ASCII FLL FLL GCC GCC -WW character "'" "'" code '"' '"'
@@ -518,6 +518,13 @@ Settings Documentation:
     When code:"yes", static library paths are searched during compile.
     Both this and search_shared cannot be code:"no" at the same time.
 
+  - code:"stage"\:
+    This defines a name that is added to the build stage files to help uniquely identify build stages associated with this file.
+    This name must only have valid characters for a particular file system.
+    The variables allowed are different from file system to file system and so special characters should generally be avoided.
+
+    To help prevent problems with paths, slashes (forward slash and backward slash) are not allowed in the stage name.
+
   - code:"version_file"\:
     Designates which version should be used when building the symbolic links.
     Any version prefixes are used as defined.
index 52f0389a4a3f23652accf9517965efb278c1dbf7..7a8134e53f84465b8ee846953aa8e3bbe3bc18ec 100644 (file)
@@ -1,7 +1,7 @@
 # fss-0002 iki-0000
 #
 # license: open-standard-license-1.0-or-later
-# version 2024/03/23
+# version 2024/07/30
 #
 # This file (assumed to be named fakefile.txt) can be more easily read using the following iki_read commands:
 #   iki_read fakefile.txt +Q -w -WW character "'" "'" code '"' '"'
@@ -38,14 +38,15 @@ Fakefile Specification:
 
   The bold:"Settings Objects" are\:
     - code:"compiler": Only one bold:"Content", which must only be a valid filename.
-    - code:"define": First bold:"Content" represents variable name (case-sensitive), remaining bold:"Content" represents the value.
+    - code:"define": First bold:"Content" represents the variable name (case-sensitive), remaining bold:"Content" represents the value.
     - code:"environment": Zero or more bold:"Content" representing valid environment variable names (alpha-numeric with underscore, but cannot begin with a number).
     - code:"fail": Only one bold:"Content", which must be either code:"exit", code:"warn" or code:"ignore" (quotes not required) (case-sensitive).
     - code:"import": Only one bold:"Content", which must only be a valid filename.
     - code:"indexer": Only one bold:"Content", which must only be a valid filename.
     - code:"indexer_arguments: Zero or more arguments supported by the indexer specified in code:"build_indexer".
     - code:"load_build": Only one bold:"Content", which must be either code:"yes" or code:"no" (quotes not required) (case-sensitive).
-    - code:"parameter": First bold:"Content" represents variable name (case-sensitive), remaining bold:"Content" represents the value.
+    - code:"parameter": First bold:"Content" represents the variable name (case-sensitive), remaining bold:"Content" represents the value.
+    - code:"stage": Zero or one bold:"Content", which represents the build stage name (case-sensitive) (no slashes allowed).
 
   The build settings may also be specified in the bold:"Settings Section".
 
index 5fd1e6368c258c0dde482c34e175d0f8ee8e71ab..3dc010ec4b554e37fe182734f1a31135c81b7f47 100644 (file)
@@ -1,7 +1,7 @@
 # fss-0002 iki-0000
 #
 # license: open-standard-license-1.0-or-later
-# version 2024/03/23
+# version 2024/07/30
 #
 # This file (assumed to be named settings.txt) can be more easily read using the following iki_read commands:
 #   iki_read settings.txt +Q -w -WW character "'" "'" code '"' '"'
@@ -104,6 +104,7 @@ Settings Specification:
     - code:"search_exclusive": Must only one of: code:"yes" or code:"no".
     - code:"search_shared": Must only one of: code:"yes" or code:"no".
     - code:"search_static": Must only one of: code:"yes" or code:"no".
+    - code:"stage": Only zero or one bold:"Content", which represents the build stage name (case-sensitive) (no slashes allowed).
     - code:"version_file": Must only be one of: code:"major", code:"minor", code:"micro", or code:"nano".
     - code:"version_major": Must only be a single value containing valid filename characters.
     - code:"version_major_prefix": Must be zero or more valid filename characters.