From 5808f00555c48e1cc1cc110af6a5cd73ddf13010 Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Fri, 2 May 2025 23:15:47 +0200 Subject: cleanup and rewrite of ppu_registers.c --- build.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 1e88141..02d50d3 100755 --- a/build.sh +++ b/build.sh @@ -3,12 +3,13 @@ # Set the project name here PROJECT_NAME="mknes" # Change this for each new project +CC=gcc-14 + # Base configuration common to all builds CFLAGS="-std=gnu11 -mtune=generic " -CFLAGS+="-mbmi2 " -CFLAGS+="-mfunction-return=keep " -CFLAGS+="-mindirect-branch=keep " -CFLAGS+="-fwrapv -ffast-math -fno-trapping-math -fwhole-program -fvisibility=hidden " +CFLAGS+="-mbmi -mbmi2 " +CFLAGS+="-mfunction-return=keep -mindirect-branch=keep " +CFLAGS+="-fwrapv -ffast-math -fno-trapping-math -fvisibility=hidden " CFLAGS+="-fno-stack-protector -fno-PIE -no-pie -fno-strict-aliasing -fcf-protection=none -ffunction-sections -fdata-sections " # CFLAGS+="-fno-exceptions -fno-rtti -fno-use-cxa-atexit " CFLAGS+="-fno-non-call-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables " @@ -47,7 +48,7 @@ case "$BUILD_TYPE" in CFLAGS+=" -s -Wl,--strip-all -O2" ;; "profile") - CFLAGS+=" -g -O2 -fprofile-generate" + CFLAGS+=" -g -O2 -fprofile-generate -ftest-coverage" ;; "profile_release") CFLAGS+=" -s -Wl,--strip-all -O2 -fprofile-use" @@ -56,6 +57,15 @@ case "$BUILD_TYPE" in CFLAGS+=" -g -O0" LDFLAGS+=" -fno-pie -no-pie" ;; + "coverage") + gcov -b -c *.c + exit 0 + ;; + + "clean") + rm -f *.gcda *.gcno *.gcov + exit 0 + ;; *) echo "Unknown build type: $BUILD_TYPE" exit 1 @@ -72,7 +82,7 @@ set -e # Build Linux version ( # ../bin/ctime -begin .${PROJECT_NAME}_linux - gcc $CFLAGS ${PROJECT_NAME}.c -o ${PROJECT_NAME} $INCLUDE_PATHS $LINUX_INCLUDE $LDFLAGS $LINUX_LIBS + $CC $CFLAGS ${PROJECT_NAME}.c -o ${PROJECT_NAME} $INCLUDE_PATHS $LINUX_INCLUDE $LDFLAGS $LINUX_LIBS # ../bin/ctime -end .${PROJECT_NAME}_linux $? ) & -- cgit v1.2.3