Debug options for user apps and libs

This commit is contained in:
2026-03-06 00:17:08 +01:00
parent d7dc141874
commit f725beb433
2 changed files with 34 additions and 19 deletions

View File

@@ -5,9 +5,15 @@ cflags += -nostdinc \
-std=c11 \
-pedantic \
-Wall \
-Wextra \
-ffunction-sections \
-fdata-sections
-Wextra
ifeq ($(buildtype),debug)
cflags += -O0 -g
endif
ifeq ($(buildtype),release)
cflags += -ffunction-sections -fdata-sections -Oz
endif
cflags += -isystem ../include
@@ -15,6 +21,14 @@ ldflags += -ffreestanding \
-nostdlib \
-fno-builtin \
-fuse-ld=lld \
-static \
-Wl,--gc-sections \
-flto
-static
ifeq ($(buildtype),debug)
ldflags += -g
endif
ifeq ($(buildtype),release)
ldflags += -Wl,--gc-sections \
-Wl,--strip-all \
-flto
endif