From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52])
 by dpdk.org (Postfix) with ESMTP id 34C6D8E58
 for <dev@dpdk.org>; Thu,  3 Dec 2015 06:03:28 +0100 (CET)
Received: by wmuu63 with SMTP id u63so5940120wmu.0
 for <dev@dpdk.org>; Wed, 02 Dec 2015 21:03:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=jiIcJVAinSXbrB91d1Bl+fyngxLmyxNK0j7TL/e44cY=;
 b=rnJiAImPccYLWAqr81dhxidbcBdA47PRv8Yq1Iy/JJh8i1tMEehHYpZfFCzJUJxK51
 73vNM9/6yTPFUWEQsDD4wxWD4g4xKlC4NeUcQYWe+kgzgxIltjDFZ+IQxxdga3OdlV5O
 h8OX6TbOTBbCG0fU3iVjL54lrBX8WvMl0gVvn5zjmr28zEQQfhLHdDdT8Z/1R9trWI1G
 YTTeGUAO9gRkZPg5afc+6fJPvOFcyjstRzy3FEFe3Hwy3qikfZpOe3HZYKUWLp1P3Jde
 la0bhk+2PVwnpSxdU1JK5oFIDWnmfdCPERwaFhKM2xfuXLCH2JqOPif5uuiRqU+tFKsm
 aIXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=jiIcJVAinSXbrB91d1Bl+fyngxLmyxNK0j7TL/e44cY=;
 b=TmFrc0qevLnlYF8EthYxYeeVZsbyQwViRh7WVlghghTU5Ep9oxULwsCXA2vpDEMfE1
 tZi60C2hcj9kXuTpva1xBkVD4Qt6+9OzRV4/0Z32ChOZg9dYnhO1hcO2dblWVYqhzS8Y
 xOl6kW6TfMIfeLuwsydRf99sgTNi6USDIomKwVksWQik8pOVtp8+wxoHsz80TQfY40nZ
 JUW8aRGu8kZxqsCSTynuy5GmN731P6+q7US54OKae172SZ/RuHcBu2sAywsTh02v21Dx
 i4Bz+9EhpRDiYsNjJEreIdj0Ja1qTfD5Xc0daACWYM5UvUb+H/b1igbBBM6L7KGyi+KE
 Fakg==
X-Gm-Message-State: ALoCoQlAwKk35pfXT7rPrAl6L6b99ASjMwZrDms6rrldn3+2QaKOf+IxCBlDBR7HCXaaUCBM/HfS
X-Received: by 10.28.214.143 with SMTP id n137mr49899328wmg.2.1449119008063;
 Wed, 02 Dec 2015 21:03:28 -0800 (PST)
Received: from XPS13.ibrowse.com ([93.158.46.55])
 by smtp.gmail.com with ESMTPSA id gl4sm5720379wjd.17.2015.12.02.21.03.26
 (version=TLSv1/SSLv3 cipher=OTHER);
 Wed, 02 Dec 2015 21:03:27 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Date: Thu,  3 Dec 2015 06:01:59 +0100
Message-Id: <1449118929-19962-3-git-send-email-thomas.monjalon@6wind.com>
X-Mailer: git-send-email 2.5.2
In-Reply-To: <1449118929-19962-1-git-send-email-thomas.monjalon@6wind.com>
References: <1449028676-19232-1-git-send-email-thomas.monjalon@6wind.com>
 <1449118929-19962-1-git-send-email-thomas.monjalon@6wind.com>
Subject: [dpdk-dev] [PATCH v2 02/12] mk: remove multi-target install
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 03 Dec 2015 05:03:28 -0000

The multi-target install create some subdirectories with the target name
which is not standard for a "make install" procedure.

The uninstall procedure cannot be applied properly (without removing
all files in a directory). It would need to pre-compute paths.
As it is a packaging issue, it is removed from the build system capabilities.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/build-sdk-quick.txt                          |  5 +-
 doc/guides/linux_gsg/build_dpdk.rst              | 16 ------
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 11 +----
 mk/rte.sdkinstall.mk                             | 62 ++++++------------------
 mk/rte.sdkroot.mk                                |  4 +-
 tools/setup.sh                                   | 31 ++++--------
 6 files changed, 32 insertions(+), 97 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..b5f752e 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,8 +5,7 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          build many targets (wildcard allowed) and install in DESTDIR
-	uninstall        remove all installed targets
+	install          configure, build and install a target in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -20,6 +19,6 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
-	T         target template (install default: *) - used with config or install
+	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 2680e66..fd0fcc8 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -110,22 +110,6 @@ To compile a 32-bit build using gcc, the make command should be:
 
     make install T=i686-native-linuxapp-gcc
 
-To compile all 64-bit targets using gcc, use:
-
-.. code-block:: console
-
-    make install T=x86_64*gcc
-
-To compile all 64-bit targets using both gcc and icc, use:
-
-.. code-block:: console
-
-    make install T=x86_64-*
-
-.. note::
-
-    The wildcard operator (*) can be used to create multiple targets at the same time.
-
 To prepare a target without building it, for example, if the configuration changes need to be made before compilation,
 use the make config T=<target> command:
 
