From: Kevin Day Date: Sat, 26 Jun 2021 03:59:54 +0000 (-0500) Subject: Feature: Featureless Make must support both version_target and version_file. X-Git-Tag: 0.5.4~3 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=0709470fc3c11fe66e20c94fcf253e187c54ddff;p=fll Feature: Featureless Make must support both version_target and version_file. This separates version_target into version_target and version_file. Previously, they were one in the same and the recent design change of version_target exposed a problem with this. Libraries are traditionally linked (as in dynamic linker and not as in the filesystem "ln") to the major version number (such as: "-Wl,-soname,libfake.so.0") and have a file path set to the micro version (such as: libfake.so.0.5.4). When the version_target was set to "micro", this instead results in "-Wl,-soname,libfake.so.0.5.4" and "libfake.so.0.5.4". By breaking this up, the linker and the file can be setup appropriately. The problem here is that they are both related to linking but in two different contexts: 1) Dynamic Linker (_wl,-soname,...). 2) System Linker (ln -vs a b). To disambiguate these, the version_target is now used to refer to the Dynamic Linker and the version_file is used with the file name in which the system linker is used to link files against. The Featureless Linux Library used Major.Minor.Micro such that Major.Minor could represent stable versions (for even Minor numbers). Set this new setting to have version_target set to "minor" instead of the traditional "major" in the appropriate settings files. When not specified in the build settings file, the defaults must always be provided which are: 1) version_target = "major" 2) version_file = "micro" This aligns the default behavior to align with traditional practices while manually setting the build settings for all FLL projects to use different settings. The bootstrap.sh script has been updated to be consistent with this. The bootstrap.sh has also been updated to include the version prefixes. --- diff --git a/build/level_0/settings b/build/level_0/settings index f374afb..2edc21a 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -5,7 +5,8 @@ project_name fll_0 version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/build/level_1/settings b/build/level_1/settings index 8814153..e65d916 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -5,7 +5,8 @@ project_name fll_1 version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/build/level_2/settings b/build/level_2/settings index 1399c50..889d9f2 100644 --- a/build/level_2/settings +++ b/build/level_2/settings @@ -5,7 +5,8 @@ project_name fll_2 version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/build/monolithic/settings b/build/monolithic/settings index e70f75e..5effdf0 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -5,7 +5,8 @@ project_name fll version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/build/scripts/bootstrap.sh b/build/scripts/bootstrap.sh index dbf83de..766a14f 100644 --- a/build/scripts/bootstrap.sh +++ b/build/scripts/bootstrap.sh @@ -473,43 +473,44 @@ bootstrap_id() { "search_exclusive") echo -n 39;; "search_shared") echo -n 40;; "search_static") echo -n 41;; - "version_major") echo -n 42;; - "version_major_prefix") echo -n 43;; - "version_micro") echo -n 44;; - "version_micro_prefix") echo -n 45;; - "version_minor") echo -n 46;; - "version_minor_prefix") echo -n 47;; - "version_nano") echo -n 48;; - "version_nano_prefix") echo -n 49;; - "version_target") echo -n 50;; - - "build_libraries-$mode") echo -n 51;; - "build_sources_headers-$mode") echo -n 52;; - "build_sources_library-$mode") echo -n 53;; - "build_sources_program-$mode") echo -n 54;; - "build_sources_script-$mode") echo -n 55;; - "build_sources_setting-$mode") echo -n 56;; - "defines_all-$mode") echo -n 57;; - "defines_library-$mode") echo -n 58;; - "defines_program-$mode") echo -n 59;; - "defines_shared-$mode") echo -n 60;; - "defines_static-$mode") echo -n 61;; - "environment-$mode") echo -n 62;; - "flags_all-$mode") echo -n 63;; - "flags_library-$mode") echo -n 64;; - "flags_program-$mode") echo -n 65;; - "flags_shared-$mode") echo -n 66;; - "flags_static-$mode") echo -n 67;; - - "has-version_major_prefix") echo -n 68;; - "has-version_micro_prefix") echo -n 69;; - "has-version_minor_prefix") echo -n 70;; - "has-version_nano_prefix") echo -n 71;; - - "has-version_major_prefix-$mode") echo -n 72;; - "has-version_micro_prefix-$mode") echo -n 73;; - "has-version_minor_prefix-$mode") echo -n 74;; - "has-version_nano_prefix-$mode") echo -n 75;; + "version_file") echo -n 42;; + "version_major") echo -n 43;; + "version_major_prefix") echo -n 44;; + "version_micro") echo -n 45;; + "version_micro_prefix") echo -n 46;; + "version_minor") echo -n 47;; + "version_minor_prefix") echo -n 48;; + "version_nano") echo -n 49;; + "version_nano_prefix") echo -n 50;; + "version_target") echo -n 51;; + + "build_libraries-$mode") echo -n 52;; + "build_sources_headers-$mode") echo -n 53;; + "build_sources_library-$mode") echo -n 54;; + "build_sources_program-$mode") echo -n 55;; + "build_sources_script-$mode") echo -n 56;; + "build_sources_setting-$mode") echo -n 57;; + "defines_all-$mode") echo -n 58;; + "defines_library-$mode") echo -n 59;; + "defines_program-$mode") echo -n 60;; + "defines_shared-$mode") echo -n 61;; + "defines_static-$mode") echo -n 62;; + "environment-$mode") echo -n 63;; + "flags_all-$mode") echo -n 64;; + "flags_library-$mode") echo -n 65;; + "flags_program-$mode") echo -n 66;; + "flags_shared-$mode") echo -n 67;; + "flags_static-$mode") echo -n 68;; + + "has-version_major_prefix") echo -n 69;; + "has-version_micro_prefix") echo -n 70;; + "has-version_minor_prefix") echo -n 71;; + "has-version_nano_prefix") echo -n 72;; + + "has-version_major_prefix-$mode") echo -n 73;; + "has-version_micro_prefix-$mode") echo -n 74;; + "has-version_minor_prefix-$mode") echo -n 75;; + "has-version_nano_prefix-$mode") echo -n 76;; esac } @@ -600,6 +601,7 @@ bootstrap_operation_build() { local micro_prefix=${variables[$(bootstrap_id version_micro_prefix)]} local nano=${variables[$(bootstrap_id version_nano)]} local nano_prefix=${variables[$(bootstrap_id version_nano_prefix)]} + local file=${variables[$(bootstrap_id version_file)]} local target=${variables[$(bootstrap_id version_target)]} local compiler=${variables[$(bootstrap_id build_compiler)]} local indexer=${variables[$(bootstrap_id build_indexer)]} @@ -631,7 +633,8 @@ bootstrap_operation_build() { local flags_static=${variables[$(bootstrap_id flags_static)]} local i= local n= - local version= + local version_file= + local version_target= local alt=$1 local directory= local path_headers=${variables[$(bootstrap_id path_headers)]} @@ -650,18 +653,32 @@ bootstrap_operation_build() { nano_prefix="." fi + if [[ $file == "" ]] ; then + file="micro" + fi + if [[ $target == "" ]] ; then - target="micro" + target="major" + fi + + if [[ $file == "major" ]] ; then + version_file="$major_prefix$major" + elif [[ $file == "minor" ]] ; then + version_file="$major_prefix$major$minor_prefix$minor" + elif [[ $file == "micro" ]] ; then + version_file="$major_prefix$major$minor_prefix$minor$micro_prefix$micro" + elif [[ $file == "nano" ]] ; then + version_file="$major_prefix$major$minor_prefix$minor$micro_prefix$micro$nano_prefix$nano" fi if [[ $target == "major" ]] ; then - version="$major_prefix$major" + version_target="$major_prefix$major" elif [[ $target == "minor" ]] ; then - version="$major_prefix$major$minor_prefix$minor" + version_target="$major_prefix$major$minor_prefix$minor" elif [[ $target == "micro" ]] ; then - version="$major_prefix$major$minor_prefix$minor$micro_prefix$micro" + version_target="$major_prefix$major$minor_prefix$minor$micro_prefix$micro" elif [[ $target == "nano" ]] ; then - version="$major_prefix$major$minor_prefix$minor$micro_prefix$micro$nano_prefix$nano" + version_target="$major_prefix$major$minor_prefix$minor$micro_prefix$micro$nano_prefix$nano" fi if [[ $sources_library == "" ]] ; then @@ -933,17 +950,35 @@ bootstrap_operation_build() { done if [[ $verbosity == "verbose" ]] ; then - echo $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$version $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library $defines_all $defines_shared $defines_library + echo $compiler $sources -shared -Wl,-soname,lib$name.so.$version_target -o ${path_build}libraries/shared/lib$name.so.$version_file $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library $defines_all $defines_shared $defines_library fi - $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$version $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library $defines_all $defines_shared $defines_library || failure=1 + $compiler $sources -shared -Wl,-soname,lib$name.so.$version_target -o ${path_build}libraries/shared/lib$name.so.$version_file $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library $defines_all $defines_shared $defines_library || failure=1 if [[ $failure == "" ]] ; then - if [[ $target != "major" ]] ; then - ln $verbose -sf lib$name.so.$version ${path_build}libraries/shared/lib$name.so.$major || failure=1 + if [[ $file != "major" ]] ; then + if [[ $file == "minor" ]] ; then + ln $verbose -sf lib$name.so.$version_file ${path_build}libraries/shared/lib$name.so.$major_prefix$major || failure=1 + else + ln $verbose -sf lib$name.so.$major_prefix$major$minor_prefix$minor ${path_build}libraries/shared/lib$name.so.$major_prefix$major || failure=1 + + if [[ $failure == "" ]] ; then + if [[ $file == "micro" ]] ; then + ln $verbose -sf lib$name.so.$version_file ${path_build}libraries/shared/lib$name.so.$major_prefix$major$minor_prefix$minor || failure=1 + else + ln $verbose -sf lib$name.so.$major_prefix$major$minor_prefix$minor$micro_prefix$micro ${path_build}libraries/shared/lib$name.so.$major_prefix$major$minor_prefix$minor || failure=1 + + if [[ $failure == "" ]] ; then + ln $verbose -sf lib$name.so.$version_file ${path_build}libraries/shared/lib$name.so.$major_prefix$major$minor_prefix$minor_prefix$minor$micro_prefix$micro || failure=1 + fi + fi + fi + fi fi - ln $verbose -sf lib$name.so.$major ${path_build}libraries/shared/lib$name.so || failure=1 + if [[ $failure == "" ]] ; then + ln $verbose -sf lib$name.so.$major_prefix$major ${path_build}libraries/shared/lib$name.so || failure=1 + fi fi fi diff --git a/level_0/f_account/data/build/settings b/level_0/f_account/data/build/settings index 3fe24fb..4f4047d 100644 --- a/level_0/f_account/data/build/settings +++ b/level_0/f_account/data/build/settings @@ -5,6 +5,7 @@ project_name f_account version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_capability/data/build/settings b/level_0/f_capability/data/build/settings index 27722d8..b20a07f 100644 --- a/level_0/f_capability/data/build/settings +++ b/level_0/f_capability/data/build/settings @@ -5,6 +5,7 @@ project_name f_capability version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_color/data/build/settings b/level_0/f_color/data/build/settings index 95b4dfe..42d62e7 100644 --- a/level_0/f_color/data/build/settings +++ b/level_0/f_color/data/build/settings @@ -5,6 +5,7 @@ project_name f_color version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_console/data/build/settings b/level_0/f_console/data/build/settings index 1a1678c..b33ae23 100644 --- a/level_0/f_console/data/build/settings +++ b/level_0/f_console/data/build/settings @@ -5,6 +5,7 @@ project_name f_console version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_control_group/data/build/settings b/level_0/f_control_group/data/build/settings index f85fea3..39d9f1b 100644 --- a/level_0/f_control_group/data/build/settings +++ b/level_0/f_control_group/data/build/settings @@ -5,6 +5,7 @@ project_name f_control_group version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_conversion/data/build/settings b/level_0/f_conversion/data/build/settings index 7ef969a..2d0eb39 100644 --- a/level_0/f_conversion/data/build/settings +++ b/level_0/f_conversion/data/build/settings @@ -5,6 +5,7 @@ project_name f_conversion version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_directory/data/build/settings b/level_0/f_directory/data/build/settings index 16aae95..bc6edc5 100644 --- a/level_0/f_directory/data/build/settings +++ b/level_0/f_directory/data/build/settings @@ -5,6 +5,7 @@ project_name f_directory version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_environment/data/build/settings b/level_0/f_environment/data/build/settings index 56f22ad..368d40d 100644 --- a/level_0/f_environment/data/build/settings +++ b/level_0/f_environment/data/build/settings @@ -5,6 +5,7 @@ project_name f_environment version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_execute/data/build/settings b/level_0/f_execute/data/build/settings index 297bf65..2e46c92 100644 --- a/level_0/f_execute/data/build/settings +++ b/level_0/f_execute/data/build/settings @@ -5,6 +5,7 @@ project_name f_execute version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_file/data/build/settings b/level_0/f_file/data/build/settings index 1c103a2..1ac4587 100644 --- a/level_0/f_file/data/build/settings +++ b/level_0/f_file/data/build/settings @@ -5,6 +5,7 @@ project_name f_file version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index cc1b833..8590a31 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -5,6 +5,7 @@ project_name f_fss version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_iki/data/build/settings b/level_0/f_iki/data/build/settings index 4bc11d2..d094c2c 100644 --- a/level_0/f_iki/data/build/settings +++ b/level_0/f_iki/data/build/settings @@ -5,6 +5,7 @@ project_name f_iki version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_limit/data/build/settings b/level_0/f_limit/data/build/settings index 1d2cc95..a6d3590 100644 --- a/level_0/f_limit/data/build/settings +++ b/level_0/f_limit/data/build/settings @@ -5,6 +5,7 @@ project_name f_limit version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_memory/data/build/settings b/level_0/f_memory/data/build/settings index e601a57..59b4eb9 100644 --- a/level_0/f_memory/data/build/settings +++ b/level_0/f_memory/data/build/settings @@ -5,6 +5,7 @@ project_name f_memory version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_path/data/build/settings b/level_0/f_path/data/build/settings index 973b76f..22ec9f8 100644 --- a/level_0/f_path/data/build/settings +++ b/level_0/f_path/data/build/settings @@ -5,6 +5,7 @@ project_name f_path version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_pipe/data/build/settings b/level_0/f_pipe/data/build/settings index 9de6fdd..171e689 100644 --- a/level_0/f_pipe/data/build/settings +++ b/level_0/f_pipe/data/build/settings @@ -5,6 +5,7 @@ project_name f_pipe version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_print/data/build/settings b/level_0/f_print/data/build/settings index 119785c..d0454a6 100644 --- a/level_0/f_print/data/build/settings +++ b/level_0/f_print/data/build/settings @@ -5,6 +5,7 @@ project_name f_print version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_serialize/data/build/settings b/level_0/f_serialize/data/build/settings index 6f4d8ae..da3a95b 100644 --- a/level_0/f_serialize/data/build/settings +++ b/level_0/f_serialize/data/build/settings @@ -5,6 +5,7 @@ project_name f_serialize version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_signal/data/build/settings b/level_0/f_signal/data/build/settings index 6d336af..9f063b0 100644 --- a/level_0/f_signal/data/build/settings +++ b/level_0/f_signal/data/build/settings @@ -5,6 +5,7 @@ project_name f_signal version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_socket/data/build/settings b/level_0/f_socket/data/build/settings index 5619361..9c10a56 100644 --- a/level_0/f_socket/data/build/settings +++ b/level_0/f_socket/data/build/settings @@ -5,6 +5,7 @@ project_name f_socket version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_status/data/build/settings b/level_0/f_status/data/build/settings index 6a631ab..80e40c9 100644 --- a/level_0/f_status/data/build/settings +++ b/level_0/f_status/data/build/settings @@ -5,6 +5,7 @@ project_name f_status version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_string/data/build/settings b/level_0/f_string/data/build/settings index 45c2278..fad6b06 100644 --- a/level_0/f_string/data/build/settings +++ b/level_0/f_string/data/build/settings @@ -5,6 +5,7 @@ project_name f_string version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_thread/data/build/settings b/level_0/f_thread/data/build/settings index 8b32453..f193daf 100644 --- a/level_0/f_thread/data/build/settings +++ b/level_0/f_thread/data/build/settings @@ -5,6 +5,7 @@ project_name f_thread version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_type/data/build/settings b/level_0/f_type/data/build/settings index 5ef106c..206728b 100644 --- a/level_0/f_type/data/build/settings +++ b/level_0/f_type/data/build/settings @@ -5,6 +5,7 @@ project_name f_type version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_type_array/data/build/settings b/level_0/f_type_array/data/build/settings index c4708ef..8f4629e 100644 --- a/level_0/f_type_array/data/build/settings +++ b/level_0/f_type_array/data/build/settings @@ -5,6 +5,7 @@ project_name f_type_array version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_0/f_utf/data/build/settings b/level_0/f_utf/data/build/settings index ccc8bd3..d704b73 100644 --- a/level_0/f_utf/data/build/settings +++ b/level_0/f_utf/data/build/settings @@ -5,6 +5,7 @@ project_name f_utf version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_console/data/build/settings b/level_1/fl_console/data/build/settings index 0741e9f..4c420ca 100644 --- a/level_1/fl_console/data/build/settings +++ b/level_1/fl_console/data/build/settings @@ -5,6 +5,7 @@ project_name fl_console version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_control_group/data/build/settings b/level_1/fl_control_group/data/build/settings index 6de5384..3e7566b 100644 --- a/level_1/fl_control_group/data/build/settings +++ b/level_1/fl_control_group/data/build/settings @@ -5,6 +5,7 @@ project_name fl_control_group version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_conversion/data/build/settings b/level_1/fl_conversion/data/build/settings index 35248a0..09af0fd 100644 --- a/level_1/fl_conversion/data/build/settings +++ b/level_1/fl_conversion/data/build/settings @@ -5,6 +5,7 @@ project_name fl_conversion version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_directory/data/build/settings b/level_1/fl_directory/data/build/settings index cfda9d3..e0f3dc9 100644 --- a/level_1/fl_directory/data/build/settings +++ b/level_1/fl_directory/data/build/settings @@ -5,6 +5,7 @@ project_name fl_directory version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_environment/data/build/settings b/level_1/fl_environment/data/build/settings index 9b6c1d4..3a55d0a 100644 --- a/level_1/fl_environment/data/build/settings +++ b/level_1/fl_environment/data/build/settings @@ -5,6 +5,7 @@ project_name fl_environment version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_execute/data/build/settings b/level_1/fl_execute/data/build/settings index 55e942d..e310b9c 100644 --- a/level_1/fl_execute/data/build/settings +++ b/level_1/fl_execute/data/build/settings @@ -5,6 +5,7 @@ project_name fl_execute version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_fss/data/build/settings b/level_1/fl_fss/data/build/settings index de5e07f..70ea49d 100644 --- a/level_1/fl_fss/data/build/settings +++ b/level_1/fl_fss/data/build/settings @@ -5,6 +5,7 @@ project_name fl_fss version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_iki/data/build/settings b/level_1/fl_iki/data/build/settings index 03be9e8..84c3879 100644 --- a/level_1/fl_iki/data/build/settings +++ b/level_1/fl_iki/data/build/settings @@ -5,6 +5,7 @@ project_name fl_iki version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_print/data/build/settings b/level_1/fl_print/data/build/settings index 2b627e3..50e10a8 100644 --- a/level_1/fl_print/data/build/settings +++ b/level_1/fl_print/data/build/settings @@ -5,6 +5,7 @@ project_name fl_print version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_signal/data/build/settings b/level_1/fl_signal/data/build/settings index 9107aef..5098d74 100644 --- a/level_1/fl_signal/data/build/settings +++ b/level_1/fl_signal/data/build/settings @@ -5,6 +5,7 @@ project_name fl_iki version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_status/data/build/settings b/level_1/fl_status/data/build/settings index a7c80ff..345d9cb 100644 --- a/level_1/fl_status/data/build/settings +++ b/level_1/fl_status/data/build/settings @@ -5,6 +5,7 @@ project_name fl_status version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_string/data/build/settings b/level_1/fl_string/data/build/settings index fb89d0a..b29c36a 100644 --- a/level_1/fl_string/data/build/settings +++ b/level_1/fl_string/data/build/settings @@ -5,6 +5,7 @@ project_name fl_string version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_utf/data/build/settings b/level_1/fl_utf/data/build/settings index be6ad54..f2047f9 100644 --- a/level_1/fl_utf/data/build/settings +++ b/level_1/fl_utf/data/build/settings @@ -5,6 +5,7 @@ project_name fl_utf version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_1/fl_utf_file/data/build/settings b/level_1/fl_utf_file/data/build/settings index 7b91ce3..9605e81 100644 --- a/level_1/fl_utf_file/data/build/settings +++ b/level_1/fl_utf_file/data/build/settings @@ -5,6 +5,7 @@ project_name fl_utf_file version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_control_group/data/build/settings b/level_2/fll_control_group/data/build/settings index f5b09c1..4c13dc3 100644 --- a/level_2/fll_control_group/data/build/settings +++ b/level_2/fll_control_group/data/build/settings @@ -5,6 +5,7 @@ project_name fll_control_group version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_error/data/build/settings b/level_2/fll_error/data/build/settings index 88fbe4f..8852419 100644 --- a/level_2/fll_error/data/build/settings +++ b/level_2/fll_error/data/build/settings @@ -5,6 +5,7 @@ project_name fll_error version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_execute/data/build/settings b/level_2/fll_execute/data/build/settings index bcfb09f..b3661fa 100644 --- a/level_2/fll_execute/data/build/settings +++ b/level_2/fll_execute/data/build/settings @@ -5,6 +5,7 @@ project_name fll_execute version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_file/data/build/settings b/level_2/fll_file/data/build/settings index 0448e2d..a84b15e 100644 --- a/level_2/fll_file/data/build/settings +++ b/level_2/fll_file/data/build/settings @@ -5,6 +5,7 @@ project_name fll_file version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_fss/data/build/settings b/level_2/fll_fss/data/build/settings index 97b272e..995afef 100644 --- a/level_2/fll_fss/data/build/settings +++ b/level_2/fll_fss/data/build/settings @@ -5,6 +5,7 @@ project_name fll_fss version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_iki/data/build/settings b/level_2/fll_iki/data/build/settings index 587ee86..b03dbe5 100644 --- a/level_2/fll_iki/data/build/settings +++ b/level_2/fll_iki/data/build/settings @@ -5,6 +5,7 @@ project_name fll_iki version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_path/data/build/settings b/level_2/fll_path/data/build/settings index 1061c3b..d6be4a2 100644 --- a/level_2/fll_path/data/build/settings +++ b/level_2/fll_path/data/build/settings @@ -5,6 +5,7 @@ project_name fll_path version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_program/data/build/settings b/level_2/fll_program/data/build/settings index 85a8e41..c2a88e7 100644 --- a/level_2/fll_program/data/build/settings +++ b/level_2/fll_program/data/build/settings @@ -5,6 +5,7 @@ project_name fll_program version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_2/fll_status/data/build/settings b/level_2/fll_status/data/build/settings index 265b63c..f01ca99 100644 --- a/level_2/fll_status/data/build/settings +++ b/level_2/fll_status/data/build/settings @@ -5,6 +5,7 @@ project_name fll_status version_major 0 version_minor 5 version_micro 4 +version_file minor version_target micro environment diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index 1189fc9..5b68c1b 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -5,7 +5,8 @@ project_name byte_dump version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 90879d6..b971b4f 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -5,7 +5,8 @@ project_name control version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/controller/data/build/settings b/level_3/controller/data/build/settings index 065ab6c..7ab6a10 100644 --- a/level_3/controller/data/build/settings +++ b/level_3/controller/data/build/settings @@ -5,7 +5,8 @@ project_name controller version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index d90a6e0..0a94f18 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1020,21 +1020,30 @@ extern "C" { f_array_length_t parameter_linker_length = fake_build_parameter_library_shared_prefix_length; f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used; + if (data_build.setting.version_file == fake_build_version_type_major) { + parameter_file_path_length += parameter_file_name_major_length; + } + else if (data_build.setting.version_file == fake_build_version_type_minor) { + parameter_file_path_length += parameter_file_name_minor_length; + } + else if (data_build.setting.version_file == fake_build_version_type_micro) { + parameter_file_path_length += parameter_file_name_micro_length; + } + else if (data_build.setting.version_file == fake_build_version_type_nano) { + parameter_file_path_length += parameter_file_name_nano_length; + } + if (data_build.setting.version_target == fake_build_version_type_major) { parameter_linker_length += parameter_file_name_major_length; - parameter_file_path_length += parameter_file_name_major_length; } else if (data_build.setting.version_target == fake_build_version_type_minor) { parameter_linker_length += parameter_file_name_minor_length; - parameter_file_path_length += parameter_file_name_minor_length; } else if (data_build.setting.version_target == fake_build_version_type_micro) { parameter_linker_length += parameter_file_name_micro_length; - parameter_file_path_length += parameter_file_name_micro_length; } else if (data_build.setting.version_target == fake_build_version_type_nano) { parameter_linker_length += parameter_file_name_nano_length; - parameter_file_path_length += parameter_file_name_nano_length; } char parameter_linker[parameter_linker_length + 1]; @@ -1043,21 +1052,30 @@ extern "C" { memcpy(parameter_linker, fake_build_parameter_library_shared_prefix, fake_build_parameter_library_shared_prefix_length); memcpy(parameter_file_path, main.path_build_libraries_shared.string, main.path_build_libraries_shared.used); + if (data_build.setting.version_file == fake_build_version_type_major) { + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length); + } + else if (data_build.setting.version_file == fake_build_version_type_minor) { + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_minor, parameter_file_name_minor_length); + } + else if (data_build.setting.version_file == fake_build_version_type_micro) { + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_micro, parameter_file_name_micro_length); + } + else if (data_build.setting.version_file == fake_build_version_type_nano) { + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_nano, parameter_file_name_nano_length); + } + if (data_build.setting.version_target == fake_build_version_type_major) { memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_major, parameter_file_name_major_length); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length); } else if (data_build.setting.version_target == fake_build_version_type_minor) { memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_minor, parameter_file_name_minor_length); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_minor, parameter_file_name_minor_length); } else if (data_build.setting.version_target == fake_build_version_type_micro) { memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_micro, parameter_file_name_micro_length); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_micro, parameter_file_name_micro_length); } else if (data_build.setting.version_target == fake_build_version_type_nano) { memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_nano, parameter_file_name_nano_length); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_nano, parameter_file_name_nano_length); } parameter_linker[parameter_linker_length] = 0; @@ -1108,24 +1126,14 @@ extern "C" { } } - if (data_build.setting.version_target != fake_build_version_type_major && parameter_file_name_major_length) { - f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_major_length; + if (parameter_file_name_major_length) { - char *link_target = 0; - char parameter_file_path[parameter_file_path_length + 1]; + f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_length; - if (data_build.setting.version_target == fake_build_version_type_minor) { - link_target = parameter_file_name_minor; - } - else if (data_build.setting.version_target == fake_build_version_type_micro) { - link_target = parameter_file_name_micro; - } - else if (data_build.setting.version_target == fake_build_version_type_nano) { - link_target = parameter_file_name_nano; - } + char parameter_file_path[parameter_file_path_length + 1]; memcpy(parameter_file_path, main.path_build_libraries_shared.string, main.path_build_libraries_shared.used); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length); + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name, parameter_file_name_length); parameter_file_path[parameter_file_path_length] = 0; @@ -1135,10 +1143,10 @@ extern "C" { return 0; } - *status = f_file_link(link_target, parameter_file_path); + *status = f_file_link(parameter_file_name_major, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, link_target, f_string_eol_s[0]); + fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_major, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1147,20 +1155,20 @@ extern "C" { return 0; } - fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, link_target, "link", fll_error_file_type_file); + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_major, "link", fll_error_file_type_file); return 0; } } - if (F_status_is_error_not(*status) && parameter_file_name_major_length) { + if (data_build.setting.version_file != fake_build_version_type_major && parameter_file_name_major_length) { - f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_length; + f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_major_length; char parameter_file_path[parameter_file_path_length + 1]; memcpy(parameter_file_path, main.path_build_libraries_shared.string, main.path_build_libraries_shared.used); - memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name, parameter_file_name_length); + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length); parameter_file_path[parameter_file_path_length] = 0; @@ -1170,10 +1178,10 @@ extern "C" { return 0; } - *status = f_file_link(parameter_file_name_major, parameter_file_path); + *status = f_file_link(parameter_file_name_minor, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_major, f_string_eol_s[0]); + fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_minor, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1182,10 +1190,80 @@ extern "C" { return 0; } - fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_major, "link", fll_error_file_type_file); + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, "link", fll_error_file_type_file); return 0; } + + if (data_build.setting.version_file != fake_build_version_type_minor && parameter_file_name_minor_length) { + + f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_minor_length; + + char parameter_file_path[parameter_file_path_length + 1]; + + memcpy(parameter_file_path, main.path_build_libraries_shared.string, main.path_build_libraries_shared.used); + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_minor, parameter_file_name_minor_length); + + parameter_file_path[parameter_file_path_length] = 0; + + if (fake_signal_received(main)) { + *status = F_status_set_error(F_signal); + + return 0; + } + + *status = f_file_link(parameter_file_name_micro, parameter_file_path); + + if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { + fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_micro, f_string_eol_s[0]); + } + else if (F_status_is_error(*status)) { + if (F_status_set_fine(*status) == F_file_found) { + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, "link", fll_error_file_type_file); + + return 0; + } + + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, "link", fll_error_file_type_file); + + return 0; + } + + if (data_build.setting.version_file != fake_build_version_type_micro && parameter_file_name_micro_length) { + + f_array_length_t parameter_file_path_length = main.path_build_libraries_shared.used + parameter_file_name_micro_length; + + char parameter_file_path[parameter_file_path_length + 1]; + + memcpy(parameter_file_path, main.path_build_libraries_shared.string, main.path_build_libraries_shared.used); + memcpy(parameter_file_path + main.path_build_libraries_shared.used, parameter_file_name_micro, parameter_file_name_micro_length); + + parameter_file_path[parameter_file_path_length] = 0; + + if (fake_signal_received(main)) { + *status = F_status_set_error(F_signal); + + return 0; + } + + *status = f_file_link(parameter_file_name_nano, parameter_file_path); + + if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { + fprintf(main.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_nano, f_string_eol_s[0]); + } + else if (F_status_is_error(*status)) { + if (F_status_set_fine(*status) == F_file_found) { + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, "link", fll_error_file_type_file); + + return 0; + } + + fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_nano, "link", fll_error_file_type_file); + + return 0; + } + } + } } fake_build_touch(main, file_stage, status); @@ -1537,6 +1615,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 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; f_string_dynamics_t version_micro = f_string_dynamics_t_initialize; @@ -1590,6 +1669,7 @@ extern "C" { fake_build_setting_name_search_exclusive, fake_build_setting_name_search_shared, fake_build_setting_name_search_static, + fake_build_setting_name_version_file, fake_build_setting_name_version_major, fake_build_setting_name_version_major_prefix, fake_build_setting_name_version_micro, @@ -1644,6 +1724,7 @@ extern "C" { fake_build_setting_name_search_exclusive_length, fake_build_setting_name_search_shared_length, fake_build_setting_name_search_static_length, + fake_build_setting_name_version_file_length, fake_build_setting_name_version_major_length, fake_build_setting_name_version_major_prefix_length, fake_build_setting_name_version_micro_length, @@ -1698,6 +1779,7 @@ extern "C" { &search_exclusive, &search_shared, &search_static, + &version_file, &version_major, &version_major_prefix, &version_micro, @@ -1761,6 +1843,7 @@ extern "C" { F_false, F_false, F_false, + F_false, }; f_string_t function = "fll_fss_snatch_apart"; @@ -1917,6 +2000,7 @@ extern "C" { fake_build_setting_name_search_exclusive, fake_build_setting_name_search_shared, fake_build_setting_name_search_static, + fake_build_setting_name_version_file, fake_build_setting_name_version_major, fake_build_setting_name_version_major_prefix, fake_build_setting_name_version_micro, @@ -1952,6 +2036,7 @@ extern "C" { &search_exclusive, &search_shared, &search_static, + &version_file, &version_major, &version_major_prefix, &version_micro, @@ -2013,6 +2098,7 @@ extern "C" { 0, 0, 0, + 0, &setting->version_major, &setting->version_major_prefix, &setting->version_micro, @@ -2053,6 +2139,7 @@ extern "C" { 0, 0, 0, + &setting->version_file, 0, 0, 0, @@ -2064,6 +2151,78 @@ extern "C" { &setting->version_target, }; + const uint8_t settings_single_version_default[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + fake_build_version_type_micro, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + fake_build_version_type_major, + }; + + const char *settings_single_version_default_name[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + fake_build_version_micro, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + fake_build_version_major, + }; + // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", "micro", or "nano". const uint8_t settings_single_type[] = { 3, @@ -2089,6 +2248,7 @@ extern "C" { 1, 1, 1, + 5, 3, 3, 3, @@ -2100,7 +2260,7 @@ extern "C" { 5, }; - for (f_array_length_t i = 0; i < 32; ++i) { + for (f_array_length_t i = 0; i < 33; ++i) { if (!settings_single_source[i]->used) continue; @@ -2191,7 +2351,7 @@ extern "C" { *settings_single_version[i] = fake_build_version_type_nano; } else { - *settings_single_version[i] = fake_build_version_type_major; + *settings_single_version[i] = settings_single_version_default[i]; if (main.error.verbosity == f_console_verbosity_verbose) { fprintf(main.output.stream, "%c", f_string_eol_s[0]); @@ -2208,7 +2368,7 @@ extern "C" { f_color_print(main.output.stream, main.context.set.warning, "', or '"); f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_version_nano); f_color_print(main.output.stream, main.context.set.warning, "', defaulting to '"); - f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_version_major); + f_color_print(main.output.stream, main.context.set.notable, "%s", settings_single_version_default_name[i]); f_color_print(main.output.stream, main.context.set.warning, "'."); fprintf(main.output.stream, "%c", f_string_eol_s[0]); } @@ -2243,6 +2403,40 @@ extern "C" { } } // for + if (F_status_is_error_not(*status)) { + if (!setting->version_file) { + setting->version_file = fake_build_version_type_micro; + + if (main.error.verbosity == f_console_verbosity_verbose) { + fprintf(main.output.stream, "%c", f_string_eol_s[0]); + f_color_print(main.output.stream, main.context.set.warning, "%sthe setting '", fll_error_print_warning); + f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_setting_name_version_file); + f_color_print(main.output.stream, main.context.set.warning, "' in the file '"); + f_color_print(main.output.stream, main.context.set.notable, "%s", path_file); + f_color_print(main.output.stream, main.context.set.warning, "' is required, defaulting to '"); + f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_version_micro); + f_color_print(main.output.stream, main.context.set.warning, "'."); + fprintf(main.output.stream, "%c", f_string_eol_s[0]); + } + } + + if (!setting->version_target) { + setting->version_target = fake_build_version_type_major; + + if (main.error.verbosity == f_console_verbosity_verbose) { + fprintf(main.output.stream, "%c", f_string_eol_s[0]); + f_color_print(main.output.stream, main.context.set.warning, "%sthe setting '", fll_error_print_warning); + f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_setting_name_version_target); + f_color_print(main.output.stream, main.context.set.warning, "' in the file '"); + f_color_print(main.output.stream, main.context.set.notable, "%s", path_file); + f_color_print(main.output.stream, main.context.set.warning, "' is required, defaulting to '"); + f_color_print(main.output.stream, main.context.set.notable, "%s", fake_build_version_major); + f_color_print(main.output.stream, main.context.set.warning, "'."); + fprintf(main.output.stream, "%c", f_string_eol_s[0]); + } + } + } + // Provide these defaults only if the Object is not defined (this allows for empty Content to exist if the Object is defined). // In the case of the version prefixes, if the associated version is empty, then instead clear the associated version prefix. if (F_status_is_error_not(*status)) { @@ -2261,10 +2455,10 @@ extern "C" { }; bool has_prefix_object[] = { - settings_matches[43], // version_major_prefix - settings_matches[45], // version_minor_prefix - settings_matches[47], // version_micro_prefix - settings_matches[49], // version_nano_prefix + settings_matches[44], // version_major_prefix + settings_matches[46], // version_minor_prefix + settings_matches[48], // version_micro_prefix + settings_matches[50], // version_nano_prefix }; const char *name_target[] = { @@ -2281,7 +2475,20 @@ extern "C" { fake_build_setting_name_version_nano, }; - for (f_array_length_t i = 0; i < 4; ++i) { + const char *setting_name[] = { + fake_build_setting_name_version_file, + fake_build_setting_name_version_target, + }; + + const uint8_t setting_target[] = { + setting->version_file, + setting->version_target, + }; + + f_array_length_t i = 0; + f_array_length_t j = 0; + + for (; i < 4; ++i) { if (version[i]->used) { if (!has_prefix_object[i]) { @@ -2298,20 +2505,26 @@ extern "C" { else { prefix[i]->used = 0; - if (setting->version_target && i + 1 <= setting->version_target) { - if (main.error.verbosity != f_console_verbosity_quiet) { - fprintf(main.error.to.stream, "%c", f_string_eol_s[0]); - f_color_print(main.error.to.stream, main.context.set.error, "%sWhen the version target is set to '", fll_error_print_error); - f_color_print(main.error.to.stream, main.context.set.notable, "%s", name_target[setting->version_target - 1]); - f_color_print(main.error.to.stream, main.context.set.error, "', then the '"); - f_color_print(main.error.to.stream, main.context.set.notable, "%s", name_object[i]); - f_color_print(main.error.to.stream, main.context.set.error, "' Object must have Content."); - fprintf(main.error.to.stream, "%c", f_string_eol_s[0]); + for (j = 0; j < 2; ++j) { + if (setting_target[j] && i + 1 <= setting_target[j]) { + if (main.error.verbosity != f_console_verbosity_quiet) { + fprintf(main.error.to.stream, "%c", f_string_eol_s[0]); + f_color_print(main.error.to.stream, main.context.set.error, "%sWhen the '", fll_error_print_error); + f_color_print(main.error.to.stream, main.context.set.notable, "%s", setting_name[j]); + f_color_print(main.error.to.stream, main.context.set.error, "' is set to '"); + f_color_print(main.error.to.stream, main.context.set.notable, "%s", name_target[setting_target[j] - 1]); + f_color_print(main.error.to.stream, main.context.set.error, "', then the '"); + f_color_print(main.error.to.stream, main.context.set.notable, "%s", name_object[i]); + f_color_print(main.error.to.stream, main.context.set.error, "' Object must have Content."); + fprintf(main.error.to.stream, "%c", f_string_eol_s[0]); + } + + *status = F_status_set_error(F_failure); + break; } + } // for - *status = F_status_set_error(F_failure); - break; - } + if (F_status_is_error(*status)) break; } } // for } @@ -2340,6 +2553,7 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(search_exclusive); macro_f_string_dynamics_t_delete_simple(search_shared); macro_f_string_dynamics_t_delete_simple(search_static); + macro_f_string_dynamics_t_delete_simple(version_file); macro_f_string_dynamics_t_delete_simple(version_major); macro_f_string_dynamics_t_delete_simple(version_major_prefix); macro_f_string_dynamics_t_delete_simple(version_micro); diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index 18d5226..73ae703 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -16,6 +16,7 @@ extern "C" { typedef struct { uint8_t build_language; + uint8_t version_file; uint8_t version_target; bool build_script; @@ -76,6 +77,7 @@ extern "C" { #define fake_build_setting_t_initialize { \ 0, \ 0, \ + 0, \ F_true, \ F_true, \ F_true, \ @@ -212,6 +214,7 @@ extern "C" { #define fake_build_setting_name_search_exclusive "search_exclusive" #define fake_build_setting_name_search_shared "search_shared" #define fake_build_setting_name_search_static "search_static" + #define fake_build_setting_name_version_file "version_file" #define fake_build_setting_name_version_major "version_major" #define fake_build_setting_name_version_major_prefix "version_major_prefix" #define fake_build_setting_name_version_micro "version_micro" @@ -264,6 +267,7 @@ extern "C" { #define fake_build_setting_name_search_exclusive_length 16 #define fake_build_setting_name_search_shared_length 13 #define fake_build_setting_name_search_static_length 13 + #define fake_build_setting_name_version_file_length 12 #define fake_build_setting_name_version_major_length 13 #define fake_build_setting_name_version_major_prefix_length 20 #define fake_build_setting_name_version_micro_length 13 @@ -274,7 +278,7 @@ extern "C" { #define fake_build_setting_name_version_nano_prefix_length 19 #define fake_build_setting_name_version_target_length 14 - #define fake_build_setting_total 51 + #define fake_build_setting_total 52 #define fake_build_setting_default_version "0" #define fake_build_setting_default_version_prefix "." diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index b1a2b5f..e2ec44f 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -1592,20 +1592,23 @@ extern "C" { { const f_string_t uint8_name[] = { fake_build_setting_name_build_language, + fake_build_setting_name_version_file, fake_build_setting_name_version_target, }; const f_array_length_t uint8_length[] = { fake_build_setting_name_build_language_length, + fake_build_setting_name_version_file_length, fake_build_setting_name_version_target_length, }; const uint8_t uint8_value[] = { data_make->setting_build.build_language, + data_make->setting_build.version_file, data_make->setting_build.version_target, }; - for (uint8_t i = 0; i < 2; ++i) { + for (uint8_t i = 0; i < 3; ++i) { status = fl_string_dynamic_partial_compare_string(uint8_name[i], data_make->buffer, uint8_length[i], range_name); diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index fb5bf9c..814d16d 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -5,7 +5,8 @@ project_name fake version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fake/documents/settings.txt b/level_3/fake/documents/settings.txt index 2434013..e1779cc 100644 --- a/level_3/fake/documents/settings.txt +++ b/level_3/fake/documents/settings.txt @@ -229,6 +229,17 @@ Settings Documentation: When "yes", static library paths are searched during compile. Both this and search_shared cannot be "no" at the same time. + version_file\: + Designates which version should be used when building the symbolic links. + Any version prefixes are used as defined. + A Symbolic link is created against this created file such that "libX.so" is a link to "libX.so.A". + For all files other than when file is "major", another symbolic link is created against this such that "libX.so.A" is a link to "libX.so.A.X" such that X is the respective "B", "B.C', or "B.C.D" as described below. + The default file is "major". + When "major" is used, the file created is "libX.so.A", whereas "X" is the "project_name" and "A" is the major version. + When "minor" is used, the file created is "libX.so.A.B", whereas "X" is the "project_name" and "A.B" is the major and minor versions, respectively. + When "micro" is used, the file created is "libX.so.A.B.C", whereas "X" is the "project_name" and "A.B.C" is the major, minor, and micro versions, respectively. + When "nano" is used, the file created is "libX.so.A.B.C.D", whereas "X" is the "project_name" and "A.B.C.D" is the major, minor, micro, and nano versions, respectively. + version_major\: The major version number (or in theory any characters allowed in a filename). This should generally be a positive number or 0. @@ -282,10 +293,10 @@ Settings Documentation: This is only added if "version_nano" is not empty. version_target\: - Designates which version should be used when building the shared library and creating the respective symbolic links. + Designates which version should be used when linking the shared library. Any version prefixes are used as defined. The default target is "micro". - When "major" is used, a shared library is generated with "-Wl,-soname,libX.A", whereas "X" is the "project_name" and "A" is the major version. - When "minor" is used, a shared library is generated with "-Wl,-soname,libX.A.B", whereas "X" is the "project_name" and "A.B" is the major and minor versions, respectively. - When "micro" is used, a shared library is generated with "-Wl,-soname,libX.A.B.C", whereas "X" is the "project_name" and "A.B.C" is the major, minor, and micro versions, respectively. - When "nano" is used, a shared library is generated with "-Wl,-soname,libX.A.B.C.D", whereas "X" is the "project_name" and "A.B.C.D" is the major, minor, micro, and nano versions, respectively. + When "major" is used, a shared library is generated with "-Wl,-soname,libX.so.A", whereas "X" is the "project_name" and "A" is the major version. + When "minor" is used, a shared library is generated with "-Wl,-soname,libX.so.A.B", whereas "X" is the "project_name" and "A.B" is the major and minor versions, respectively. + When "micro" is used, a shared library is generated with "-Wl,-soname,libX.so.A.B.C", whereas "X" is the "project_name" and "A.B.C" is the major, minor, and micro versions, respectively. + When "nano" is used, a shared library is generated with "-Wl,-soname,libX.so.A.B.C.D", whereas "X" is the "project_name" and "A.B.C.D" is the major, minor, micro, and nano versions, respectively. diff --git a/level_3/fake/specifications/settings.txt b/level_3/fake/specifications/settings.txt index 09e6818..e116bc6 100644 --- a/level_3/fake/specifications/settings.txt +++ b/level_3/fake/specifications/settings.txt @@ -52,6 +52,7 @@ Settings Specification: "search_exclusive": Must only one of: "yes" or "no". "search_shared": Must only one of: "yes" or "no". "search_static": Must only one of: "yes" or "no". + "version_file": Must only be one of: "major", "minor", "micro", or "nano". "version_major": Must only be a single value containing valid filename characters. "version_major_prefix": Must be zero or more valid filename characters. "version_minor": Must only be a single value containing valid filename characters. diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 896130a..ba22650 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -5,7 +5,8 @@ project_name firewall version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 8d363ca..e9f92be 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -5,7 +5,8 @@ project_name fss_basic_list_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index a31145d..51ecd88 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -5,7 +5,8 @@ project_name fss_basic_list_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index 54656f6..671faf8 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -5,7 +5,8 @@ project_name fss_basic_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index ada933b..7841ca7 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -5,7 +5,8 @@ project_name fss_basic_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index cd8bb16..18f5340 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -5,7 +5,8 @@ project_name fss_embedded_list_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_embedded_list_write/data/build/settings b/level_3/fss_embedded_list_write/data/build/settings index c70ac40..2f74e4e 100644 --- a/level_3/fss_embedded_list_write/data/build/settings +++ b/level_3/fss_embedded_list_write/data/build/settings @@ -5,7 +5,8 @@ project_name fss_embedded_list_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index cc53cf2..60efc43 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -5,7 +5,8 @@ project_name fss_extended_list_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_extended_list_write/data/build/settings b/level_3/fss_extended_list_write/data/build/settings index bd98b6d..7b1bf9f 100644 --- a/level_3/fss_extended_list_write/data/build/settings +++ b/level_3/fss_extended_list_write/data/build/settings @@ -5,7 +5,8 @@ project_name fss_extended_list_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 7449e6a..1922728 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -5,7 +5,8 @@ project_name fss_extended_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index 19a8c29..1977222 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -5,7 +5,8 @@ project_name fss_extended_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_identify/data/build/settings b/level_3/fss_identify/data/build/settings index fedacdd..2712d63 100644 --- a/level_3/fss_identify/data/build/settings +++ b/level_3/fss_identify/data/build/settings @@ -5,7 +5,8 @@ project_name fss_identify version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 91436eb..40ae412 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -5,7 +5,8 @@ project_name fss_status_code version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index a6b740a..1acf2a6 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -5,7 +5,8 @@ project_name iki_read version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index cd821ad..1340fa2 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -5,7 +5,8 @@ project_name iki_write version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 732705d..d092a28 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -5,7 +5,8 @@ project_name status_code version_major 0 version_minor 5 version_micro 4 -version_target micro +version_file micro +version_target minor environment