Currently if we build single target like:

  $ touch util/map.c && make util/map.o

It will not rebuild util/map.o if it already exists
and util/map.c is modified.

The reason is that the top-level 'Makefile' processes
util/map.o as an implicit rule and if util/map.o exists
make considers the 'util/map.o' target as done and  wouldn't
nest into Makefile.perf.

Adding FORCE for '%', because that's what we want to nest
into Makefile.perf for any target.

Adding Makefile into phony targets, because make tries to
rebuilt it and it's also resolved as '%' target.

Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
---
 tools/perf/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index d31a7bbd7cee..480546d5f13b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -83,8 +83,8 @@ build-test:
 #
 # All other targets get passed through:
 #
-%:
+%: FORCE
        $(print_msg)
        $(make)
 
-.PHONY: tags TAGS
+.PHONY: tags TAGS FORCE Makefile
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to