diff --git a/flight/Bootloaders/AHRS/Makefile b/flight/Bootloaders/AHRS/Makefile index 2a0a06a2f..d099a610c 100644 --- a/flight/Bootloaders/AHRS/Makefile +++ b/flight/Bootloaders/AHRS/Makefile @@ -237,9 +237,10 @@ CSTANDARD = -std=gnu99 # Flags for C and C++ (arm-elf-gcc/arm-elf-g++) ifeq ($(DEBUG),YES) -CFLAGS = -g$(DEBUGF) +CFLAGS = endif +CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -fdata-sections -ffunction-sections diff --git a/flight/Bootloaders/BootloaderUpdater/Makefile b/flight/Bootloaders/BootloaderUpdater/Makefile index 510a01ff7..fdb496fc3 100644 --- a/flight/Bootloaders/BootloaderUpdater/Makefile +++ b/flight/Bootloaders/BootloaderUpdater/Makefile @@ -267,9 +267,10 @@ CSTANDARD = -std=gnu99 # Flags for C and C++ (arm-elf-gcc/arm-elf-g++) ifeq ($(DEBUG),YES) -CFLAGS = -g$(DEBUGF) -DDEBUG +CFLAGS = -DDEBUG endif +CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections @@ -309,7 +310,7 @@ MATH_LIB = -lm # --cref: add cross reference to map file LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections ifeq ($(DEBUG),NO) -LDFLAGS += -Wl,-static -Wl,-s +LDFLAGS += -Wl,-static endif LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) LDFLAGS += -lc diff --git a/flight/Bootloaders/CopterControl/Makefile b/flight/Bootloaders/CopterControl/Makefile index b906636bc..ae091baae 100644 --- a/flight/Bootloaders/CopterControl/Makefile +++ b/flight/Bootloaders/CopterControl/Makefile @@ -299,9 +299,10 @@ CSTANDARD = -std=gnu99 # Flags for C and C++ (arm-elf-gcc/arm-elf-g++) ifeq ($(DEBUG),YES) -CFLAGS = -g$(DEBUGF) -DDEBUG +CFLAGS += -DDEBUG endif +CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections @@ -341,7 +342,7 @@ MATH_LIB = -lm # --cref: add cross reference to map file LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections ifeq ($(DEBUG),NO) -LDFLAGS += -Wl,-static -Wl,-s +LDFLAGS += -Wl,-static endif LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) LDFLAGS += -lc diff --git a/flight/Bootloaders/OpenPilot/Makefile b/flight/Bootloaders/OpenPilot/Makefile index 27c34a1da..e665fe8d2 100644 --- a/flight/Bootloaders/OpenPilot/Makefile +++ b/flight/Bootloaders/OpenPilot/Makefile @@ -302,9 +302,10 @@ CSTANDARD = -std=gnu99 # Flags for C and C++ (arm-elf-gcc/arm-elf-g++) ifeq ($(DEBUG),YES) -CFLAGS = -g$(DEBUGF) -DDEBUG +CFLAGS = -DDEBUG endif +CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections @@ -344,7 +345,7 @@ MATH_LIB = -lm # --cref: add cross reference to map file LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections ifeq ($(DEBUG),NO) -LDFLAGS += -Wl,-static -Wl,-s +LDFLAGS += -Wl,-static endif LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) LDFLAGS += -lc diff --git a/flight/Bootloaders/PipXtreme/Makefile b/flight/Bootloaders/PipXtreme/Makefile index e5e9fe501..35bca6538 100644 --- a/flight/Bootloaders/PipXtreme/Makefile +++ b/flight/Bootloaders/PipXtreme/Makefile @@ -298,9 +298,10 @@ CSTANDARD = -std=gnu99 # Flags for C and C++ (arm-elf-gcc/arm-elf-g++) ifeq ($(DEBUG),YES) -CFLAGS = -g$(DEBUGF) -DDEBUG +CFLAGS = -DDEBUG endif +CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections @@ -340,7 +341,7 @@ MATH_LIB = -lm # --cref: add cross reference to map file LDFLAGS = -nostartfiles -Wl,-Map=$(OUTDIR)/$(TARGET).map,--cref,--gc-sections ifeq ($(DEBUG),NO) -LDFLAGS += -Wl,-static -Wl,-s +LDFLAGS += -Wl,-static endif LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS)) LDFLAGS += -lc