Add missing CPPFLAGS and LDFLAGS
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Mon, 10 Feb 2020 15:21:52 +0000 (16:21 +0100)
committerSophie Brun <sophie@offensive-security.com>
Mon, 18 Jul 2022 09:08:11 +0000 (10:08 +0100)
Origin: Debian
Last-Update: 2020-10-27

Gbp-Pq: Name 0006-add-CPPFLAGS-LDFLAGS.patch

Makefile

index 218437f34e1a79717593b73f1b9afa8a0e9b08fa..acb379d0ede29eeddc55f8608cf8be889f08786c 100644 (file)
--- 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
@@ -1137,11 +1138,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.