tools build: Add detected config support
tip-bot for Jiri Olsa
merge botCommit-ID: fcfd6611fbccdbf2593bd949097a5c0e45cd96da Gitweb: http://git.kernel.org/tip/fcfd6611fbccdbf2593bd949097a5c0e45cd96da Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 31 Dec 2014 17:37:00 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 12 Feb 2015 11:16:56 -0300
tools build: Add detected config support
Adding support to include detected configuration makefile into the build process. This will allow the Build objects to be configurable based on the config data, like:
perf-$(CONFIG_KRAVA) += krava.o
The configuration is stored in '.config-detected' file, which is generated for each compilation.
Signed-off-by Jiri Olsa <[email protected]>
Tested-by Sukadev Bhattiprolu <[email protected]>
Tested-by Will Deacon <[email protected]>
Cc Alexis Berlemont <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/build/Makefile.build | 3 +++ tools/perf/config/Makefile | 4 ++++ 2 files changed, 7 insertions(+)
tools/build/Makefile.build +3 -0
@@ -22,6 +22,9 @@ build-dir := $(srctree)/tools/build # Generic definitions include $(build-dir)/Build.include +# do not force detected configuration +-include .config-detected + # Init all relevant variables used in build files so # 1) they have correct type # 2) they do not inherit any value from the environment
tools/perf/config/Makefile +4 -0
@@ -11,6 +11,10 @@ ifneq ($(obj-perf),) obj-perf := $(abspath $(obj-perf))/ endif +$(shell echo -n > .config-detected) +detected = $(shell echo "$(1)=y" >> .config-detected) +detected_var = $(shell echo "$(1)=$($(1))" >> .config-detected) + LIB_INCLUDE := $(srctree)/tools/lib/ CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)