From ae249d8e72174f9bcb62ddd6627b8d63041aa240 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Fri, 2 Sep 2016 14:09:03 +0100 Subject: [PATCH] Add missing CPPFLAGS and LDFLAGS Origin: Debian Last-Update: 2016-05-20 Last-Update: 2016-05-20 Gbp-Pq: Name 0006-add-CPPFLAGS-LDFLAGS.patch --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6fb34b1..4a8e1c3 100644 --- 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. -- 2.30.2