tools lib traceevent: Make dependency files regeneratable
authorNamhyung Kim <[email protected]>
Fri, 22 Jun 2012 05:37:36 +0000 (14:37 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 29 Jun 2012 16:28:12 +0000 (13:28 -0300)
commit860df5833e461beba4bf9f3304a7919da98fd789
treee383dd5c63f5a7889ce36d288c4174bbe2c972e0
parent6545e3a8f0666b60b26202a5271a94f7cd9601a8
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: Ingo Molnar <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/lib/traceevent/Makefile