piston/packages/nasm/2.15.5/compile

21 lines
478 B
Plaintext
Raw Permalink Normal View History

2021-03-13 13:04:46 +01:00
#!/usr/bin/env bash
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_LANGUAGE}" in
2021-03-13 13:04:46 +01:00
nasm)
2021-03-14 03:11:33 +01:00
nasm -f elf32 -o binary.o "$@"
2021-03-13 13:04:46 +01:00
ld -m elf_i386 binary.o -o binary
;;
nasm64)
2021-03-14 03:11:33 +01:00
nasm -f elf64 -o binary.o "$@"
2021-03-13 13:04:46 +01:00
ld -m elf_x86_64 binary.o -o binary
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
2021-03-13 13:04:46 +01:00
exit 1
;;
esac
chmod +x ./binary