kfetch/build.sh

26 lines
429 B
Bash
Raw Normal View History

2023-12-28 13:21:23 +00:00
#!/bin/sh
2024-06-07 12:01:35 +00:00
2023-12-28 13:21:23 +00:00
CC=cc
2024-01-03 15:46:17 +00:00
FLAGS="-Os -s -pedantic -Wall -Wextra"
2023-12-28 13:21:23 +00:00
2024-06-07 12:01:35 +00:00
#Test
echo -e "#include <stdio.h>\nint main(void){return 0;}" > file.c
cc file.c -o test
rm file.c
if ! ./test
then
rm test
echo "Install libc-headers and C compiler (ep: tcc, clang, gcc)"
exit 1
fi
rm test
#Compile
2024-01-03 12:09:07 +00:00
$CC -Iinclude -I. src/main.c -c -o main.o &&
$CC -Iinclude -I. src/fetch.c -c -o fetch.o &&
$CC $FLAGS main.o fetch.o -o kfetch &&
2023-12-28 13:21:23 +00:00
rm main.o fetch.o