]> Kevux Git Server - fll/commitdiff
Update: implement bash support in generate.sh
authorKevin Day <thekevinday@gmail.com>
Fri, 9 Aug 2019 00:41:12 +0000 (19:41 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 9 Aug 2019 00:55:23 +0000 (19:55 -0500)
The generate script now supports handling bash scripts.

35 files changed:
build/scripts/generate.sh
level_0/f_colors/data/build/settings
level_0/f_console/data/build/settings
level_0/f_conversion/data/build/settings
level_0/f_errors/data/build/settings
level_0/f_file/data/build/settings
level_0/f_fss/data/build/settings
level_0/f_memory/data/build/settings
level_0/f_paths/data/build/settings
level_0/f_pipe/data/build/settings
level_0/f_print/data/build/settings
level_0/f_serialized/data/build/settings
level_0/f_strings/data/build/settings
level_0/f_types/data/build/settings
level_1/fl_colors/data/build/settings
level_1/fl_console/data/build/settings
level_1/fl_directory/data/build/settings
level_1/fl_errors/data/build/settings
level_1/fl_file/data/build/settings
level_1/fl_fss/data/build/settings
level_1/fl_serialized/data/build/settings
level_1/fl_strings/data/build/settings
level_2/fll_colors/data/build/settings
level_2/fll_execute/data/build/settings
level_2/fll_fss/data/build/settings
level_3/firewall/data/build/settings
level_3/fss_basic_list_read/data/build/settings
level_3/fss_basic_list_write/data/build/settings
level_3/fss_basic_read/data/build/settings
level_3/fss_basic_write/data/build/settings
level_3/fss_extended_read/data/build/settings
level_3/fss_extended_write/data/build/settings
level_3/fss_return_code/data/build/settings
level_3/init/data/build/settings
level_3/return_code/data/build/settings

index 989a4964098a993d3adee25976a8469ba234f269..7cc6a5910501dd8a8ad8b2d15ae6706da03cd611 100644 (file)
@@ -37,7 +37,7 @@ generate_main(){
   local path_build_settings=
   local path_c=sources/c/
   local path_settings=data/settings/
-  local path_bash=sources/bash/
+  local path_bash=
   local project_built=
   local work_directory=
   local defines_override=
@@ -134,12 +134,13 @@ generate_main(){
 
   generate_load_settings
 
-  # TODO: enable when bash support is implemented
-  #if [[ ! -d $path_bash ]] ; then
-  #  echo -e "${c_error}ERROR: the bash path of $c_notice$path_bash$c_error is invalid.$c_reset"
-  #  generate_cleanup
-  #  exit 0
-  #fi
+  if [[ $path_bash == "" ]] ; then
+    path_bash=sources/bash/
+  elif [[ ! -d $path_bash ]] ; then
+    echo -e "${c_error}ERROR: the bash path of $c_notice$path_bash$c_error is not a valid directory.$c_reset"
+    generate_cleanup
+    exit 0
+  fi
 
   if [[ $work_directory != "" && ! -d $work_directory ]] ; then
     echo -e "${c_error}ERROR: the work directory $c_notice$work_directory$c_error is not a valid directory.$c_reset"
@@ -251,17 +252,18 @@ generate_id(){
     "build_sources_library") echo -n 9;;
     "build_sources_program") echo -n 10;;
     "build_sources_headers") echo -n 11;;
-    "build_sources_settings") echo -n 12;;
-    "build_shared") echo -n 13;;
-    "build_static") echo -n 14;;
-    "defines_all") echo -n 15;;
-    "defines_shared") echo -n 16;;
-    "defines_static") echo -n 17;;
-    "flags_all") echo -n 18;;
-    "flags_shared") echo -n 19;;
-    "flags_static") echo -n 20;;
-    "flags_library") echo -n 21;;
-    "flags_program") echo -n 22;;
+    "build_sources_bash") echo -n 12;;
+    "build_sources_settings") echo -n 13;;
+    "build_shared") echo -n 14;;
+    "build_static") echo -n 15;;
+    "defines_all") echo -n 16;;
+    "defines_shared") echo -n 17;;
+    "defines_static") echo -n 18;;
+    "flags_all") echo -n 19;;
+    "flags_shared") echo -n 20;;
+    "flags_static") echo -n 21;;
+    "flags_library") echo -n 22;;
+    "flags_program") echo -n 23;;
   esac
 }
 
