aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-11-05 10:15:24 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-14 14:53:11 -0500
commit0bca6cff89c6e7d1e383993cccf0f59146874a34 (patch)
tree6b348e15137f99c23ddb49484a192280a1680954 /tools
parent59ed16b315681a08cf8aa13ee949e9405801f442 (diff)
tools: Define a Makefile function to do subdir processing
Define a Makefile function that can be called with $(call ...) to wrap the subdir make invocations in tools/Makefile. This will allow us in the next patch to insert bits in there to honour O= flags when called from the top-level Makefile. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Borislav Petkov <bp@amd64.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1378.1352379110@warthog.procyon.org.uk Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile24
-rw-r--r--tools/scripts/Makefile.include8
2 files changed, 20 insertions, 12 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 3ae43947a171..1f9a529fe544 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -31,44 +31,44 @@ help:
31 @echo ' clean: a summary clean target to clean _all_ folders' 31 @echo ' clean: a summary clean target to clean _all_ folders'
32 32
33cpupower: FORCE 33cpupower: FORCE
34 $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) 34 $(call descend,power/$@)
35 35
36firewire lguest perf usb virtio vm: FORCE 36firewire lguest perf usb virtio vm: FORCE
37 $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) 37 $(call descend,$@)
38 38
39selftests: FORCE 39selftests: FORCE
40 $(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1) 40 $(call descend,testing/$@)
41 41
42turbostat x86_energy_perf_policy: FORCE 42turbostat x86_energy_perf_policy: FORCE
43 $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) 43 $(call descend,power/x86/$@)
44 44
45cpupower_install: 45cpupower_install:
46 $(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install 46 $(call descend,power/$(@:_install=),install)
47 47
48firewire_install lguest_install perf_install usb_install virtio_install vm_install: 48firewire_install lguest_install perf_install usb_install virtio_install vm_install:
49 $(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install 49 $(call descend,$(@:_install=),install)
50 50
51selftests_install: 51selftests_install:
52 $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install 52 $(call descend,testing/$(@:_clean=),install)
53 53
54turbostat_install x86_energy_perf_policy_install: 54turbostat_install x86_energy_perf_policy_install:
55 $(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install 55 $(call descend,power/x86/$(@:_install=),install)
56 56
57install: cpupower_install firewire_install lguest_install perf_install \ 57install: cpupower_install firewire_install lguest_install perf_install \
58 selftests_install turbostat_install usb_install virtio_install \ 58 selftests_install turbostat_install usb_install virtio_install \
59 vm_install x86_energy_perf_policy_install 59 vm_install x86_energy_perf_policy_install
60 60
61cpupower_clean: 61cpupower_clean:
62 $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean 62 $(call descend,power/cpupower,clean)
63 63
64firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean: 64firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean:
65 $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean 65 $(call descend,$(@:_clean=),clean)
66 66
67selftests_clean: 67selftests_clean:
68 $(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean 68 $(call descend,testing/$(@:_clean=),clean)
69 69
70turbostat_clean x86_energy_perf_policy_clean: 70turbostat_clean x86_energy_perf_policy_clean:
71 $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean 71 $(call descend,power/x86/$(@:_clean=),clean)
72 72
73clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \ 73clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \
74 turbostat_clean usb_clean virtio_clean vm_clean \ 74 turbostat_clean usb_clean virtio_clean vm_clean \
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 96ce80a3743b..4a9e3176f743 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -41,6 +41,14 @@ else
41NO_SUBDIR = : 41NO_SUBDIR = :
42endif 42endif
43 43
44#
45# Define a callable command for descending to a new directory
46#
47# Call by doing: $(call descend,directory[,target])
48#
49descend = \
50 $(QUIET_SUBDIR0)$(1) $(QUIET_SUBDIR1) $(2)
51
44QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir 52QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
45QUIET_SUBDIR1 = 53QUIET_SUBDIR1 =
46 54