[dpdk-dev,v3,2/3] mk: allow use of environment var for template
Checks
Commit Message
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
-----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
>
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.
@@ -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
@@ -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