From cc015b1046c19acd383cc8b39e18433c8bd8054b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 22 Nov 2019 22:56:20 -0600 Subject: [PATCH] Update: build level and monolithic fixes and improvements Add missing library: fll_file. Make it even easier to compile against "level" and "monolithic" build processes by providing "--level" and "--monolithic" parameters to the generate.sh script and associated settings files. Make sure package.sh clears other build modes (when --level is specified, make sur --individual and --monolithic modes are not set). --- build/level_0/settings | 1 + build/level_1/settings | 1 + build/level_2/settings | 5 +++-- build/monolithic/settings | 4 ++-- build/scripts/generate.sh | 15 +++++++++++---- build/scripts/package.sh | 6 ++++++ level_3/byte_dump/data/build/settings | 4 ++-- level_3/firewall/data/build/settings | 4 ++-- level_3/fss_basic_list_read/data/build/settings | 4 ++-- level_3/fss_basic_list_write/data/build/settings | 4 ++-- level_3/fss_basic_read/data/build/settings | 4 ++-- level_3/fss_basic_write/data/build/settings | 4 ++-- level_3/fss_extended_list_read/data/build/settings | 4 ++-- level_3/fss_extended_read/data/build/settings | 4 ++-- level_3/fss_extended_write/data/build/settings | 4 ++-- level_3/fss_status_code/data/build/settings | 4 ++-- level_3/init/data/build/settings | 4 ++-- level_3/status_code/data/build/settings | 4 ++-- 18 files changed, 48 insertions(+), 32 deletions(-) diff --git a/build/level_0/settings b/build/level_0/settings index e41ce5b..179ba4b 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -11,6 +11,7 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll +build_libraries_fll-level build_sources_library console.c conversion.c file.c memory.c pipe.c print.c utf.c build_sources_program build_sources_headers color.h console.h conversion.h file.h fss.h memory.h path_fll.h path_filesystem.h pipe.h print.h serialized.h socket.h status.h string.h type.h type_array.h utf.h diff --git a/build/level_1/settings b/build/level_1/settings index 53c2bcb..0157198 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -11,6 +11,7 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_0 +build_libraries_fll-level -lfll_0 build_sources_library color.c console.c directory.c file.c fss.c fss_basic.c fss_basic_list.c fss_extended.c serialized.c socket.c status.c string.c utf.c build_sources_program build_sources_headers color.h console.h directory.h file.h fss.h fss_basic.h fss_basic_list.h fss_status.h fss_extended.h fss_macro.h serialized.h socket.h status.h string.h utf.h diff --git a/build/level_2/settings b/build/level_2/settings index f5f1a52..773a50b 100644 --- a/build/level_2/settings +++ b/build/level_2/settings @@ -11,9 +11,10 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_0 -lfll_1 -build_sources_library execute.c fss_basic.c fss_basic_list.c fss_extended.c fss_status.c program.c status.c +build_libraries_fll-level -lfll_0 -lfll_1 +build_sources_library execute.c file.c fss_basic.c fss_basic_list.c fss_extended.c fss_status.c program.c status.c build_sources_program -build_sources_headers execute.h fss_basic.h fss_basic_list.h fss_extended.h fss_status.h program.h status.h +build_sources_headers execute.h file.h fss_basic.h fss_basic_list.h fss_extended.h fss_status.h program.h status.h build_shared yes build_static yes diff --git a/build/monolithic/settings b/build/monolithic/settings index ec702ab..9d4cfdd 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -11,9 +11,9 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -build_sources_library level_0/console.c level_0/conversion.c level_0/file.c level_0/memory.c level_0/pipe.c level_0/print.c level_0/utf.c level_1/color.c level_1/console.c level_1/directory.c level_1/file.c level_1/fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_extended.c level_1/serialized.c level_1/socket.c level_1/status.c level_1/string.c level_1/utf.c level_2/execute.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_extended.c level_2/fss_status.c level_2/program.c level_2/status.c +build_sources_library level_0/console.c level_0/conversion.c level_0/file.c level_0/memory.c level_0/pipe.c level_0/print.c level_0/utf.c level_1/color.c level_1/console.c level_1/directory.c level_1/file.c level_1/fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_extended.c level_1/serialized.c level_1/socket.c level_1/status.c level_1/string.c level_1/utf.c level_2/execute.c level_2/file.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_extended.c level_2/fss_status.c level_2/program.c level_2/status.c build_sources_program -build_sources_headers level_0/color.h level_0/console.h level_0/conversion.h level_0/file.h level_0/fss.h level_0/memory.h level_0/path_fll.h level_0/path_filesystem.h level_0/pipe.h level_0/print.h level_0/serialized.h level_0/socket.h level_0/status.h level_0/string.h level_0/type.h level_0/type_array.h level_0/utf.h level_1/color.h level_1/console.h level_1/directory.h level_1/file.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_status.h level_1/fss_extended.h level_1/fss_macro.h level_1/serialized.h level_1/socket.h level_1/status.h level_1/string.h level_1/utf.h level_2/execute.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_extended.h level_2/fss_status.h level_2/program.h level_2/status.h +build_sources_headers level_0/color.h level_0/console.h level_0/conversion.h level_0/file.h level_0/fss.h level_0/memory.h level_0/path_fll.h level_0/path_filesystem.h level_0/pipe.h level_0/print.h level_0/serialized.h level_0/socket.h level_0/status.h level_0/string.h level_0/type.h level_0/type_array.h level_0/utf.h level_1/color.h level_1/console.h level_1/directory.h level_1/file.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_status.h level_1/fss_extended.h level_1/fss_macro.h level_1/serialized.h level_1/socket.h level_1/status.h level_1/string.h level_1/utf.h level_2/execute.h level_2/file.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_extended.h level_2/fss_status.h level_2/program.h level_2/status.h build_sources_bash build_sources_settings build_shared yes diff --git a/build/scripts/generate.sh b/build/scripts/generate.sh index b5f4e77..481ec3d 100644 --- a/build/scripts/generate.sh +++ b/build/scripts/generate.sh @@ -28,6 +28,7 @@ generate_main(){ local c_subtle="\\033[1;30m" local c_prefix="\\" + local build_libraries_fll="build_libraries_fll" local variables= local settings_file= local settings_defines= @@ -78,6 +79,10 @@ generate_main(){ grab_next=work_directory elif [[ $p == "-d" || $p == "--defines" ]] ; then grab_next=defines_override + elif [[ $p == "-l" || $p == "--level" ]] ; then + build_libraries_fll="build_libraries_fll-level" + elif [[ $p == "-m" || $p == "--monolithic" ]] ; then + build_libraries_fll="build_libraries_fll-monolithic" elif [[ $p == "--enable-shared" ]] ; then enable_shared="yes" elif [[ $p == "--disable-shared" ]] ; then @@ -227,6 +232,8 @@ generate_help(){ echo -e " -${c_important}p$c_reset, --${c_important}project${c_reset} Project name for storing built status" echo -e " -${c_important}w$c_reset, --${c_important}work_directory${c_reset} Use includes/libraries from this directory instead of system" echo -e " -${c_important}d$c_reset, --${c_important}defines${c_reset} Override custom defines with these defines" + echo -e " -${c_important}l$c_reset, --${c_important}level${c_reset} Use FLL dependencies by level (-lfll_0, -lfll_1, -lfll_2)" + echo -e " -${c_important}m$c_reset, --${c_important}monolithic${c_reset} Use FLL dependencies by monolithic (-lfll)" echo echo -e "${c_highlight}Special Options:$c_reset" echo -e " --${c_important}enable-shared${c_reset} Forcibly do install shared files" @@ -248,7 +255,7 @@ generate_id(){ "build_compiler") echo -n 5;; "build_linker") echo -n 6;; "build_libraries") echo -n 7;; - "build_libraries_fll") echo -n 8;; + "$build_libraries_fll") echo -n 8;; "build_sources_library") echo -n 9;; "build_sources_program") echo -n 10;; "build_sources_headers") echo -n 11;; @@ -285,8 +292,8 @@ generate_load_settings(){ exit $failure fi - for i in project_name project_level version_major version_minor version_micro build_compiler build_linker build_libraries build_libraries_fll build_sources_library build_sources_program build_sources_headers build_sources_settings build_shared build_static defines_all defines_shared defines_static flags_all flags_shared flags_static flags_library flags_program ; do - variables[$(generate_id $i)]=$(grep -s -o "^[[:space:]]*$i\>.*$" $settings_file | sed -e "s|^[[:space:]]*$i\>||" -e 's|^[[:space:]]*||') + for i in project_name project_level version_major version_minor version_micro build_compiler build_linker build_libraries $build_libraries_fll build_sources_library build_sources_program build_sources_headers build_sources_settings build_shared build_static defines_all defines_shared defines_static flags_all flags_shared flags_static flags_library flags_program ; do + variables[$(generate_id $i)]=$(grep -s -o "^[[:space:]]*$i[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*$i\>||" -e 's|^[[:space:]]*||') done if [[ $project_name == "" ]] ; then @@ -336,7 +343,7 @@ generate_operation_build(){ local micro=${variables[$(generate_id version_micro)]} local compiler=${variables[$(generate_id build_compiler)]} local linker=${variables[$(generate_id build_linker)]} - local arguments="${variables[$(generate_id build_libraries_fll)]} ${variables[$(generate_id build_libraries)]}" + local arguments="${variables[$(generate_id "$build_libraries_fll")]} ${variables[$(generate_id build_libraries)]}" local arguments_include="-I${path_build}includes" local arguments_shared="-L${path_build}libraries/shared" local arguments_static="-L${path_build}libraries/static" diff --git a/build/scripts/package.sh b/build/scripts/package.sh index 9d1db98..3bfb2a8 100644 --- a/build/scripts/package.sh +++ b/build/scripts/package.sh @@ -63,9 +63,15 @@ package_main(){ grab_next=path_destination elif [[ $p == "-i" || $p == "--individual" ]] ; then mode_individual="yes" + mode_level= + mode_monolithic= elif [[ $p == "-l" || $p == "--level" ]] ; then + mode_individual= mode_level="yes" + mode_monolithic= elif [[ $p == "-m" || $p == "--monolithic" ]] ; then + mode_individual= + mode_level= mode_monolithic="yes" elif [[ $p == "-p" || $p == "--program" ]] ; then mode_program="yes" diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index 0521c90..f13ab91 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfl_utf -lfl_string -lfl_file -lfl_console -lfl_color -lf_utf -lf_print -lf_pipe -lf_file -lf_conversion -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library byte_dump.c private-byte_dump.c build_sources_program main.c build_sources_headers byte_dump.h diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index c4fea7d..8569e59 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_file -lf_utf -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library firewall.c private-firewall.c build_sources_program main.c build_sources_headers firewall.h diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 76fadc1..762d226 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c build_sources_program main.c build_sources_headers fss_basic_list_read.h diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index ee732b1..0113ee4 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_basic_list_write.c build_sources_program main.c build_sources_headers fss_basic_list_write.h diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index 6506de8..4230baf 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_basic_read.c private-fss_basic_read.c build_sources_program main.c build_sources_headers fss_basic_read.h diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 27cb99b..edf47ab 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_basic_write.c build_sources_program main.c build_sources_headers fss_basic_write.h diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index 538361a..cefe159 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c build_sources_program main.c build_sources_headers fss_extended_list_read.h diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 54bc245..6e19053 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_extended_read.c private-fss_extended_read.c build_sources_program main.c build_sources_headers fss_extended_read.h diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index d49ec12..c55032e 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_extended_write.c build_sources_program main.c build_sources_headers fss_extended_write.h diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 0112eb7..adacf39 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfll_status -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_pipe -lf_file -lf_conversion -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library fss_status_code.c private-fss_status_code.c build_sources_program main.c build_sources_headers fss_status_code.h diff --git a/level_3/init/data/build/settings b/level_3/init/data/build/settings index cc3d8cd..6153265 100644 --- a/level_3/init/data/build/settings +++ b/level_3/init/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_file -lf_utf -lf_print -lf_pipe -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library init.c private-init.c build_sources_program main.c build_sources_headers init.h diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 1c5f836..6409f98 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -11,8 +11,8 @@ build_compiler gcc build_linker ar build_libraries -lc build_libraries_fll -lfll_status -lfll_program -lfl_utf -lfl_string -lfl_status -lfl_file -lfl_console -lfl_color -lf_utf -lf_print -lf_pipe -lf_file -lf_conversion -lf_console -lf_memory -#build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 -#build_libraries_fll-monolithic -lfll +build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 +build_libraries_fll-monolithic -lfll build_sources_library status_code.c private-status_code.c build_sources_program main.c build_sources_headers status_code.h -- 1.8.3.1