[dpdk-dev] mk: fix verbosity zero

Message ID 1474587767-20033-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Thomas Monjalon Sept. 22, 2016, 11:42 p.m. UTC
  Verbosity is considered enabled when $V is not empty.
So V=0 and V=1 are equivalent.
It is fixed by unsetting V when it is 0.

A side effect is to fix kernel module compilation verbosity
which is set to 0 when V is empty.

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkroot.mk | 3 +++
 mk/rte.vars.mk    | 3 +++
 2 files changed, 6 insertions(+)
  

Comments

Ferruh Yigit Sept. 23, 2016, 9:06 a.m. UTC | #1
On 9/23/2016 12:42 AM, Thomas Monjalon wrote:
> Verbosity is considered enabled when $V is not empty.
> So V=0 and V=1 are equivalent.
> It is fixed by unsetting V when it is 0.
> 
> A side effect is to fix kernel module compilation verbosity
> which is set to 0 when V is empty.
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  mk/rte.sdkroot.mk | 3 +++
>  mk/rte.vars.mk    | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
> index 55a9d8a..04ad523 100644
> --- a/mk/rte.sdkroot.mk
> +++ b/mk/rte.sdkroot.mk
> @@ -34,6 +34,9 @@ MAKEFLAGS += --no-print-directory
>  # define Q to '@' or not. $(Q) is used to prefix all shell commands to
>  # be executed silently.
>  Q=@
> +ifeq '$V' '0'
> +override V=
> +endif
>  ifdef V

Why not simply:
-ifdef V
+ifeq ($(V),1)


>  ifeq ("$(origin V)", "command line")
>  Q=
> diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk
> index 28982a5..c240a0e 100644
> --- a/mk/rte.vars.mk
> +++ b/mk/rte.vars.mk
> @@ -46,6 +46,9 @@ endif
>  # define Q to '@' or not. $(Q) is used to prefix all shell commands to
>  # be executed silently.
>  Q=@
> +ifeq '$V' '0'
> +override V=
> +endif
>  ifdef V
>  ifeq ("$(origin V)", "command line")
>  Q=
>
  
Thomas Monjalon Sept. 23, 2016, 9:30 a.m. UTC | #2
2016-09-23 10:06, Ferruh Yigit:
> On 9/23/2016 12:42 AM, Thomas Monjalon wrote:
> > Verbosity is considered enabled when $V is not empty.
> > So V=0 and V=1 are equivalent.
> > It is fixed by unsetting V when it is 0.
> > 
> > A side effect is to fix kernel module compilation verbosity
> > which is set to 0 when V is empty.
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
[...]
> > --- a/mk/rte.sdkroot.mk
> > +++ b/mk/rte.sdkroot.mk
> > @@ -34,6 +34,9 @@ MAKEFLAGS += --no-print-directory
> >  # define Q to '@' or not. $(Q) is used to prefix all shell commands to
> >  # be executed silently.
> >  Q=@
> > +ifeq '$V' '0'
> > +override V=
> > +endif
> >  ifdef V
> 
> Why not simply:
> -ifdef V
> +ifeq ($(V),1)

Because:
- V could have a higher value
- $(if $V) construct is used in several places in the makefiles
	See git grep '$(if $(*V'
  
Ferruh Yigit Sept. 23, 2016, 9:33 a.m. UTC | #3
On 9/23/2016 12:42 AM, Thomas Monjalon wrote:
> Verbosity is considered enabled when $V is not empty.
> So V=0 and V=1 are equivalent.
> It is fixed by unsetting V when it is 0.
> 
> A side effect is to fix kernel module compilation verbosity
> which is set to 0 when V is empty.
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon Sept. 23, 2016, 2:26 p.m. UTC | #4
2016-09-23 10:33, Ferruh Yigit:
> On 9/23/2016 12:42 AM, Thomas Monjalon wrote:
> > Verbosity is considered enabled when $V is not empty.
> > So V=0 and V=1 are equivalent.
> > It is fixed by unsetting V when it is 0.
> > 
> > A side effect is to fix kernel module compilation verbosity
> > which is set to 0 when V is empty.
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied with additional comment:
"It is a well spread shortcut in makefiles, see git grep '$(if $(*V'"
  

Patch

diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 55a9d8a..04ad523 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -34,6 +34,9 @@  MAKEFLAGS += --no-print-directory
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V
 ifeq ("$(origin V)", "command line")
 Q=
diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk
index 28982a5..c240a0e 100644
--- a/mk/rte.vars.mk
+++ b/mk/rte.vars.mk
@@ -46,6 +46,9 @@  endif
 # define Q to '@' or not. $(Q) is used to prefix all shell commands to
 # be executed silently.
 Q=@
+ifeq '$V' '0'
+override V=
+endif
 ifdef V
 ifeq ("$(origin V)", "command line")
 Q=