micro-utils/build.sh

37 lines
734 B
Bash
Raw Normal View History

2024-07-01 10:23:00 +00:00
#!/bin/sh
if [ -z $PROJECT_DIR ]; then
PROJECT_DIR=$(pwd)
fi
if [ -z $CFLAGS ]; then
CFLAGS="-pedantic -s -Os -Wall -Wextra -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_BSD_SOURCE"
fi
if [ -z $CC ]; then
CC=cc
fi
if [ -z $projects ]; then
projects="editors sysutils-linux init console-tools coreutils findutils networking loginutils procps"
fi
#Compile
for project in $projects; do
echo "Chdir" $project
for p in src/$project/*; do
echo " * Makeing" $p
for i in $p; do
cd $PROJECT_DIR/$i
echo " * Compile" $i
chmod -v +x build.sh
env CC=$CC CFLAGS="$CFLAGS -I$PROJECT_DIR -I$PROJECT_DIR/include/libmu" OUTPUT="$PROJECT_DIR"/bin/ ./build.sh
cd $PROJECT_DIR
done
echo -ne "\n"
done
done
chmod -vR a+x bin/