summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
Diffstat (limited to 'project')
-rwxr-xr-xproject29
1 files changed, 29 insertions, 0 deletions
diff --git a/project b/project
new file mode 100755
index 0000000..c1daf50
--- /dev/null
+++ b/project
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+project_name="atui"
+
+function compile(){
+ if [ ! -d build ]; then
+ if [ $(mkdir build) ]; then # if error
+ echo "cannot make 'build' dir"
+ exit
+ fi
+ fi
+
+ gcc -Wall -Wextra -O3 src/main.c src/ui/tui.c -o "build/$project_name"
+}
+
+function run(){
+ compile && "./build/$project_name" "$@"
+ echo
+ echo "$?"
+}
+
+function clear(){
+ rm -r ./build/
+}
+
+function_name="$1"
+shift
+
+$function_name "$@"