From cae86313c671009a9a31f4ba19a533da6d6af1b8 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 2 Sep 2021 18:52:05 -0700 Subject: [PATCH] rename examples build/run scripts --- bin/build_examples.sh | 21 +++++++++++++++++++++ bin/run_examples.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 bin/build_examples.sh create mode 100644 bin/run_examples.sh diff --git a/bin/build_examples.sh b/bin/build_examples.sh new file mode 100644 index 0000000..29a8413 --- /dev/null +++ b/bin/build_examples.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +###### Get Paths ############################################################## +og_path=$PWD +cd "$(dirname "$0")" +cd .. + +###### Script ################################################################# +echo "~~~ Build All Exampes ~~~" +bin/bld_core.sh show_ctx + +bin/bld_core.sh unit old_style_custom_layer examples/old_style_custom_layer.c +bin/bld_core.sh unit output_parse examples/output_parse/output_parse.c +bin/bld_core.sh unit c_code_generation examples/c_code_generation.c +bin/bld_core.sh unit node_errors examples/node_errors/node_errors.c +bin/bld_core.sh unit parse_check examples/parse_check.c + +echo + +###### Restore Path ########################################################### +cd $og_path diff --git a/bin/run_examples.sh b/bin/run_examples.sh new file mode 100644 index 0000000..3f2b967 --- /dev/null +++ b/bin/run_examples.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +###### Get Paths ############################################################## +og_path=$PWD +cd "$(dirname "$0")" +cd .. + root_path=$PWD + build_path=$root_path/build +examples_path=$root_path/examples + +echo ~~~ Running Output Parse Example ~~~ +cd $examples_path +if [ -d "output_parse/examples" ]; then + cd output_parse/examples + mkdir -p output + cd output + $build_path/output_parse.exe ../example.mdesk ../example2.mdesk +fi +echo + +echo ~~~ Running C Code Generation Example ~~~ +cd $build_path +./c_code_generation.exe +echo + +echo ~~~ Running Error Generation Example ~~~ +cd $build_path +./node_errors.exe $examples_path/node_errors/node_errors.mdesk +echo + +echo ~~~ Running C++ Example ~~~ +cd $build_path +./cpp_build_test.exe +echo + +###### Restore Path ########################################################### +cd $og_path