diff options
-rwxr-xr-x | build.sh | 30 | ||||
-rw-r--r-- | deps/zlib-1.3.1/.gitignore | 6 | ||||
-rw-r--r-- | deps/zlib-1.3.1/Makefile | 5 |
3 files changed, 34 insertions, 7 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 diff --git a/deps/zlib-1.3.1/.gitignore b/deps/zlib-1.3.1/.gitignore index 567609b..bd39d93 100644 --- a/deps/zlib-1.3.1/.gitignore +++ b/deps/zlib-1.3.1/.gitignore @@ -1 +1,7 @@ build/ + +configure.log +zconf.h +zlib.pc + +Makefile diff --git a/deps/zlib-1.3.1/Makefile b/deps/zlib-1.3.1/Makefile deleted file mode 100644 index 6bba86c..0000000 --- a/deps/zlib-1.3.1/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - -@echo "Please use ./configure first. Thank you." - -distclean: - make -f Makefile.in distclean |