make help
cover make help
Let's add help for building DPDK.
---
Thomas Monjalon (3):
mk: rule showconfigs for configs listing
doc: how to build
mk: rule help
doc/build-sdk-quick.txt | 22 ++++++++++++++++++++++ mk/rte.sdkconfig.mk | 4 ++++ mk/rte.sdkdoc.mk | 8 ++++++++ mk/rte.sdkroot.mk | 7 ++++--- 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 doc/build-sdk-quick.txt
A message that is not in the archive (sent off-list or not yet received): cover.1367939814.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
PATCH 1/3 mk: rule showconfigs for configs listing
Allow to list configs in config/ directory with a simple make rule.
--- mk/rte.sdkconfig.mk | 4 ++++ mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)
mk/rte.sdkconfig.mk +4 -0
@@ -36,6 +36,10 @@ INSTALL_CONFIGS := $(filter-out %~,\ $(wildcard $(RTE_SRCDIR)/config/defconfig_*))) INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS)) +.PHONY: showconfigs +showconfigs: + @$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config:
mk/rte.sdkroot.mk +2 -2
@@ -87,8 +87,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config -config: +.PHONY: config showconfigs +config showconfigs: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: test fast_test ring_test mempool_test
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 43533094849ffdacde83cad14c59364caa39d595.1367939814.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Re: [PATCH 1/3] mk: rule showconfigs for configs listing
Hi Thomas,
I wonder if this new rule is really needed: I think you can already do a "make config" without argument to list the supported configurations.
Olivier
Quoted 38 lines · Thomas Monjalon
Allow to list configs in config/ directory with a simple make rule.
Signed-off-by Thomas Monjalon <[email protected]>--- mk/rte.sdkconfig.mk | 4 ++++ mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)mk/rte.sdkconfig.mk +4
-0@@ -36,6 +36,10 @@ INSTALL_CONFIGS := $(filter-out %~,\ $(wildcard $(RTE_SRCDIR)/config/defconfig_*))) INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS)) +.PHONY: showconfigs +showconfigs: + @$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config:mk/rte.sdkroot.mk +2
-2@@ -87,8 +87,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config -config: +.PHONY: config showconfigs +config showconfigs: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: test fast_test ring_test mempool_test
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 1/3] mk: rule showconfigs for configs listing
17/05/2013 11:05, Olivier MATZ :
Quoted 3 lines
I wonder if this new rule is really needed: I think you can already do a "make config" without argument to list the supported configurations.
Yes it is needed because "make config" adds an error comment. But I could refactor this patch to use "make showconfigs" in "make config".
Signature · 1 line
Thomas
PATCH 2/3 doc: how to build
In reply to a message not in the archiveThis is a cheat sheet to build DPDK and can be used for a "make help". It is explicitly described as a build help in order to concatenate it with other helps such as test commands.
--- doc/build-sdk-quick.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/build-sdk-quick.txt
doc/build-sdk-quick.txt new file +22 -0
@@ -0,0 +1,22 @@ +Basic build + make config T=x86_64-default-linuxapp-gcc && make +Build commands + config get configuration from target template (T=) + all same as build (default rule) + build build in a configured directory + clean remove files but keep configuration + install build many targets (wildcard allowed) in fixed directories + uninstall remove all installed targets +Build options + T target template (install default: *) - used with config or install + O output directory (default: build/) - cannot be used with install + V verbose + D debug dependencies + CROSS toolchain prefix + EXTRA_CPPFLAGS preprocessor options + EXTRA_CFLAGS compiler options + EXTRA_LDFLAGS linker options +Build targets + format: <arch-machine-execenv-toolchain> + templates in config/defconfig_*: + # make showconfigs
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): fa5bbf77e53cbef7f33b49b1e8b01e960d0ce4c1.1367939814.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Re: [PATCH 2/3] doc: how to build
Hi Thomas,
Good to see a "make help" ;)
What do you think of replacing "Build options" by "Build variables" ? I think it is not obvious that we have to use V=1 for instance for a verbose build.
About the "build targets", I suggest to include it in the help of T variable. What do you think ?
Olivier
Quoted 38 lines · Thomas Monjalon
This is a cheat sheet to build DPDK and can be used for a "make help". It is explicitly described as a build help in order to concatenate it with other helps such as test commands.
Signed-off-by Thomas Monjalon <[email protected]>--- doc/build-sdk-quick.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/build-sdk-quick.txtdoc/build-sdk-quick.txt new file +22
-0@@ -0,0 +1,22 @@ +Basic build + make config T=x86_64-default-linuxapp-gcc && make +Build commands + config get configuration from target template (T=) + all same as build (default rule) + build build in a configured directory + clean remove files but keep configuration + install build many targets (wildcard allowed) in fixed directories + uninstall remove all installed targets +Build options + T target template (install default: *) - used with config or install + O output directory (default: build/) - cannot be used with install + V verbose + D debug dependencies + CROSS toolchain prefix + EXTRA_CPPFLAGS preprocessor options + EXTRA_CFLAGS compiler options + EXTRA_LDFLAGS linker options +Build targets + format: <arch-machine-execenv-toolchain> + templates in config/defconfig_*: + # make showconfigs
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 2/3] doc: how to build
17/05/2013 11:06, Olivier MATZ :
Quoted 12 lines · Thomas Monjalon
doc/build-sdk-quick.txt line 18
Quoted 9 lines
doc/build-sdk-quick.txt new file +9
-0+Build options + T target template (install default: *) - used with config or install + O output directory (default: build/) - cannot be used with install + V verbose + D debug dependencies + CROSS toolchain prefix + EXTRA_CPPFLAGS preprocessor options + EXTRA_CFLAGS compiler options + EXTRA_LDFLAGS linker optionsWhat do you think of replacing "Build options" by "Build variables" ?
OK
Quoted 2 lines
I think it is not obvious that we have to use V=1 for instance for a verbose build.
Is it sufficient to change to "Build variables" ?
I could add "(level number, default: 0)" but, in fact, there is only 2 levels:
empty or any value in V/D variables.
Quoted 7 lines
doc/build-sdk-quick.txt line 22
Quoted 4 lines
doc/build-sdk-quick.txt new file +4
-0+Build targets + format: <arch-machine-execenv-toolchain> + templates in config/defconfig_*: + # make showconfigsAbout the "build targets", I suggest to include it in the help of T variable. What do you think ?
It is a whole subject described on several lines.
I think it's clearer to have a dedicated section.
Signature · 1 line
Thomas
PATCH 3/3 mk: rule help
In reply to a message not in the archiveThe goal of this rule is to show which rules/options are available from a "make" command.
Let's start by printing short doc about SDK building.
The macro maketxt allow to interpret syntax "# make foo" while keeping indentation of the source document.
Here, it is used to call "make showconfigs" to list available targets.
--- mk/rte.sdkdoc.mk | 8 ++++++++ mk/rte.sdkroot.mk | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
mk/rte.sdkdoc.mk +8 -0
@@ -38,6 +38,14 @@ $(error "Cannot use T= with doc target") endif endif +define maketxt + sed 's,^\([[:space:]]*\)# make \(.*\),make -rRs \2 | sed "s/^/\1/",e' $1 +endef + +.PHONY: help +help: + @$(call maketxt, $(RTE_SDK)/doc/build-sdk-quick.txt) + .PHONY: all all: htmlapi
mk/rte.sdkroot.mk +2 -1
@@ -103,8 +103,9 @@ testall testimport: install uninstall: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@ -.PHONY: doc +.PHONY: doc help doc: doc-all +help: doc-help doc-%: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkdoc.mk $*
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): f54b18b23b958789d69e7d5d1376cec813093f9d.1367939814.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
Re: [PATCH 3/3] mk: rule help
Thomas,
I think the "maketxt" macro is overkill... why not just a "cat" ?
Olivier
Quoted 48 lines · Thomas Monjalon
The goal of this rule is to show which rules/options are available from a "make" command.
Let's start by printing short doc about SDK building.The macro maketxt allow to interpret syntax "# make foo" while keeping indentation of the source document.
Here, it is used to call "make showconfigs" to list available targets.Signed-off-by Thomas Monjalon <[email protected]>--- mk/rte.sdkdoc.mk | 8 ++++++++ mk/rte.sdkroot.mk | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)mk/rte.sdkdoc.mk +8
-0@@ -38,6 +38,14 @@ $(error "Cannot use T= with doc target") endif endif +define maketxt + sed 's,^\([[:space:]]*\)# make \(.*\),make -rRs \2 | sed "s/^/\1/",e' $1 +endef + +.PHONY: help +help: + @$(call maketxt, $(RTE_SDK)/doc/build-sdk-quick.txt) + .PHONY: all all: htmlapimk/rte.sdkroot.mk +2
-1@@ -103,8 +103,9 @@ testall testimport: install uninstall: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@ -.PHONY: doc +.PHONY: doc help doc: doc-all +help: doc-help doc-%: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkdoc.mk $*
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 3/3] mk: rule help
17/05/2013 11:06, Olivier MATZ :
Quoted 10 lines · Thomas Monjalon
Quoted 3 lines
The macro maketxt allow to interpret syntax "# make foo" while keeping indentation of the source document.
Here, it is used to call "make showconfigs" to list available targets.[..]
mk/rte.sdkdoc.mk $(error "Cannot use T= with doc target") · line 43
Quoted 3 lines
mk/rte.sdkdoc.mk +3
-0+define maketxt + sed 's,^\([[:space:]]*\)# make \(.*\),make -rRs \2 | sed "s/^/\1/",e' $1 +endefI think the "maketxt" macro is overkill... why not just a "cat" ?
Because the syntax "# make" is interpreted.
With build-sdk-quick.txt, it lists all available configurations. Maybe I should add a comment before the macro to explain it.
Signature · 1 line
Thomas
v2 cover make help
In reply to a message not in the archiveLet's add help for building DPDK.
changes since v1: (Olivier's review)
- reword/reorganize help
- reuse "showconfigs" in "config"
- no magic sed to call "make showconfigs" in help
---
Thomas Monjalon (3):
doc: how to build
mk: rule showconfigs for configs listing
mk: rule help
doc/build-sdk-quick.txt | 20 ++++++++++++++++++++ mk/rte.sdkconfig.mk | 12 +++++++----- mk/rte.sdkdoc.mk | 5 +++++ mk/rte.sdkroot.mk | 7 ++++--- 4 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 doc/build-sdk-quick.txt
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): cover.1369779070.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org
PATCH v2 1/3 doc: how to build
This is a cheat sheet to build DPDK and can be used for a "make help". It is explicitly described as a build help in order to concatenate it with other helps such as test commands.
--- doc/build-sdk-quick.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/build-sdk-quick.txt
doc/build-sdk-quick.txt new file +20 -0
@@ -0,0 +1,20 @@ +Basic build + make config T=x86_64-default-linuxapp-gcc && make +Build commands + config get configuration from target template (T=) + all same as build (default rule) + build build in a configured directory + clean remove files but keep configuration + install build many targets (wildcard allowed) in fixed directories + uninstall remove all installed targets +Build variables + CROSS toolchain prefix + EXTRA_CPPFLAGS preprocessor options + EXTRA_CFLAGS compiler options + EXTRA_LDFLAGS linker options + V verbose + D debug dependencies + O output directory (default: build/) - cannot be used with install + T target template (install default: *) - used with config or install + format: <arch-machine-execenv-toolchain> + templates in config/defconfig_*
Signature · 1 line
1.7.10.4
PATCH v2 2/3 mk: rule showconfigs for configs listing
In reply to a message not in the archiveAllow to list configs in config/ directory with a simple make rule.
The rule showconfigs is reused in config error.
In the same time, "echo -n" is replaced by the more portable "printf".
--- mk/rte.sdkconfig.mk | 12 +++++++----- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-)
mk/rte.sdkconfig.mk +7 -5
@@ -36,14 +36,16 @@ INSTALL_CONFIGS := $(filter-out %~,\ $(wildcard $(RTE_SRCDIR)/config/defconfig_*))) INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS)) +.PHONY: showconfigs +showconfigs: + @$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: - @echo -n "No template specified. Use T=template " ; \ - echo "among the following list:" ; \ - for t in $(INSTALL_CONFIGS); do \ - echo " $$t" ; \ - done + @printf "No template specified. " + @echo "Use T=template among the following list:" + @$(MAKE) -rR showconfigs | sed 's,^, ,' else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile $(Q)$(MAKE) depdirs
mk/rte.sdkroot.mk +2 -2
@@ -87,8 +87,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config -config: +.PHONY: config showconfigs +config showconfigs: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: test fast_test ring_test mempool_test
Signature · 1 line
1.7.10.4
PATCH v2 3/3 mk: rule help
In reply to a message not in the archiveThe goal of this rule is to show which rules/options are available from a "make" command.
Let's start by printing short doc about SDK building.
--- mk/rte.sdkdoc.mk | 5 +++++ mk/rte.sdkroot.mk | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)
mk/rte.sdkdoc.mk +5 -0
@@ -38,6 +38,11 @@ $(error "Cannot use T= with doc target") endif endif +.PHONY: help +help: + @cat $(RTE_SDK)/doc/build-sdk-quick.txt + @$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,' + .PHONY: all all: htmlapi
mk/rte.sdkroot.mk +2 -1
@@ -103,8 +103,9 @@ testall testimport: install uninstall: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@ -.PHONY: doc +.PHONY: doc help doc: doc-all +help: doc-help doc-%: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkdoc.mk $*
Signature · 1 line
1.7.10.4
Hi Thomas,
Quoted 6 lines · Thomas Monjalon
Let's add help for building DPDK.
changes since v1: (Olivier's review)
- reword/reorganize help
- reuse "showconfigs" in "config"
- no magic sed to call "make showconfigs" in help
Looks good to me ! Thank you for taking the comments in account.
Olivier
A message that is not in the archive (sent off-list or not yet received): [email protected]
30/05/2013 16:55, Olivier MATZ :
Quoted 9 lines · Thomas Monjalon
Quoted 6 lines
Let's add help for building DPDK.
changes since v1: (Olivier's review)
- reword/reorganize help
- reuse "showconfigs" in "config"
- no magic sed to call "make showconfigs" in helpLooks good to me ! Thank you for taking the comments in account.
pushed
Thanks for your review
Signature · 1 line
Thomas