提交 860df583 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

tools lib traceevent: Make dependency files regeneratable

Ingo reported that libtraceevent doesn't clean out dependency (.d) files
and it can cause a build error when the libgcc package upgraded:

 comet:~/tip/tools/perf> make -j
     SUBDIR ../lib/traceevent/
 make[1]: *** No rule to make target `/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h',
  needed by `event-parse.o'.  Stop.
 make: *** [../lib/traceevent//libtraceevent.a] Error 2

So this patch makes the .d files depends on the source and header files
also, so that it can be re-generated as needed.

NOTE: This code is copied from the GNU make manual page
(4.14 Generating Prerequisites Automatically).
Reported-by: NIngo Molnar <mingo@kernel.org>
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340343462-15556-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 6545e3a8
...@@ -250,8 +250,12 @@ endef ...@@ -250,8 +250,12 @@ endef
all_objs := $(sort $(ALL_OBJS)) all_objs := $(sort $(ALL_OBJS))
all_deps := $(all_objs:%.o=.%.d) all_deps := $(all_objs:%.o=.%.d)
# let .d file also depends on the source and header files
define check_deps define check_deps
$(CC) -M $(CFLAGS) $< > $@; @set -e; $(RM) $@; \
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
$(RM) $@.$$$$
endef endef
$(gui_deps): ks_version.h $(gui_deps): ks_version.h
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册