[PATCH 02/43] tools build: Add detected config support

From: Arnaldo Carvalho de Melo
Date: Fri Feb 13 2015 - 15:49:36 EST


From: Jiri Olsa <jolsa@xxxxxxxxxx>

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 <jolsa@xxxxxxxxxx>
Tested-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>
Tested-by: Will Deacon <will.deacon@xxxxxxx>
Cc: Alexis Berlemont <alexis.berlemont@xxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-bl8qho0ubck7aqrbbfu9inlm@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/build/Makefile.build | 3 +++
tools/perf/config/Makefile | 4 ++++
2 files changed, 7 insertions(+)

diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index ae203f21cc86..35174d920476 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -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
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index cc224080b525..ba414216e506 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -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)

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/