From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH v1 2/2] mk: add sensible default target with defconfig Date: Wed, 24 May 2017 11:40:09 +0530 Message-ID: References: <1495535304-159542-1-git-send-email-david.hunt@intel.com> <1495535304-159542-3-git-send-email-david.hunt@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: David Hunt Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id CB41237A0 for ; Wed, 24 May 2017 08:02:06 +0200 (CEST) In-Reply-To: <1495535304-159542-3-git-send-email-david.hunt@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello David, On Tuesday 23 May 2017 03:58 PM, David Hunt wrote: > Users can now use 'make defconfig' to generate a configuration using > the most appropriate defaults for the current machine. > > > arch taken from uname -m > machine defaults to native > execenv is taken from uname, Linux=linuxapp, otherwise bsdapp > toolchain is taken from $CC -v to see which compiler to use > > Signed-off-by: David Hunt > --- > mk/rte.sdkconfig.mk | 15 ++++++++++++--- > mk/rte.sdkroot.mk | 4 ++-- > 2 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk > index 1f2d6bd..4f30d56 100644 > --- a/mk/rte.sdkconfig.mk > +++ b/mk/rte.sdkconfig.mk > @@ -60,16 +60,25 @@ showconfigs: > > .PHONY: notemplate > notemplate: > - @printf "No template specified. " > - @echo "Use T=template among the following list:" > + @printf "No template specified. Use 'make defconfig' or " > + @echo "use T=template from the following list:" > @$(MAKE) -rR showconfigs | sed 's,^, ,' > > + > +.PHONY: defconfig > +defconfig: > + @$(MAKE) config T=$(shell uname -m)-native-$(shell uname | \ The idea to have 'make defconfig' do the works looks great to me. I am just worried about the above line - it wouldn't allow configurations like arm64-dpaa2-linuxapp-gcc or arm64-armv8a-linuxapp-gcc Basically, having the MACHINE default to 'native' would not be right in all cases. But, I don't have a better idea about how to detect this automatically. Or, we might use RTE_MACHINE someway. > + awk '{ if ($$0 == "Linux") {print "linuxapp"} else \ > + {print "bsdapp"} }')-$(shell ${CC} -v 2>&1 \ > + | grep " version " | cut -d ' ' -f 1) > + > .PHONY: config > ifeq ($(RTE_CONFIG_TEMPLATE),) > config: notemplate > else > config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile > - @echo "Configuration done" > + @echo "Configuration done using "$(shell basename \ > + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") > endif > > $(RTE_OUTPUT): > diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk > index 9bdaf20..8019603 100644 > --- a/mk/rte.sdkroot.mk > +++ b/mk/rte.sdkroot.mk > @@ -90,8 +90,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n > .PHONY: default > default: all > > -.PHONY: config showconfigs showversion showversionum > -config showconfigs showversion showversionum: > +.PHONY: defconfig config showconfigs showversion showversionum > +defconfig config showconfigs showversion showversionum: > $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ > > .PHONY: cscope gtags tags etags > Other than that, I tried this patch for x86 and it worked fine. - Shreyansh