fixed build.sh
This commit is contained in:
parent
0737916f1a
commit
500bbb02ea
1
TODO
1
TODO
@ -49,6 +49,5 @@ BUGS:
|
||||
xargs (getopt with glibc)
|
||||
|
||||
FIX:
|
||||
ps (proc_parser.h)
|
||||
echo (escape)
|
||||
que (unicode)
|
||||
|
20
build.sh
20
build.sh
@ -1,11 +1,23 @@
|
||||
#!/bin/sh
|
||||
CFLAGS="-s -Os -Wextra -Wall -pedantic"
|
||||
CC="cc"
|
||||
./clean.sh
|
||||
|
||||
if [ -z $CC ]; then
|
||||
CC="cc"
|
||||
fi
|
||||
|
||||
if [ -z $CFLAGS ]; then
|
||||
CFLAGS="-s -Os -Wextra -Wall -pedantic"
|
||||
fi
|
||||
|
||||
chmod +x ./libmu/build-libmu.sh
|
||||
./libmu/build-libmu.sh
|
||||
|
||||
for i in $(ls src); do
|
||||
if [[ $1 == "box" ]]; then
|
||||
env CC="$CC" CFLAGS="$CFLAGS" ./scripts/build-box.sh
|
||||
|
||||
else
|
||||
for i in $(ls src); do
|
||||
echo "CC $i"
|
||||
echo $CFLAGS | xargs $CC -Iconfigs -Ilibmu src/$i -o bin/$(basename $i .c) obj/*.o
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
@ -1,10 +1,4 @@
|
||||
#!/bin/sh
|
||||
CFLAGS="-s -Os -Wextra -Wall -pedantic"
|
||||
CC="cc"
|
||||
|
||||
chmod +x ./libmu/build-libmu.sh
|
||||
./libmu/build-libmu.sh
|
||||
|
||||
cat > mutils.c << EOF
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -18,15 +12,15 @@ struct cmd {
|
||||
int (*func)(int argc, char **argv);
|
||||
const char *str;
|
||||
} cmds[] = {
|
||||
$(for i in $(ls src); do
|
||||
$(for i in $(ls src); do
|
||||
f=$(basename $i .c)
|
||||
|
||||
#EDIT SOURCES
|
||||
cat src/$i | sed "s/main(/"$f"_main(/g" > bin/$i
|
||||
|
||||
#MAKE STRUCTURE
|
||||
#FILL STRUCTURE
|
||||
echo -e "\t{"$f"_main, \"$f\"},"
|
||||
done)
|
||||
done)
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
@ -47,4 +41,4 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
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
|
@ -13,7 +13,6 @@ static size_t r_size;
|
||||
|
||||
static char i_flag;
|
||||
static char F_flag;
|
||||
static char E_flag;
|
||||
static char H_flag;
|
||||
|
||||
static int addpattern(char *str) {
|
||||
|
Loading…
Reference in New Issue
Block a user