summaryrefslogtreecommitdiff
path: root/build/compile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/compile.sh')
-rwxr-xr-xbuild/compile.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/build/compile.sh b/build/compile.sh
index efd8962..50b5771 100755
--- a/build/compile.sh
+++ b/build/compile.sh
@@ -1,7 +1,9 @@
#! /bin/sh
-IN=$1
-FILE=$(basename $1)
-gcc -masm=intel -nostartfiles -nostdlib -ffreestanding "$IN".c -o "tmp/$FILE".o
-objcopy -S -R .note.gnu.build-id -R .comment -O binary "tmp/$FILE".o "bim/$FILE".bin
-rm "$IN".o
+INPATH=$1
+INFILE=$(basename $1)
+INFILENAME="${INFILE%.*}"
+INEXT="${INFILE##*.}"
+gcc -m32 -nostartfiles -nostdlib -ffreestanding "$INPATH" -o "tmp/$INFILENAME".o
+objcopy -S -R .note.gnu.build-id -R .comment -O binary "tmp/$INFILENAME".o "bin/$INFILENAME".bin
+rm "tmp/$INFILENAME".o