2023-07-22 14:30:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
[ ! -d "lib" ] && mkdir "lib"
|
|
|
|
[ ! -d "bin" ] && mkdir "bin"
|
|
|
|
|
2023-07-23 07:19:53 +00:00
|
|
|
[ "$1" != "-shared" ] && echo "static"
|
|
|
|
|
2023-07-22 14:30:04 +00:00
|
|
|
nasm -f elf64 "src/linux/crt_entry.asm" -o "bin/crt_entry.o"
|
|
|
|
clang -fPIC -nostdlib -I "include" -g "src/linux/crt_ctors.c" -c -o "bin/crt_ctors.o"
|
|
|
|
clang -fPIC -nostdlib -I "include" -g "src/ciabatta.c" -c -o "bin/ciabatta.o"
|
|
|
|
|
2023-07-23 07:19:53 +00:00
|
|
|
# Create a test executable
|
|
|
|
clang -pie -nostdlib -Iinclude \
|
|
|
|
tests/empty.c bin/ciabatta.o bin/crt_ctors.o bin/crt_entry.o
|