From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Date: Mon, 10 Feb 2020 16:21:52 +0100
Subject: Add missing CPPFLAGS and LDFLAGS

Origin: Debian
Last-Update: 2020-10-27
---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 95f2e5a..787fcf9 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,7 @@ COMMON_FLAGS := -pipe ${WERROR} -Wall -Wstrict-prototypes -Wtype-limits \
 
 # FIRMWARE_ARCH is defined if compiling for a firmware target
 # (coreboot or depthcharge).
+CFLAGS += $(CPPFLAGS)
 ifeq (${FIRMWARE_ARCH},arm)
 CC ?= armv7a-cros-linux-gnueabihf-gcc
 CFLAGS ?= -march=armv5 -fno-common -ffixed-r8 -mfloat-abi=hard -marm
@@ -1150,11 +1151,11 @@ ${BUILD}/%: ${BUILD}/%.o ${OBJS} ${LIBS}
 
 ${BUILD}/%.o: %.c
 	@${PRINTF} "    CC            $(subst ${BUILD}/,,$@)\n"
-	${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+	${Q}${CC} ${CFLAGS} ${LDFLAGS}  ${INCLUDES} -c -o $@ $<
 
 ${BUILD}/%.o: ${BUILD}/%.c
 	@${PRINTF} "    CC            $(subst ${BUILD}/,,$@)\n"
-	${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+	${Q}${CC} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c -o $@ $<
 
 # ----------------------------------------------------------------------------
 # Here are the special tweaks to the generic rules.
