summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2018-05-21 13:04:04 -0700
committerJulius Werner <jwerner@chromium.org>2018-05-22 02:39:23 +0000
commit9123449734f43922fe39cdb08c3d60f02f0eb3ed (patch)
tree948b2dd577439a190e9ce0610d336188bf2d2c48 /Makefile.inc
parent12574dd72b7b0e7e59ac1b071d581f78cd8f01ad (diff)
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 <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/26451 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc5
1 files changed, 5 insertions, 0 deletions
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