diff --git a/doc/guides/prog_guide/dev_kit_root_make_help.rst b/doc/guides/prog_guide/dev_kit_root_make_help.rst
index e02c544..458fc91 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -108,21 +108,14 @@ Install Targets
 *   Install
 
     Build the DPDK binary.
-    Actually, this builds each supported target in a separate directory.
-    The name of each directory is the name of the target.
-    The name of the targets to install can be optionally specified using T=mytarget.
-    The target name can contain wildcard \* characters.
+    The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-*
-
-*   Uninstall
-
-    Remove installed target directories.
+        make install T=x86_64-native-linuxapp-gcc
 
 Test Targets
 ------------
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..3e6e8ca 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -29,59 +29,29 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# Build directory is given with O=
-ifdef O
-BUILD_DIR=$(O)
-else
-BUILD_DIR=.
-endif
+# Configuration, compilation and installation can be done at once
+# with make install T=<config>
 
-# Targets to install can be specified in command line. It can be a
-# target name or a name containing jokers "*". Example:
-# x86_64-native-*-gcc
-ifndef T
-T=*
-endif
-
-#
-# install: build sdk for all supported targets
-#
-INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
-	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
-	$(filter-out %~,$(INSTALL_CONFIGS)))
+# The build directory is T and may be prepended with O
+O ?= .
+BUILD_DIR := $O/$T
 
 .PHONY: install
-install: $(INSTALL_TARGETS)
-
-%_install:
-	@echo ================== Installing $*
-	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
-		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
-	elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \
-		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
+install:
+	@echo ================== Installing $T
+	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
+		$(MAKE) config T=$T O=$(BUILD_DIR); \
+	elif cmp -s $(BUILD_DIR)/.config.orig $(BUILD_DIR)/.config; then \
+		$(MAKE) config T=$T O=$(BUILD_DIR); \
 	else \
-		if [ -f $(BUILD_DIR)/$*/.config.orig ] ; then \
-			tmp_build=$(BUILD_DIR)/$*/.config.tmp; \
-			$(MAKE) config T=$* O=$$tmp_build; \
-			if ! cmp -s $(BUILD_DIR)/$*/.config.orig $$tmp_build/.config ; then \
+		if [ -f $(BUILD_DIR)/.config.orig ] ; then \
+			tmp_build=$(BUILD_DIR)/.config.tmp; \
+			$(MAKE) config T=$T O=$$tmp_build; \
+			if ! cmp -s $(BUILD_DIR)/.config.orig $$tmp_build/.config ; then \
 				echo "Conflict: local config and template config have both changed"; \
 				exit 1; \
 			fi; \
 		fi; \
 		echo "Using local configuration"; \
 	fi
-	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
-#
-# uninstall: remove all built sdk
-#
-UNINSTALL_TARGETS := $(addsuffix _uninstall,\
-	$(filter-out %~,$(INSTALL_CONFIGS)))
-
-.PHONY: uninstall
-uninstall: $(UNINSTALL_TARGETS)
-
-%_uninstall:
-	@echo ================== Uninstalling $*
-	$(Q)rm -rf $(BUILD_DIR)/$*
+	$(Q)$(MAKE) all O=$(BUILD_DIR)
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 0e97308..9fdecf4 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -93,8 +93,8 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: install uninstall
-install uninstall:
+.PHONY: install
+install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
diff --git a/tools/setup.sh b/tools/setup.sh
index 5a8b2f3..58a08e7 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -105,14 +105,6 @@ setup_target()
 }
 
 #
-# Uninstall all targets.
-#
-uninstall_targets()
-{
-	make uninstall
-}
-
-#
 # Creates hugepage filesystem.
 #
 create_mnt_huge()
@@ -571,23 +563,20 @@ step5_func()
 {
 	TITLE="Uninstall and system cleanup"
 
-	TEXT[1]="Uninstall all targets"
-	FUNC[1]="uninstall_targets"
-
-	TEXT[2]="Unbind NICs from IGB UIO or VFIO driver"
-	FUNC[2]="unbind_nics"
+	TEXT[1]="Unbind NICs from IGB UIO or VFIO driver"
+	FUNC[1]="unbind_nics"
 
-	TEXT[3]="Remove IGB UIO module"
-	FUNC[3]="remove_igb_uio_module"
+	TEXT[2]="Remove IGB UIO module"
+	FUNC[2]="remove_igb_uio_module"
 
-	TEXT[4]="Remove VFIO module"
-	FUNC[4]="remove_vfio_module"
+	TEXT[3]="Remove VFIO module"
+	FUNC[3]="remove_vfio_module"
 
-	TEXT[5]="Remove KNI module"
-	FUNC[5]="remove_kni_module"
+	TEXT[4]="Remove KNI module"
+	FUNC[4]="remove_kni_module"
 
-	TEXT[6]="Remove hugepage mappings"
-	FUNC[6]="clear_huge_pages"
+	TEXT[5]="Remove hugepage mappings"
+	FUNC[5]="clear_huge_pages"
 }
 
 STEPS[1]="step1_func"
-- 
2.5.2