2023-10-23 13:21:17 +03:00
|
|
|
#!/bin/sh
|
|
|
|
if [ -z $CC ]; then
|
|
|
|
CC=cc
|
|
|
|
fi
|
|
|
|
if [ -z $CFLAGS ]; then
|
|
|
|
CFLAGS="-s -Os -pedantic -Wall -Wextra"
|
|
|
|
fi
|
2023-10-23 13:22:52 +03:00
|
|
|
if [ -z $1 ]; then
|
|
|
|
echo $0 "[rootfs / clean]"
|
|
|
|
exit
|
|
|
|
fi
|
2023-10-23 13:21:17 +03:00
|
|
|
|
|
|
|
echo "ENV: CC: " $CC "| CFLAGS: " $CFLAGS
|
|
|
|
|
|
|
|
if [ $1 = "clean" ]; then
|
|
|
|
rm bin/*
|
|
|
|
elif [ $1 = "rootfs" ]; then
|
|
|
|
applets="coreutils/* miscutils/* console-tools/* networking/*"
|
|
|
|
for i in $applets; do
|
|
|
|
echo CC $i
|
|
|
|
$CC $CFLAGS $i -o $(echo bin/$(basename $i .c))
|
|
|
|
done
|
|
|
|
else
|
|
|
|
echo $0 "[rootfs / clean]"
|
|
|
|
fi
|