* [PATCH 0/2] tools: Add a toplevel Makefile @ 2012-03-22 17:01 Borislav Petkov 2012-03-22 17:01 ` [PATCH 1/2] tools: Add Makefile.lib Borislav Petkov 2012-03-22 17:01 ` [PATCH 2/2] tools: Add a toplevel Makefile Borislav Petkov 0 siblings, 2 replies; 10+ messages in thread From: Borislav Petkov @ 2012-03-22 17:01 UTC (permalink / raw) To: Ingo Molnar, Arnaldo Carvalho de Melo; +Cc: LKML, Borislav Petkov From: Borislav Petkov <borislav.petkov@amd.com> Hi all, this is a refresh and carve-out of an old patchset. It adds a toplevel Makefile to tools/ so that one can build the tool of her/his liking by simply doing $ cd tools/ $ make <toolname> By default, we build perf. There's also a scripts/Makefile.lib now which should contain all make-related generic stuff which can be used by all tools' build process after including this file. Any comments/suggestions are welcome, thanks. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] tools: Add Makefile.lib 2012-03-22 17:01 [PATCH 0/2] tools: Add a toplevel Makefile Borislav Petkov @ 2012-03-22 17:01 ` Borislav Petkov 2012-03-22 21:07 ` Sam Ravnborg 2012-03-22 17:01 ` [PATCH 2/2] tools: Add a toplevel Makefile Borislav Petkov 1 sibling, 1 reply; 10+ messages in thread From: Borislav Petkov @ 2012-03-22 17:01 UTC (permalink / raw) To: Ingo Molnar, Arnaldo Carvalho de Melo; +Cc: LKML, Borislav Petkov From: Borislav Petkov <borislav.petkov@amd.com> Put generic enough build settings which could be reused by other tools into a common Makefile.lib file. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> --- tools/perf/Makefile | 45 +----------------------------------- tools/scripts/Makefile.lib | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 tools/scripts/Makefile.lib diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 8a4b9bccf8b2..3c0bfa39eb8b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -1,18 +1,10 @@ -ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ -endif +include ../scripts/Makefile.lib # The default target of this Makefile is... all: include config/utilities.mak -ifneq ($(OUTPUT),) -# check that the output directory actually exists -OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) -$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) -endif - # Define V to have a more verbose compile. # # Define PYTHON to point to the python binary if the default @@ -70,31 +62,6 @@ ifneq ($(WERROR),0) CFLAGS_WERROR := -Werror endif -# -# Include saner warnings here, which can catch bugs: -# - -EXTRA_WARNINGS := -Wformat -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3 -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes -EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement - ifeq ("$(origin DEBUG)", "command line") PERF_DEBUG = $(DEBUG) endif @@ -619,16 +586,6 @@ else endif endif -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - QUIET_CC = @echo ' ' CC $@; - QUIET_AR = @echo ' ' AR $@; - QUIET_LINK = @echo ' ' LINK $@; - QUIET_MKDIR = @echo ' ' MKDIR $@; - QUIET_GEN = @echo ' ' GEN $@; -endif -endif - ifdef ASCIIDOC8 export ASCIIDOC8 endif diff --git a/tools/scripts/Makefile.lib b/tools/scripts/Makefile.lib new file mode 100644 index 000000000000..a2586d13bcf8 --- /dev/null +++ b/tools/scripts/Makefile.lib @@ -0,0 +1,55 @@ +ifeq ("$(origin O)", "command line") + OUTPUT := $(O)/ +endif + +ifneq ($(OUTPUT),) +# check that the output directory actually exists +OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) +$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) +endif + +# +# Include saner warnings here, which can catch bugs: +# +EXTRA_WARNINGS := -Wformat +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3 +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes +EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement + +ifneq ($(findstring $(MAKEFLAGS), w),w) +PRINT_DIR = --no-print-directory +else +NO_SUBDIR = : +endif + +QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir +QUIET_SUBDIR1 = + +ifneq ($(findstring $(MAKEFLAGS),s),s) +ifndef V + QUIET_CC = @echo ' ' CC $@; + QUIET_AR = @echo ' ' AR $@; + 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 -- 1.7.9.3.362.g71319 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] tools: Add Makefile.lib 2012-03-22 17:01 ` [PATCH 1/2] tools: Add Makefile.lib Borislav Petkov @ 2012-03-22 21:07 ` Sam Ravnborg 2012-03-22 21:15 ` Borislav Petkov 0 siblings, 1 reply; 10+ messages in thread From: Sam Ravnborg @ 2012-03-22 21:07 UTC (permalink / raw) To: Borislav Petkov Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Borislav Petkov On Thu, Mar 22, 2012 at 06:01:52PM +0100, Borislav Petkov wrote: > From: Borislav Petkov <borislav.petkov@amd.com> > > Put generic enough build settings which could be reused by other tools > into a common Makefile.lib file. I assume that the reason to use the filename "Makefile.lib" is that scripts/Makefile.lib uses the same extension. But whoever idiot(*) that decided to use that extension deserve to be shot! It is not a library per see, it is just a bunch of stuff you include in another makefile. So Makefile.include would be better - and as an added benefit vim does not barf on it. (*) I actually shave him quite often... Sam ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] tools: Add Makefile.lib 2012-03-22 21:07 ` Sam Ravnborg @ 2012-03-22 21:15 ` Borislav Petkov 0 siblings, 0 replies; 10+ messages in thread From: Borislav Petkov @ 2012-03-22 21:15 UTC (permalink / raw) To: Sam Ravnborg; +Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Borislav Petkov On Thu, Mar 22, 2012 at 10:07:32PM +0100, Sam Ravnborg wrote: > On Thu, Mar 22, 2012 at 06:01:52PM +0100, Borislav Petkov wrote: > > From: Borislav Petkov <borislav.petkov@amd.com> > > > > Put generic enough build settings which could be reused by other tools > > into a common Makefile.lib file. > > I assume that the reason to use the filename "Makefile.lib" is that > scripts/Makefile.lib uses the same extension. Yep. > But whoever idiot(*) that decided to use that extension deserve to be shot! Ye^W^W.. oops, oh no, please no! :-) > It is not a library per see, it is just a bunch of stuff you include > in another makefile. > So Makefile.include would be better - and as an added benefit vim > does not barf on it. Makes sense, will do, thanks. > (*) I actually shave him quite often... LOL. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-22 17:01 [PATCH 0/2] tools: Add a toplevel Makefile Borislav Petkov 2012-03-22 17:01 ` [PATCH 1/2] tools: Add Makefile.lib Borislav Petkov @ 2012-03-22 17:01 ` Borislav Petkov 2012-03-22 18:33 ` Christoph Lameter 1 sibling, 1 reply; 10+ messages in thread From: Borislav Petkov @ 2012-03-22 17:01 UTC (permalink / raw) To: Ingo Molnar, Arnaldo Carvalho de Melo Cc: LKML, Borislav Petkov, Christoph Lameter, Pekka Enberg From: Borislav Petkov <borislav.petkov@amd.com> Add a Makefile with all the targets under tools/. Make perf the default one and add a minimalistic Makefile to slub/ for completeness. Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> --- tools/Makefile | 24 ++++++++++++++++++++++++ tools/slub/Makefile | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 tools/Makefile create mode 100644 tools/slub/Makefile diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000000..97631367e0db --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,24 @@ +include scripts/Makefile.lib + +perf firewire lguest slub usb virtio: FORCE + $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) + +cpupower: FORCE + $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) + +turbostat x86_energy_perf_policy: FORCE + $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) + +firewire_clean lguest_clean perf_clean slub_clean usb_clean virtio_clean: + $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean + +cp_clean: + $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean + +turbostat_clean x86_energy_perf_policy_clean: + $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean + +clean: cp_clean firewire_clean lguest_clean perf_clean slub_clean turbostat_clean \ + usb_clean virtio_clean x86_energy_perf_policy_clean + +.PHONY: FORCE diff --git a/tools/slub/Makefile b/tools/slub/Makefile new file mode 100644 index 000000000000..b2cf6b467bbe --- /dev/null +++ b/tools/slub/Makefile @@ -0,0 +1,4 @@ +slabinfo: slabinfo.c + +clean: + rm -rf slabinfo -- 1.7.9.3.362.g71319 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-22 17:01 ` [PATCH 2/2] tools: Add a toplevel Makefile Borislav Petkov @ 2012-03-22 18:33 ` Christoph Lameter 2012-03-22 21:04 ` Borislav Petkov 0 siblings, 1 reply; 10+ messages in thread From: Christoph Lameter @ 2012-03-22 18:33 UTC (permalink / raw) To: Borislav Petkov Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Borislav Petkov, Pekka Enberg On Thu, 22 Mar 2012, Borislav Petkov wrote: > index 000000000000..97631367e0db > --- /dev/null > +++ b/tools/Makefile > @@ -0,0 +1,24 @@ > +include scripts/Makefile.lib > + > +perf firewire lguest slub usb virtio: FORCE > + $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) > + > +cpupower: FORCE > + $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) > + > +turbostat x86_energy_perf_policy: FORCE > + $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) > + > +firewire_clean lguest_clean perf_clean slub_clean usb_clean virtio_clean: > + $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean > + > +cp_clean: > + $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean > + > +turbostat_clean x86_energy_perf_policy_clean: > + $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean > + > +clean: cp_clean firewire_clean lguest_clean perf_clean slub_clean turbostat_clean \ slub_clean? Where is that target defined? > diff --git a/tools/slub/Makefile b/tools/slub/Makefile > new file mode 100644 > index 000000000000..b2cf6b467bbe > --- /dev/null > +++ b/tools/slub/Makefile > @@ -0,0 +1,4 @@ > +slabinfo: slabinfo.c > + > +clean: > + rm -rf slabinfo That portion looks okay. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-22 18:33 ` Christoph Lameter @ 2012-03-22 21:04 ` Borislav Petkov 2012-03-22 21:47 ` Christoph Lameter 0 siblings, 1 reply; 10+ messages in thread From: Borislav Petkov @ 2012-03-22 21:04 UTC (permalink / raw) To: Christoph Lameter Cc: Borislav Petkov, Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Pekka Enberg On Thu, Mar 22, 2012 at 01:33:18PM -0500, Christoph Lameter wrote: > On Thu, 22 Mar 2012, Borislav Petkov wrote: > > > index 000000000000..97631367e0db > > --- /dev/null > > +++ b/tools/Makefile > > @@ -0,0 +1,24 @@ > > +include scripts/Makefile.lib > > + > > +perf firewire lguest slub usb virtio: FORCE > > + $(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1) > > + > > +cpupower: FORCE > > + $(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1) > > + > > +turbostat x86_energy_perf_policy: FORCE > > + $(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1) > > + > > +firewire_clean lguest_clean perf_clean slub_clean usb_clean virtio_clean: ^^^---------------------------------------------- | > > + $(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean | > > | > > + | > > +cp_clean: | > > + $(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean | > > + | > > +turbostat_clean x86_energy_perf_policy_clean: | > > + $(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean | > > + | > > +clean: cp_clean firewire_clean lguest_clean perf_clean slub_clean turbostat_clean \ | > | > slub_clean? Where is that target defined? | | Here--------------------------------------------------------------------------------------------- :-). It basically does: $ make -C slub/ clean which runs the target of the same name in the Makefile in slub/. Thanks. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-22 21:04 ` Borislav Petkov @ 2012-03-22 21:47 ` Christoph Lameter 2012-03-26 10:27 ` Pekka Enberg 0 siblings, 1 reply; 10+ messages in thread From: Christoph Lameter @ 2012-03-22 21:47 UTC (permalink / raw) To: Borislav Petkov; +Cc: Ingo Molnar, Arnaldo Carvalho de Melo, LKML, Pekka Enberg On Thu, 22 Mar 2012, Borislav Petkov wrote: > It basically does: > > $ make -C slub/ clean > > which runs the target of the same name in the Makefile in slub/. Ok. Acked-by: Christoph Lameter <cl@linux.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-22 21:47 ` Christoph Lameter @ 2012-03-26 10:27 ` Pekka Enberg 2012-03-29 12:33 ` Borislav Petkov 0 siblings, 1 reply; 10+ messages in thread From: Pekka Enberg @ 2012-03-26 10:27 UTC (permalink / raw) To: Christoph Lameter Cc: Borislav Petkov, Ingo Molnar, Arnaldo Carvalho de Melo, LKML, akpm On Thu, 22 Mar 2012, Christoph Lameter wrote: > On Thu, 22 Mar 2012, Borislav Petkov wrote: > > > It basically does: > > > > $ make -C slub/ clean > > > > which runs the target of the same name in the Makefile in slub/. > > Ok. > > Acked-by: Christoph Lameter <cl@linux.com> Didn't Andrew already patches that moved this under tools/vm and added proper Makefiles for it? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] tools: Add a toplevel Makefile 2012-03-26 10:27 ` Pekka Enberg @ 2012-03-29 12:33 ` Borislav Petkov 0 siblings, 0 replies; 10+ messages in thread From: Borislav Petkov @ 2012-03-29 12:33 UTC (permalink / raw) To: Pekka Enberg Cc: Christoph Lameter, Ingo Molnar, Arnaldo Carvalho de Melo, LKML, akpm On Mon, Mar 26, 2012 at 01:27:11PM +0300, Pekka Enberg wrote: > Didn't Andrew already patches that moved this under tools/vm and added > proper Makefiles for it? Yeah, he did. It went upstream on Wed: commit 63e315535abe0d820d0e3db4c06bc5de74aeefc8 Author: Dave Young <dyoung@redhat.com> Date: Wed Mar 28 14:42:55 2012 -0700 mm: move slabinfo.c to tools/vm We have tools/vm/ folder for vm tools, so move slabinfo.c from tools/slub/ to tools/vm/ I'll have to readjust my patchset then. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-03-29 12:33 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-03-22 17:01 [PATCH 0/2] tools: Add a toplevel Makefile Borislav Petkov 2012-03-22 17:01 ` [PATCH 1/2] tools: Add Makefile.lib Borislav Petkov 2012-03-22 21:07 ` Sam Ravnborg 2012-03-22 21:15 ` Borislav Petkov 2012-03-22 17:01 ` [PATCH 2/2] tools: Add a toplevel Makefile Borislav Petkov 2012-03-22 18:33 ` Christoph Lameter 2012-03-22 21:04 ` Borislav Petkov 2012-03-22 21:47 ` Christoph Lameter 2012-03-26 10:27 ` Pekka Enberg 2012-03-29 12:33 ` Borislav Petkov
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.