[PATCH 06/18] tools: Add a toplevel Makefile

From: Borislav Petkov
Date: Sat Apr 23 2011 - 12:29:38 EST


From: Borislav Petkov <borislav.petkov@xxxxxxx>

Add a Makefile with all the targets under tools/. Make perf the default
one and add a minimalistic Makefile to slub/ for completeness.

Signed-off-by: Borislav Petkov <borislav.petkov@xxxxxxx>
---
tools/Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++
tools/scripts/Makefile.lib | 14 ++++++++++++--
tools/slub/Makefile | 4 ++++
3 files changed, 58 insertions(+), 2 deletions(-)
create mode 100644 tools/Makefile
create mode 100644 tools/slub/Makefile

diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 0000000..74b20a9
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,42 @@
+include scripts/Makefile.lib
+
+PERF_TOP_DIR := $(CURDIR)
+export PERF_TOP_DIR
+
+BASIC_CFLAGS = -I$(CURDIR)/lib
+
+# temporary for lib/trace/
+BASIC_CFLAGS += -I$(CURDIR)/perf/util/include
+export BASIC_CFLAGS
+
+perf: .FORCE
+ $(QUIET_SUBDIR0)perf/ $(QUIET_SUBDIR1)
+
+firewire: .FORCE
+ $(QUIET_SUBDIR0)firewire/ $(QUIET_SUBDIR1)
+
+slabinfo: .FORCE
+ $(QUIET_SUBDIR0)slub/ $(QUIET_SUBDIR1)
+
+turbostat: .FORCE
+ $(QUIET_SUBDIR0)power/x86/turbostat/ $(QUIET_SUBDIR1)
+
+usb: .FORCE
+ $(QUIET_SUBDIR0)usb/ $(QUIET_SUBDIR1)
+
+virtio: .FORCE
+ $(QUIET_SUBDIR0)virtio/ $(QUIET_SUBDIR1)
+
+x86_energy: .FORCE
+ $(QUIET_SUBDIR0)power/x86/x86_energy_perf_policy/ $(QUIET_SUBDIR1)
+
+clean:
+ $(QUIET_SUBDIR0)perf/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)firewire/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)slub/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)power/x86/turbostat/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)usb/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)virtio/ $(QUIET_SUBDIR1) clean
+ $(QUIET_SUBDIR0)power/x86/x86_energy_perf_policy/ $(QUIET_SUBDIR1) clean
+
+.PHONY: clean .FORCE
diff --git a/tools/scripts/Makefile.lib b/tools/scripts/Makefile.lib
index 854fefb..9dfa0f9 100644
--- a/tools/scripts/Makefile.lib
+++ b/tools/scripts/Makefile.lib
@@ -33,6 +33,15 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement

+QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
+QUIET_SUBDIR1 =
+
+ifneq ($(findstring $(MAKEFLAGS),w),w)
+PRINT_DIR = --no-print-directory
+else # "make -w"
+NO_SUBDIR = :
+endif
+
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
QUIET_CC = @echo ' ' CC $@;
@@ -40,7 +49,8 @@ ifndef V
QUIET_LINK = @echo ' ' LINK $@;
QUIET_MKDIR = @echo ' ' MKDIR $@;
QUIET_GEN = @echo ' ' GEN $@;
+ QUIET_SUBDIR0 = +@subdir=
+ QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
+ $(MAKE) $(PRINT_DIR) -C $$subdir
endif
endif
-
-
diff --git a/tools/slub/Makefile b/tools/slub/Makefile
new file mode 100644
index 0000000..b2cf6b4
--- /dev/null
+++ b/tools/slub/Makefile
@@ -0,0 +1,4 @@
+slabinfo: slabinfo.c
+
+clean:
+ rm -rf slabinfo
--
1.7.4.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/