Commit fcfd6611 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Tested-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bl8qho0ubck7aqrbbfu9inlm@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c819e2cf
...@@ -22,6 +22,9 @@ build-dir := $(srctree)/tools/build ...@@ -22,6 +22,9 @@ build-dir := $(srctree)/tools/build
# Generic definitions # Generic definitions
include $(build-dir)/Build.include include $(build-dir)/Build.include
# do not force detected configuration
-include .config-detected
# Init all relevant variables used in build files so # Init all relevant variables used in build files so
# 1) they have correct type # 1) they have correct type
# 2) they do not inherit any value from the environment # 2) they do not inherit any value from the environment
......
...@@ -11,6 +11,10 @@ ifneq ($(obj-perf),) ...@@ -11,6 +11,10 @@ ifneq ($(obj-perf),)
obj-perf := $(abspath $(obj-perf))/ obj-perf := $(abspath $(obj-perf))/
endif 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/ LIB_INCLUDE := $(srctree)/tools/lib/
CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment