diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -4,7 +4,23 @@ cc="gcc" ld="gcc" ar="ar" -cflags="-std=c99 -fPIC -Wall -Wno-unused-function -Wextra -g -Wno-error -pedantic -lm -ffast-math" +config=${1,-"deb"} + +cflags=" -std=c99" + +cflags+=" -Wall" +cflags+=" -Wno-unused-function" +cflags+=" -Wextra" +cflags+=" -Wno-error" +cflags+=" -pedantic" + +cflags+=" -fPIC -ffast-math -lm" + +if [ "$config" == "rel" ]; then + cflags+=" -s -O3" +else + cflags+=" -g -Og" +fi proc=$(nproc) @@ -18,6 +34,16 @@ mkdir ./lib/ mkdir ./bin/ mkdir ./obj/ + +if [ "$config" == "deps" ]; then + pushd deps/zlib-1.3.1 + bash ./configure + make -j $proc all + sudo make install + make clean + popd +fi + echo "[BUILD] ungrateful.c" $cc $cflags \ @@ -32,7 +58,7 @@ echo "[BUILD] cynic.c" $cc $cflags -Isrc/ \ -c -o obj/cynic.o \ - -g src/cynic.c + -g src/cynic.c -lz if [[ $? -ne 0 ]]; then exit |