about summary refs log tree commit diff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..cedaf10
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+out_dir="./bin"
+
+mkdir $out_dir 2> /dev/null
+
+for f in $(find ./src -type f \( -iname \*.cpp -o -iname \*.s \))
+do
+    out_file=$(echo $f | sed 's/.\/src/.\/bin/g' | sed 's/\.cpp/\.o/g' | sed 's/\.s//g')
+    mkdir -p $(dirname $out_file)
+    if [[ $f == *.s ]]
+    then
+        aarch64-linux-gnu-as $f -o $out_file
+    else
+        g++ -g -c $f -o $out_file
+    fi
+done
+
+g++ -o ./bin/disasm $(find ./bin -type f -name "*.o") -lgcc