diff --git a/compile b/compile index 9a557f4..22d5846 100755 --- a/compile +++ b/compile @@ -30,6 +30,11 @@ SRC="\ TEST_SRC="\ $(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ") \ " +BUILD_DIR="libwapp-build/posix-$BUILD_TYPE" +if [[ -d $BUILD_DIR ]]; then + rm -rf $BUILD_DIR +fi +mkdir -p $BUILD_DIR if [[ $BUILD_TYPE == "release" ]]; then CFLAGS+="-O3" @@ -37,8 +42,8 @@ else CFLAGS+="-g -fsanitize=address -fsanitize=undefined" fi -OUT="libwapp.so" -TEST_OUT="./wapptest" +OUT="$BUILD_DIR/libwapp.so" +TEST_OUT="$BUILD_DIR/wapptest" # Compile tests if [[ $(echo $TEST_SRC | xargs) != "" ]]; then