tft create user tree

This commit is contained in:
vrd
2023-02-18 19:04:39 +02:00
parent 4e3816ae15
commit 16894e2983
13 changed files with 46 additions and 11 deletions
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
set -e
if [ "$1" = '' ]
then
echo 'The first argument needs to be the tree file'
exit 1
fi
tree_file="$(realpath "$1")"
start_dir="$PWD"
script_dir="$(dirname $(readlink -f $0))"
cd "$script_dir/src"
language='
-std=c++17
-fno-rtti
-fno-exceptions
-fno-non-call-exceptions
-fno-common'
# force each global variable to be only defined once
warnings='-Wall -Wextra -Wpedantic' #-fanalyzer
cp -f "$tree_file" user_tree.hpp
g++ -o "$start_dir/${1%.*}.tft" $language $warnings -march=native -DNDEBUG -pipe -g *.cpp -lncursesw
rm user_tree.hpp
cd "$start_dir"
exec "./${1%.*}.tft"