about summary refs log tree commit diff
path: root/build.sh
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-07-20 02:54:22 +0200
committerYour Name <you@example.com>2020-07-20 02:54:22 +0200
commitc69f053c29faa47d0600f5b147835e970d9cf654 (patch)
treed97af2f279114c72c3db81ffb489c316fb3f6dd6 /build.sh
downloadAARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.tar.gz
AARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.tar.bz2
AARM64-Disassembler-c69f053c29faa47d0600f5b147835e970d9cf654.zip
Initial Commit HEAD master
Half-added some basic AARM64 instructions such as ADD, RET, MOV, NOP...
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