Debug options for user apps and libs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user