@@ -300,7 +302,7 @@ generate_prepare_build(){
   local level=${variables[$(generate_id project_level)]}
   local alt=$1
 
-  mkdir -vp ${path_build}{includes,programs/{shared,static},libraries/{shared,static},objects,settings} || failure=1
+  mkdir -vp ${path_build}{includes,programs/{shared,static},libraries/{shared,static},objects,bash,settings} || failure=1
 
   if [[ $failure == "" && $level != "" ]] ; then
     mkdir -vp ${path_build}includes/level_$level || failure=1
@@ -343,6 +345,7 @@ generate_operation_build(){
   local sources_library=${variables[$(generate_id build_sources_library)]}
   local sources_program=${variables[$(generate_id build_sources_program)]}
   local sources_headers=${variables[$(generate_id build_sources_headers)]}
+  local sources_bash=${variables[$(generate_id build_sources_bash)]}
   local sources_settings=${variables[$(generate_id build_sources_settings)]}
   local sources=
   local defines=${variables[$(generate_id defines_all)]}
@@ -489,6 +492,12 @@ generate_operation_build(){
     fi
   fi
 
+  if [[ $failure == "" && $sources_bash != "" ]] ; then
+    for i in $sources_bash ; do
+      cp -vf $path_bash$i ${path_build}bash/ || failure=1
+    done
+  fi
+
   if [[ $failure != "" ]] ; then
     echo -e "${c_error}ERROR: failed to build.$c_reset"
     generate_cleanup
@@ -501,7 +510,7 @@ generate_operation_build(){
 generate_operation_clean(){
   local i=
 
-  for i in ${path_build}{includes,programs,libraries,settings} ; do
+  for i in ${path_build}{includes,programs,libraries,bash,settings} ; do
     if [[ -e $i ]] ; then
       rm -vRf $i
     fi
index eb32c98697f1bbe5161c316fb51147e9a18f6010..a4abe9d3e7120f43aee17ffa0b7bb2012799048e 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers colors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index d63cc7bbacae448feec3827bec9367e85e11aa4a..7250d37cd4ee44e1781715c39cbf0ec935a00b49 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library console.c
 build_sources_program
 build_sources_headers console.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 099ccb7ab2f2957cb11f77b6296d608a38503c7e..bec9cfbef609e5a79c72f419f26bf02e221f9a73 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library conversion.c
 build_sources_program
 build_sources_headers conversion.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 05d27912f65dc0325dd6e73d0b60f8fc010e7585..eaa1fea7864dd2e5679cd2ac6be5fd3ed214b1f6 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers errors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 38a4e541d612ecf573b86d91856ccf950702551c..7c05aa016ae710a9f108bd362ff3dc3458fd9de6 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library file.c
 build_sources_program
 build_sources_headers file.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index adf2f0c9dc50d4ce60eed144107ab24522cc94ed..7c86d6105eebb121356816a228f2fe5226812c0e 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers fss.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 1778145b34dff6a5342870f1d2902ffc947f2e16..99265bfac1ff2bf5b2348cb41d80f621387a3af7 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library memory.c
 build_sources_program
 build_sources_headers memory.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index a6bd3a59ece75ab8f52a828c37553fcd24cdf634..8b0414fba0ed700c51cb387d15d1c2284ae103da 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers fll_paths.h filesystem_paths.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 0fe52af3d277456330cab89827f43e9d362dbf88..00b936a15d0a27149ca7488b8ff54e00b41c8faf 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library pipe.c
 build_sources_program
 build_sources_headers pipe.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 4491e997a4e3fb18c6832d2098e6fdd8cad737b5..aec39adcb97ada85c81cf781f3c5d57dc8573668 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library print.c
 build_sources_program
 build_sources_headers print.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 5e37bd88d90f037c2512aef379e56116046baf53..7044f215c261a2adb718ab89c5a07b6ff3c9e3d3 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers serialized.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 426027092e0d9a184e54e6c25d9e04543203b480..7b1cc489795d56fb0c60fa84d106839a6b7babe6 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers strings.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 256c6fcd3af208a15c7d5677d04b7e2bda89261b..0a830df121e93159820a117654c2bda907f0fb42 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library
 build_sources_program
 build_sources_headers types.h types_array.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 7da62c03b111f22c412f8224c14427400bb39380..49bddddc2f0c3425155ea623b5258f2448b32a82 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory -lf_file
 build_sources_library colors.c
 build_sources_program
 build_sources_headers colors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index fe983eef08e8f51bba68b337f47b72e694bd19ec..1af3ead2547a4600e651f3e69b607d48440a97a6 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory -lf_console
 build_sources_library console.c
 build_sources_program
 build_sources_headers console.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 4d6dc70b2bea0d3f3eb1e9cbe017e9303c03dc3a..687cb9f0bd84dc54d9b9700c9c720c180778e740 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory
 build_sources_library directory.c
 build_sources_program
 build_sources_headers directory.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 2603b2d8d3dfd59c9ded97b3caf5c4f0c4b7e8d7..af38ab86b2ca1efcd277fa41a3edea8443be5572 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll
 build_sources_library errors.c
 build_sources_program
 build_sources_headers errors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index c2276cc56b35c4a842fc7866fae18c814805c150..da76f5887c715745d60ef0c333b33e36d7677ac3 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory -lf_file
 build_sources_library file.c
 build_sources_program
 build_sources_headers file.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index fda1b01a29f25e83f569b8ba99b7dd01aa2b48a0..fce372ec76b0bf6063c6e921448133831b809dd8 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_conversion -lf_file -lf_memory
 build_sources_library fss.c fss_basic.c fss_basic_list.c fss_extended.c
 build_sources_program
 build_sources_headers fss.h fss_basic.h fss_basic_list.h fss_errors.h fss_extended.h fss_macro.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 15f84f5fecc3bfe4572dbfacf8c74d5a6e484b10..191789d3eba3ae2f1400098610afa64b5755ca5b 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory
 build_sources_library serialized.c
 build_sources_program
 build_sources_headers serialized.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index fe1eeecbbfda997d20448f6f7a1dbe7d9a75df18..e7c0d739e8c17cfff19cdb36ff6c32ee7920f752 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory
 build_sources_library strings.c
 build_sources_program
 build_sources_headers strings.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index f3152ce8e4d04dbb42735f4c41a5e300721affa6..592c09b516c2d940a365b96a5c13e4d67e20d352 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lfl_colors -lf_memory
 build_sources_library colors.c
 build_sources_program
 build_sources_headers colors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 53b819340896fec74335f2d06a6a283971e441f3..044da814571cb0ee39dd0995005e04504e612145 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lf_memory
 build_sources_library execute.c
 build_sources_program
 build_sources_headers execute.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 98874c8dbc9eb83925f784d3a2a48f509e8018a9..2155f492d7d33655b7e51a1075a3a85677ce8b38 100644 (file)
@@ -14,6 +14,7 @@ build_libraries_fll -lfl_errors -lfl_fss -lf_conversion -lf_file -lf_memory
 build_sources_library fss_basic.c fss_basic_list.c fss_extended.c fss_errors.c
 build_sources_program
 build_sources_headers fss_basic.h fss_basic_list.h fss_extended.h fss_errors.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index daef26da80f1ec4997aef73db2de9d38207fe8e4..2aa8c5c673a08e2695d3c5ef9489690102d66fc6 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_col
 build_sources_library firewall.c private-firewall.c
 build_sources_program main.c
 build_sources_headers firewall.h
+build_sources_bash
 build_sources_settings default-blacklist default-whitelist example-device-firewall firewall-first firewall-last firewall-other
 build_shared yes
 build_static yes
index a1b2ada2ffe4a3d0ce059411aeafddaf5a09ad85..67234387c1b05ac968f0f307de98611926331261 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_col
 build_sources_library fss_basic_list_read.c
 build_sources_program main.c
 build_sources_headers fss_basic_list_read.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index defe035255385df68e85031ae8b98516ce9d765d..5ecc495a812c571b4fe8477de2699c2ed3f2b51f 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_c
 build_sources_library fss_basic_list_write.c
 build_sources_program main.c
 build_sources_headers fss_basic_list_write.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index be404847524f5e535ecf4b61074d08094ff8f98f..aa875b783b8d545c784dd911266c52e423292ac9 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_col
 build_sources_library fss_basic_read.c
 build_sources_program main.c
 build_sources_headers fss_basic_read.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index 8733b3c29079b340a3be695c47185dc7414d27f4..981f1eead738d838b218e4b96e7a5e3103af65ba 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_c
 build_sources_library fss_basic_write.c
 build_sources_program main.c
 build_sources_headers fss_basic_write.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index dcb9034d688a1c269358e836d565a8d6b1a78366..b9dc516985809901fcad42468235fb8425310d90 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_col
 build_sources_library fss_extended_read.c
 build_sources_program main.c
 build_sources_headers fss_extended_read.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index c1f6cf237862baf90dd6a8abb6b11b6484387756..2b9060ca494c95381f0056ae398acacd12f00eae 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_c
 build_sources_library fss_extended_write.c
 build_sources_program main.c
 build_sources_headers fss_extended_write.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index c65ede078a958c1a9580859638299b6f8a70760b..c8c8b941e7a6498ff69f104f05b2a36b75afa04d 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfl_fss -lfl_errors -lfl_colors -lfl
 build_sources_library fss_return_code.c
 build_sources_program main.c
 build_sources_headers fss_return_code.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index e280e45dbe2b8b9d83fbf6df9f46fda48ebd6884..be55b4e3de139266ff7b1492a548bfe8302972df 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_col
 build_sources_library init.c private-init.c
 build_sources_program main.c
 build_sources_headers init.h
+build_sources_bash
 build_shared yes
 build_static yes
 
index e48a4afba8eba2e82708dd5e842a4978cd261d12..f54f0a814c5a5feca1f45e0f443b3720c7f9599d 100644 (file)
@@ -16,6 +16,7 @@ build_libraries_fll -lfll_colors -lfl_errors -lfl_colors -lfl_console -lf_print
 build_sources_library return_code.c
 build_sources_program main.c
 build_sources_headers return_code.h
+build_sources_bash
 build_shared yes
 build_static yes