[PATCH] build: initilize empty MCFLAGS and LDFLAGS
Bertrand Jacquin
bertrand at jacquin.bzh
Sat Apr 25 16:15:00 CEST 2020
Such variables are modified later, it make it clearer to read when
variable are only appened
---
rules.mk | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/rules.mk b/rules.mk
index 110079efdaaa..3915268418d4 100644
--- a/rules.mk
+++ b/rules.mk
@@ -50,14 +50,17 @@ IINCDIR = $(patsubst %,-I%,$(INCDIR))
LLIBDIR = $(patsubst %,-L%,$(LIBDIR))
VPATH = $(sort $(dir $(CSRC)))
+
+# Initilize empty LDFLAGS and MCFLAGS
+MCFLAGS =
+LDFLAGS =
+
###
ifeq ($(EMULATION),)
-MCFLAGS = -mcpu=$(MCU)
-LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \
+MCFLAGS += -mcpu=$(MCU)
+LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \
-Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections
else
-MCFLAGS =
-LDFLAGS =
DEFS += -D_GNU_SOURCE
endif
More information about the Gnuk-users
mailing list