mirror of
https://github.com/janet-lang/janet
synced 2025-04-25 12:13:15 +00:00
22 lines
429 B
Bash
Executable File
22 lines
429 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
case "$2" in
|
|
c)
|
|
rm temp.bin temp.o temp.nasm
|
|
valgrind build/janet "$@" > temp.c
|
|
gcc -nostdlib temp.c -c temp.o
|
|
;;
|
|
x64)
|
|
rm temp.bin temp.o temp.nasm
|
|
valgrind build/janet "$@" > temp.nasm
|
|
nasm -felf64 temp.nasm -l temp.lst -o temp.o
|
|
;;
|
|
*)
|
|
echo "Unknown mode $2"
|
|
exit
|
|
;;
|
|
esac
|
|
|
|
ld -o temp.bin -dynamic-linker /lib64/ld-linux-x86-64.so.2 -lc temp.o
|
|
valgrind ./temp.bin
|