[dpdk-dev,v3,2/3] mk: allow use of environment var for template

Message ID 1496846277-280267-3-git-send-email-david.hunt@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hunt, David June 7, 2017, 2:37 p.m. UTC
  Added new environment variable RTE_TEMPLATE which is an additional
variable that can be set in the users environment. This maps on to the
existing 'T' command line variable typically used when 'make config'
or 'make install' is invoked.

So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user
can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by
'make config'. If the user instead chooses to 'make install', this will
do the configure, build, and install in one step.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 mk/rte.sdkroot.mk    | 4 ++++
 2 files changed, 8 insertions(+)
  

Comments

Jerin Jacob June 12, 2017, 8:37 a.m. UTC | #1
-----Original Message-----
> Date: Wed, 7 Jun 2017 15:37:56 +0100
> From: David Hunt <david.hunt@intel.com>
> To: dev@dpdk.org
> CC: thomas@monjalon.net, shreyansh.jain@nxp.com, David Hunt
>  <david.hunt@intel.com>
> Subject: [dpdk-dev] [PATCH v3 2/3] mk: allow use of environment var for
>  template
> X-Mailer: git-send-email 2.7.4
> 
> Added new environment variable RTE_TEMPLATE which is an additional
> variable that can be set in the users environment. This maps on to the
> existing 'T' command line variable typically used when 'make config'
> or 'make install' is invoked.
> 
> So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user
> can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by
> 'make config'. If the user instead chooses to 'make install', this will
> do the configure, build, and install in one step.
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> ---
>  mk/rte.sdkinstall.mk | 4 ++++
>  mk/rte.sdkroot.mk    | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index dbac2a2..a464b01 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install)
>  include $(RTE_SDK)/mk/rte.vars.mk
>  endif
>  
> +ifndef T
> +T := $(RTE_TEMPLATE)
> +endif
> +
>  ifdef T # defaults with T= will install an almost flat staging tree
>  export prefix ?=
>  kerneldir   ?= $(prefix)/kmod
> diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
> index 076a2d7..a560230 100644
> --- a/mk/rte.sdkroot.mk
> +++ b/mk/rte.sdkroot.mk
> @@ -63,6 +63,10 @@ ifdef T
>  ifeq ("$(origin T)", "command line")
>  RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T)
>  endif
> +else
> +ifdef RTE_TEMPLATE
> +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)
> +endif
>  endif
>  export RTE_CONFIG_TEMPLATE
>  
> -- 
> 2.7.4
>
  
Thomas Monjalon Aug. 3, 2017, 10:42 p.m. UTC | #2
07/06/2017 16:37, David Hunt:
> Added new environment variable RTE_TEMPLATE which is an additional
> variable that can be set in the users environment. This maps on to the
> existing 'T' command line variable typically used when 'make config'
> or 'make install' is invoked.
> 
> So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user
> can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by
> 'make config'. If the user instead chooses to 'make install', this will
> do the configure, build, and install in one step.
[...]
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install)
>  include $(RTE_SDK)/mk/rte.vars.mk
>  endif
>  
> +ifndef T
> +T := $(RTE_TEMPLATE)
> +endif

"make install T=" is an old syntax.
We should drop this non-standard syntax.
So I prefer we do not encourage it with this variable.

> --- a/mk/rte.sdkroot.mk
> +++ b/mk/rte.sdkroot.mk
> +ifdef RTE_TEMPLATE
> +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)
> +endif

What is the benefit of exporting RTE_TEMPLATE instead of T= ?
I am afraid it get more confusion.
  

Patch

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index dbac2a2..a464b01 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,10 @@  ifneq ($(MAKECMDGOALS),pre_install)
 include $(RTE_SDK)/mk/rte.vars.mk
 endif
 
+ifndef T
+T := $(RTE_TEMPLATE)
+endif
+
 ifdef T # defaults with T= will install an almost flat staging tree
 export prefix ?=
 kerneldir   ?= $(prefix)/kmod
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 076a2d7..a560230 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -63,6 +63,10 @@  ifdef T
 ifeq ("$(origin T)", "command line")
 RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T)
 endif
+else
+ifdef RTE_TEMPLATE
+RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)
+endif
 endif
 export RTE_CONFIG_TEMPLATE