remove .so
[vg.git] / vg_build.sh
index 9ea78676d0d815676c5a6341bc95cc64cfe1232a..70913c74128e25693059ebdaf6f95fdfa1020d0f 100644 (file)
@@ -1,8 +1,36 @@
 #!/bin/bash
 # Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved
-
+#
+# Build script utilities
+# Usage:
+#  1) in your build script, define the function
+#
+#   vg_command(){
+#      
+#   }
+#  
+#  it should handle $1 as the switch for different commands
+#  if you want to run an existing command, use run_command <x> to do it.
+#
+#
+#  2) at the end of the build script, include:
+#
+#   source vg/vg_build.sh
+#
+#  this runs the triggers that are passed in from the invoker
+#
+#  
+#  3) targets with standard tool support should run the command:
+#
+#    vg_compile_tools
+#
+#  make sure _compiler _options, and _ext are setup for that target
+#  these will only invoke the tooling compilers if tools is passed to the 
+#  build script.
+#
 # Util
 # ==============================================================================
+
 error(){
     echo -e "\033[1;31mError:\e[0m $@"
     exit 1
@@ -40,8 +68,6 @@ if ! [ -x "$( command -v $compiler_cache )" ]; then
 fi
 
 compile_x(){
-   mkdir $_folder -p
-
    cmd="$compiler_cache $_compiler 
         $_options
         $_warnings
@@ -70,16 +96,25 @@ vg_compile_tools() {
    if [ $enable_tools = true ]; then source vg/src/tools.sh; fi
 }
 
-tools() {
-   enable_tools=true
+run_command(){
+   case "$1" in
+      tools)
+         enable_tools=true
+      ;;
+      "")
+         return
+      ;;
+      *)
+         vg_command $1
+   esac
 }
 
-$1
-$2
-$3
-$4
-$5
-$6
-$7
-$8
-$9
+run_command $1
+run_command $2
+run_command $3
+run_command $4
+run_command $5
+run_command $6
+run_command $7
+run_command $8
+run_command $9