26 lines
429 B
Bash
Executable File
26 lines
429 B
Bash
Executable File
#!/bin/sh
|
|
|
|
CC=cc
|
|
FLAGS="-Os -s -pedantic -Wall -Wextra"
|
|
|
|
#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
|
|
$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 &&
|
|
rm main.o fetch.o
|