提交 8b6eb56a 编写于 作者: I Ingo Molnar

tools/perf/build: Add 'autodep' functionality, generate feature test dependencies automatically

Use GCC's -MD feature to generate a dependency file for each feature test .c file,
and include that .d file in the config/feature-checks/Makefile.

This allows us to do two things:

 - speed up feature tests
 - detect removal or changes in build dependencies - including system libraries/headers

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-Jfma8pmPnnqzpxjbs3hpgmsj@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 b6aa9979
FILES=test-hello
CC := $(CC) -MD
all: $(FILES)
BUILD = $(CC) -o $(OUTPUT)$@ $@.c
###############################
test-hello: test-hello.c
test-hello:
$(BUILD)
-include *.d */*.d
###############################
clean:
rm -f $(FILES)
rm -f $(FILES) *.d
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册