Add missing CPPFLAGS and LDFLAGS
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Fri, 2 Sep 2016 13:09:03 +0000 (14:09 +0100)
committerSophie Brun <sophie@freexian.com>
Fri, 2 Sep 2016 13:09:03 +0000 (14:09 +0100)
Origin: Debian
Last-Update: 2016-05-20

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

Makefile

index 6fb34b1beb9ac35e9e6cd20367c5de3fd53c0fc5..4a8e1c3cc7f93632b5f13e9c1752a17c585403f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -139,6 +139,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
@@ -1220,28 +1221,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.