fixed build.sh

This commit is contained in:
Your Name 2024-07-13 14:43:49 +03:00
parent 0737916f1a
commit 500bbb02ea
4 changed files with 26 additions and 22 deletions

1
TODO
View File

@ -49,6 +49,5 @@ BUGS:
xargs (getopt with glibc) xargs (getopt with glibc)
FIX: FIX:
ps (proc_parser.h)
echo (escape) echo (escape)
que (unicode) que (unicode)

View File

@ -1,11 +1,23 @@
#!/bin/sh #!/bin/sh
CFLAGS="-s -Os -Wextra -Wall -pedantic" ./clean.sh
if [ -z $CC ]; then
CC="cc" CC="cc"
fi
if [ -z $CFLAGS ]; then
CFLAGS="-s -Os -Wextra -Wall -pedantic"
fi
chmod +x ./libmu/build-libmu.sh chmod +x ./libmu/build-libmu.sh
./libmu/build-libmu.sh ./libmu/build-libmu.sh
if [[ $1 == "box" ]]; then
env CC="$CC" CFLAGS="$CFLAGS" ./scripts/build-box.sh
else
for i in $(ls src); do for i in $(ls src); do
echo "CC $i" echo "CC $i"
echo $CFLAGS | xargs $CC -Iconfigs -Ilibmu src/$i -o bin/$(basename $i .c) obj/*.o echo $CFLAGS | xargs $CC -Iconfigs -Ilibmu src/$i -o bin/$(basename $i .c) obj/*.o
done done
fi

View File

@ -1,10 +1,4 @@
#!/bin/sh #!/bin/sh
CFLAGS="-s -Os -Wextra -Wall -pedantic"
CC="cc"
chmod +x ./libmu/build-libmu.sh
./libmu/build-libmu.sh
cat > mutils.c << EOF cat > mutils.c << EOF
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -24,7 +18,7 @@ $(for i in $(ls src); do
#EDIT SOURCES #EDIT SOURCES
cat src/$i | sed "s/main(/"$f"_main(/g" > bin/$i cat src/$i | sed "s/main(/"$f"_main(/g" > bin/$i
#MAKE STRUCTURE #FILL STRUCTURE
echo -e "\t{"$f"_main, \"$f\"}," echo -e "\t{"$f"_main, \"$f\"},"
done) done)
}; };
@ -47,4 +41,4 @@ int main(int argc, char **argv) {
} }
EOF EOF
echo $CFLAGS | xargs $CC -Iconfigs -Ilibmu bin/*.c obj/*.o mutils.c -omutils echo $CFLAGS | xargs $CC -Iconfigs -Ilibmu mutils.c obj/*.o bin/*.c -o mutils

View File

@ -13,7 +13,6 @@ static size_t r_size;
static char i_flag; static char i_flag;
static char F_flag; static char F_flag;
static char E_flag;
static char H_flag; static char H_flag;
static int addpattern(char *str) { static int addpattern(char *str) {