#!/bin/sh set -e DEBUG_FLAGS="" LIB="-Ilibs/socket" mkdir -p bin mkdir -p obj while getopts "df" opt; do case "$opt" in d) DEBUG_FLAGS="-Wall -fsanitize=address -g" ;; f) DEBUG_FLAGS="-Wall -fsanitize=thread -g" ;; esac done shift $((OPTIND-1)) [ "${1:-}" = "--" ] && shift printf "\n\nmaking project\n" clang -O3 -Ilibs/socket -c libs/socket/socket_server.c -o obj/socket_server.o clang -O3 obj/socket_server.o -o bin/socket src/main.c $LIB $DEBUG_FLAGS -lm clang -o bin/client src/client.c $LIB $DEBUG_FLAGS -lm clang -o bin/client-polled src/client-polled.c $LIB $DEBUG_FLAGS -lm