From 19efb08a3afeddbba8dcaf6f6415ab38631da7da Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 23 Feb 2025 15:32:13 +0000 Subject: [PATCH] Add platform detection to posix compilation script --- compile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compile b/compile index e3c90a2..ad1cdb8 100755 --- a/compile +++ b/compile @@ -35,6 +35,9 @@ done CC=clang CFLAGS="-Wall -Wextra -Werror -pedantic" LIBFLAGS="-fPIC -shared" +KERNEL="$(uname -s)" +MACHINE="$(uname -m)" +PLATFORM="${KERNEL}_${MACHINE}" if [[ $CC == "gcc" ]]; then # Used to disable the "ASan runtime does not come first in initial library list" error when compiling with gcc @@ -66,7 +69,7 @@ esac TEST_INCLUDE="$(find tests -type d | xargs -I{} echo -n "-I{} ")" TEST_SRC="$(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ")" -BUILD_DIR="libwapp-build/posix-$BUILD_TYPE" +BUILD_DIR="libwapp-build/$PLATFORM-$BUILD_TYPE" if [[ -d $BUILD_DIR ]]; then rm -rf $BUILD_DIR fi