From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DF5511F5 for ; Fri, 4 Aug 2017 12:29:22 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Aug 2017 03:29:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,320,1498546800"; d="scan'208";a="115578232" Received: from silpixa00397898.ir.intel.com (HELO silpixa00397898.ger.corp.intel.com) ([10.237.223.116]) by orsmga004.jf.intel.com with ESMTP; 04 Aug 2017 03:29:20 -0700 From: David Hunt To: dev@dpdk.org Cc: thomas@monjalon.net, David Hunt Date: Fri, 4 Aug 2017 11:28:59 +0100 Message-Id: <1501842539-1152-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496846277-280267-2-git-send-email-david.hunt@intel.com> References: <1496846277-280267-2-git-send-email-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v4] mk: add sensible default target with defconfig X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 10:29:23 -0000 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 Acked-by: Shreyansh Jain Tested-by: Jerin Jacob --- doc/build-sdk-quick.txt | 2 ++ mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt index 8d41052..e7e7acf 100644 --- a/doc/build-sdk-quick.txt +++ b/doc/build-sdk-quick.txt @@ -1,4 +1,6 @@ Basic build + make defconfig && make + or make config T=x86_64-native-linuxapp-gcc && make Build commands config get configuration from target template (T=) diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index 1f2d6bd..fc03fe3 100644 --- a/mk/rte.sdkconfig.mk +++ b/mk/rte.sdkconfig.mk @@ -60,16 +60,38 @@ 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 | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | 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 2843b7d..076a2d7 100644 --- a/mk/rte.sdkroot.mk +++ b/mk/rte.sdkroot.mk @@ -88,8 +88,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 -- 2.7.4