From 90099147cf34336ffd621f35f550e32977b97e2f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Oct 2025 15:24:32 +0200 Subject: checkpoint --- source/build.sh | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'source/build.sh') diff --git a/source/build.sh b/source/build.sh index 317e9a4..e8c89bd 100755 --- a/source/build.sh +++ b/source/build.sh @@ -4,11 +4,47 @@ ScriptDir="$(dirname "$(readlink -f "$0")")" cd "$ScriptDir" BuildDir="$ScriptDir"/../build +CompilerFlags=" +-DIMPORT_ID=1 +" + +WarningFlags=" +-Wall +-Wextra +-Wno-unused-variable +-Wno-unused-parameter +-Wno-unused-but-set-variable +-Wno-maybe-uninitialized +-Wno-sign-compare +" + +Mode="$1" +if [ "$Mode" != "release" ] +then + Mode="debug" +fi +printf '[Mode %s]\n' "$Mode" + +if [ "$Mode" = "debug" ] +then + CompilerFlags="$CompilerFlags + -DDEBUG=1 + -ggdb -g3 + " +elif [ "$Mode" = "release" ] +then + CompilerFlags="$CompilerFlags + -O3 + " +fi + mkdir -p "$BuildDir" + printf 'chatty.c\n' -gcc -DDEBUG -ggdb -Wall -pedantic -std=c11 -I external -o "$BuildDir"/chatty chatty.c +gcc $CompilerFlags $WarningFlags -I external -o "$BuildDir"/chatty chatty.c + printf 'server.c\n' -gcc -DDEBUG -ggdb -Wall -pedantic -std=c99 -o "$BuildDir"/server server.c +gcc $CompilerFlags $WarningFlags -o "$BuildDir"/server server.c # printf 'archived/input_box.c\n' # gcc -DDEBUG -ggdb -Wall -pedantic -std=c11 -I external -I . -o "$BuildDir"/input_box archived/input_box.c -- cgit v1.2.3-70-g09d2