From 9123449734f43922fe39cdb08c3d60f02f0eb3ed Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 21 May 2018 13:04:04 -0700 Subject: [PATCH] Makefile.inc: Export CCACHE_EXTRAFILES and add __BUILD_DIR__ definition This patch adds the CCACHE_EXTRAFILES variable to the list of exported environment variables, which can be useful as a target-specific variable to make ccache aware of extra dependencies that it cannot figure out on its own. It also adds a CPPFLAGS parameter to define the __BUILD_DIR__ constant for the preprocessor so that the current output build directory can be referenced in C code if necessary. Change-Id: I4fdd08842972cfed8ef5e5a61ebf859c0571bcfb Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/26451 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- Makefile.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.inc b/Makefile.inc index fcdc72ccce..c40cec8842 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -60,6 +60,10 @@ COREBOOT_EXPORTS += objcbfs objgenerated := $(obj)/generated COREBOOT_EXPORTS += objgenerated +## CCACHE_EXTRAFILES can be set by individual rules to help CCACHE +## discover dependencies it might not notice on its own (e.g. asm (".incbin")). +COREBOOT_EXPORTS += CCACHE_EXTRAFILES + ####################################################################### # root rule to resolve if in build mode (ie. configuration exists) real-target: $(obj)/config.h coreboot files_added @@ -380,6 +384,7 @@ VBOOT_SOURCE ?= 3rdparty/vboot CPPFLAGS_common += -I$(VBOOT_SOURCE)/firmware/include CPPFLAGS_common += -include $(src)/include/kconfig.h CPPFLAGS_common += -I3rdparty +CPPFLAGS_common += -D__BUILD_DIR__=\"$(obj)\" CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes