public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung.kim@lge.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	namhyung.kim@lge.com, namhyung@kernel.org, jolsa@redhat.com,
	dsahern@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] tools lib traceevent: Make dependency files regeneratable
Date: Fri, 6 Jul 2012 03:52:31 -0700	[thread overview]
Message-ID: <tip-860df5833e461beba4bf9f3304a7919da98fd789@git.kernel.org> (raw)
In-Reply-To: <1340343462-15556-3-git-send-email-namhyung@kernel.org>

Commit-ID:  860df5833e461beba4bf9f3304a7919da98fd789
Gitweb:     http://git.kernel.org/tip/860df5833e461beba4bf9f3304a7919da98fd789
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 22 Jun 2012 14:37:36 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 29 Jun 2012 13:28:12 -0300

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 <mingo@kernel.org>
Signed-off-by: Namhyung 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 34a577e..46c2f6b 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -250,8 +250,12 @@ endef
 all_objs := $(sort $(ALL_OBJS))
 all_deps := $(all_objs:%.o=.%.d)
 
+# let .d file also depends on the source and header files
 define check_deps
-		$(CC) -M $(CFLAGS) $< > $@;
+		@set -e; $(RM) $@; \
+		$(CC) -M $(CFLAGS) $< > $@.$$$$; \
+		sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+		$(RM) $@.$$$$
 endef
 
 $(gui_deps): ks_version.h

  parent reply	other threads:[~2012-07-06 10:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  5:37 [RFC/PATCHSET 0/8] perf tools: Minimal build without libelf dependency (v2) Namhyung Kim
2012-06-22  5:37 ` [PATCH 1/8] perf evsel: Fix a build failure on cross compilation Namhyung Kim
2012-06-22  5:37 ` [PATCH 2/8] tools lib traceevent: Make dependency files regeneratable Namhyung Kim
2012-06-28 16:15   ` Arnaldo Carvalho de Melo
2012-07-06 10:52   ` tip-bot for Namhyung Kim [this message]
2012-06-22  5:37 ` [PATCH 3/8] tools lib traceevent: Detect build environment changes Namhyung Kim
2012-06-22  5:37 ` [PATCH 4/8] perf symbols: Introduce symbol__elf_init() Namhyung Kim
2012-06-22  5:37 ` [PATCH 5/8] perf symbols: Do not use ELF's symbol binding constants Namhyung Kim
2012-06-22 12:43   ` Arnaldo Carvalho de Melo
2012-06-22 15:19     ` Namhyung Kim
2012-06-22 15:29       ` Arnaldo Carvalho de Melo
2012-06-22  5:37 ` [PATCH 6/8] perf tools: Split out util/symbol-elf.c Namhyung Kim
2012-06-22  5:37 ` [PATCH 7/8] perf tools: Support minimal build without libelf Namhyung Kim
2012-06-22  5:37 ` [PATCH 8/8] perf symbols: Implement poor man's ELF parser Namhyung Kim
2012-06-22  9:47 ` [RFC/PATCHSET 0/8] perf tools: Minimal build without libelf dependency (v2) Peter Zijlstra
2012-06-22 15:05   ` Namhyung Kim
2012-06-22 15:18     ` David Ahern
2012-06-22 15:30       ` Namhyung Kim
2012-06-22 15:35         ` David Ahern
2012-06-22 16:14           ` Arnaldo Carvalho de Melo
2012-06-22 16:24             ` David Ahern
2012-06-25  0:51               ` Namhyung Kim
2012-06-22 15:32       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-860df5833e461beba4bf9f3304a7919da98fd789@git.kernel.org \
    --to=namhyung.kim@lge.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox