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>
Tue, 1 Dec 2020 09:59:21 +0000 (09:59 +0000)
Origin: Debian
Last-Update: 2020-10-27

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

Makefile

index fd91c1dcc3dfb8d7a4fc6b9950d8c7ae642ce601..9e64fd73655f70a4b7c7153b6b245877dbe5a87a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -140,6 +140,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
@@ -1110,11 +1111,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.