Add missing CPPFLAGS and LDFLAGS
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Tue, 6 Feb 2018 15:29:11 +0000 (15:29 +0000)
committerRaphaël Hertzog <hertzog@debian.org>
Tue, 6 Feb 2018 15:29:11 +0000 (15:29 +0000)
Origin: Debian
Last-Update: 2016-05-20

Last-Update: 2016-05-20
Gbp-Pq: Name 0006-add-CPPFLAGS-LDFLAGS.patch

Makefile

index f706abb5299a1cdbc9af92e83864ef0dff700814..e8dfdc821f2fc03fc7ac0cb095efd8b5185f4c82 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -145,6 +145,7 @@ COMMON_FLAGS := -nostdinc -pipe \
        -ffreestanding -fno-builtin -fno-stack-protector \
        -Wall -Wstrict-prototypes ${DEBUG_FLAGS}
 
+CFLAGS += $(CPPFLAGS)
 # Note: FIRMWARE_ARCH is defined by the Chromium OS ebuild.
 ifeq (${FIRMWARE_ARCH}, arm)
 CC ?= armv7a-cros-linux-gnueabi-gcc
@@ -1215,28 +1216,28 @@ ${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 $@ $<
 
 # Rules to recompile a single source file for library and test
 # TODO: is there a tidier way to do this?
 ${BUILD}/%_for_lib.o: CFLAGS += -DFOR_LIBRARY
 ${BUILD}/%_for_lib.o: %.c
        @${PRINTF} "    CC-for-lib    $(subst ${BUILD}/,,$@)\n"
-       ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+       ${Q}${CC} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c -o $@ $<
 
 ${BUILD}/%_for_test.o: CFLAGS += -DFOR_TEST
 ${BUILD}/%_for_test.o: %.c
        @${PRINTF} "    CC-for-test   $(subst ${BUILD}/,,$@)\n"
-       ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+       ${Q}${CC} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c -o $@ $<
 
 # TODO: C++ files don't belong in vboot reference at all.  Convert to C.
 ${BUILD}/%.o: %.cc
        @${PRINTF} "    CXX           $(subst ${BUILD}/,,$@)\n"
-       ${Q}${CXX} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+       ${Q}${CXX} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c -o $@ $<
 
 # ----------------------------------------------------------------------------
 # Here are the special tweaks to the generic rules.