MineSwepperASM/compile.sh

22 lines
539 B
Bash
Executable File

echo ">>> Compiling ASM code..."
nasm -f macho64 -o ./bin/obj/main.o ./src/main.asm
if [ $? -ne 0 ]; then
echo " >> Error: Assembly failed."
exit 1
fi
echo ">>> Building executable..."
ld -macos_version_min 10.7 -o ./bin/main ./bin/obj/main.o -lSystem -syslibroot `xcrun --show-sdk-path`
if [ $? -ne 0 ]; then
echo " >> Error: Compilation failed."
exit 1
fi
echo ">>> Cleaning up..."
rm ./bin/obj/main.o
if [ $? -ne 0 ]; then
echo " >> Error: Cleanup failed."
exit 1
fi
echo ">>> ASM code compiled successfully."