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-machine-execenv-toolchain>
  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 <david.h...@intel.com>
---
 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

Reply via email to