DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 00/10] standard make install
@ 2015-12-02  3:57 Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 01/10] mk: remove multi-target install Thomas Monjalon
                   ` (11 more replies)
  0 siblings, 12 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

Following the recent discussions, this is a proposal to have a standard
installation process while keeping compatibility with most of the old
behaviours.
Thank you Mario and Bruce for having submitted other proposals.
I hope there will be a strong consensus for this one.
The doc and pkg/dpdk.spec are not updated yet. There will be a v2.

More details below and in the commit messages.

These variables can be overriden:

prefix ?= /usr/local
exec_prefix ?= $(prefix)
kerneldir ?= $(exec_prefix)/kmod
bindir ?= $(exec_prefix)/bin
sbindir ?= $(exec_prefix)/sbin
libdir ?= $(exec_prefix)/lib
includedir ?= $(prefix)/include/dpdk
datarootdir ?= $(prefix)/share
docdir ?= $(datarootdir)/doc/dpdk
datadir ?= $(datarootdir)/dpdk
sdkdir ?= $(datadir)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk
In current behaviour, the doc is not installed by default.

--------

System-wise install example with
    DESTDIR=
    prefix=/usr
    kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/.config
/usr/share/dpdk/tools/

# make install-kmod
/lib/modules/kver/extra/

# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/include -> /usr/include/dpdk/
/usr/share/dpdk/lib     -> /usr/lib/

# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/examples/
/usr/share/doc/dpdk/guides/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py
install/share/dpdk/.config
install/share/dpdk/include -> install/include/dpdk/
install/share/dpdk/lib     -> install/lib/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/

It must be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.
RTE_TARGET was used to get the include and lib directories but is useless now.

--------

Thomas Monjalon (10):
  mk: remove multi-target install
  mk: move installation procedure in install rule
  mk: install a standard cutomizable tree
  mk: introduce new install syntax
  mk: split install rule
  mk: install kernel modules
  mk: install binding tool in sbin directory
  mk: install doc
  mk: install examples
  app/proc_info: rename binary with prefix

 app/proc_info/Makefile     |   2 +-
 doc/build-sdk-quick.txt    |  11 ++--
 mk/internal/rte.extvars.mk |   8 +++
 mk/rte.sdkbuild.mk         |  16 ------
 mk/rte.sdkinstall.mk       | 134 +++++++++++++++++++++++++++++++--------------
 mk/rte.sdkroot.mk          |   6 +-
 mk/rte.vars.mk             |   7 ---
 7 files changed, 113 insertions(+), 71 deletions(-)

-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 01/10] mk: remove multi-target install
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 02/10] mk: move installation procedure in install rule Thomas Monjalon
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

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 ++--
 mk/rte.sdkinstall.mk    | 61 +++++++++++++------------------------------------
 mk/rte.sdkroot.mk       |  4 ++--
 3 files changed, 20 insertions(+), 50 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/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..e8355eb 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -30,58 +30,29 @@
 #   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
+O ?= .
 
-# 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)))
+# Configuration, compilation and installation can be done at once
+# with make install T=<config>
+# The build directory is T and may be prepended with 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 e8423b0..18180fa 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install uninstall
-install uninstall:
+.PHONY: install
+install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 02/10] mk: move installation procedure in install rule
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 01/10] mk: remove multi-target install Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree Thomas Monjalon
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

The real installation was called "binary install" and was done
after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index 38ec7bd..85f603c 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index e8355eb..ed3ed86 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -37,9 +37,8 @@ O ?= .
 # The build directory is T and may be prepended with O
 BUILD_DIR := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(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 \
@@ -56,3 +55,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+
+.PHONY: install
+install: pre_install
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(BUILD_DIR) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(BUILD_DIR)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 01/10] mk: remove multi-target install Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 02/10] mk: move installation procedure in install rule Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02 10:27   ` Panu Matilainen
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 04/10] mk: introduce new install syntax Thomas Monjalon
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

The rule "install" follows these conventions:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones,
to configure the directory used with RTE_SDK when using the DPDK makefiles
to build an application.

The old installed tree was static and always had .config, includes and
libs in a RTE_TARGET subdirectory. There is no such directory anymore in
an installed SDK. So the top directory is checked.
But RTE_TARGET can still be used, especially to build an app with a
compiled but not installed SDK.
That's why both cases are looked for RTE_SDK_BIN.

The default prefix /usr/local is empty in the T= case which is
used only for a local install.
It is still possible to build DPDK with the "install T=" rule without
specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:
    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc
RTE_TARGET can be specified but is useless now with an installed SDK.
The RTE_SDK directory must now point to a different path depending of
the installation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/build-sdk-quick.txt    |  1 +
 mk/internal/rte.extvars.mk |  8 +++++++
 mk/rte.sdkinstall.mk       | 59 ++++++++++++++++++++++++++++++++++++----------
 mk/rte.vars.mk             |  7 ------
 4 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index b5f752e..662ef63 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
diff --git a/mk/internal/rte.extvars.mk b/mk/internal/rte.extvars.mk
index e248d19..dfba2f2 100644
--- a/mk/internal/rte.extvars.mk
+++ b/mk/internal/rte.extvars.mk
@@ -51,7 +51,15 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+# RTE_TARGET is empty when using a default SDK installation.
+RTE_SDK_BIN := $(RTE_SDK)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
+endif
 
 #
 # Output files wil go in a separate directory: default output is
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ed3ed86..91273be 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -1,6 +1,7 @@
 #   BSD LICENSE
 #
 #   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright 2015 6WIND S.A.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -32,10 +33,30 @@
 # Build directory is given with O=
 O ?= .
 
+prefix      ?=     /usr/local
+exec_prefix ?=      $(prefix)
+bindir      ?= $(exec_prefix)/bin
+libdir      ?= $(exec_prefix)/lib
+includedir  ?=      $(prefix)/include/dpdk
+datarootdir ?=      $(prefix)/share
+datadir     ?=       $(datarootdir)/dpdk
+sdkdir      ?= $(datadir)
+
+# The install directories may be staged in DESTDIR
+
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
 # The build directory is T and may be prepended with O
 BUILD_DIR := $O/$T
+# Default usage of T= will install an almost flat staging tree
+export prefix =
+
+# Create the directory $1 if not exists
+rte_mkdir = test -d $1 || mkdir -p $1
+
+# Create the relative symbolic link $2 -> $1
+# May be replaced with --relative option of ln from coreutils-8.16
+rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
@@ -58,16 +79,28 @@ pre_install:
 
 .PHONY: install
 install: pre_install
-	@echo ================== Installing $(DESTDIR)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/$T
-	$(Q)tar -C $(BUILD_DIR) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(BUILD_DIR)/app/testpmd \
-	  $(DESTDIR)/$T/app/testpmd
-	@echo Installation in $(DESTDIR) complete
+ifeq '$(DESTDIR)$(if $T,,+)' ''
+	@echo Installation cannot run with T defined and DESTDIR undefined
+else
+	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
+	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
+	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+		--exclude 'app/cmdline*' --exclude app/test \
+		--exclude app/testacl --exclude app/testpipeline | \
+	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
+	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
+	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk
index f87cf4b..e26d193 100644
--- a/mk/rte.vars.mk
+++ b/mk/rte.vars.mk
@@ -67,13 +67,6 @@ endif
 
 RTE_LIBNAME := dpdk
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
-
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
 # define RTE_OUTPUT, RTE_SRCDIR, RTE_EXTMK, RTE_SDK_BIN, (etc ...)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 04/10] mk: introduce new install syntax
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (2 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 05/10] mk: split install rule Thomas Monjalon
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

The old install command was:
	make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:
	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T
is not used. It is done only in pre_install to keep compatibility with the
old syntax based on T= option.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/build-sdk-quick.txt | 7 ++++---
 mk/rte.sdkinstall.mk    | 5 +++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index 662ef63..acd1bfe 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 91273be..9b4303a 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -32,6 +32,7 @@
 
 # Build directory is given with O=
 O ?= .
+BUILD_DIR := $O
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
@@ -46,10 +47,12 @@ sdkdir      ?= $(datadir)
 
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
+ifdef T
 # The build directory is T and may be prepended with O
 BUILD_DIR := $O/$T
 # Default usage of T= will install an almost flat staging tree
 export prefix =
+endif
 
 # Create the directory $1 if not exists
 rte_mkdir = test -d $1 || mkdir -p $1
@@ -60,6 +63,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef 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 \
@@ -76,6 +80,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+endif
 
 .PHONY: install
 install: pre_install
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 05/10] mk: split install rule
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (3 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 04/10] mk: introduce new install syntax Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 06/10] mk: install kernel modules Thomas Monjalon
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install
rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 9b4303a..5585974 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -88,24 +88,30 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
-	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(sdkdir)
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 18180fa..dbb7bce 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -100,6 +100,8 @@ testall:
 .PHONY: install
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 06/10] mk: install kernel modules
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (4 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 05/10] mk: split install rule Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  9:53   ` Panu Matilainen
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory Thomas Monjalon
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

On native Linux, this path is suggested:
	kerneldir=/lib/modules/$(uname -r)/extra/dpdk

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 5585974..46253ff 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -36,6 +36,7 @@ BUILD_DIR := $O
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
+kerneldir   ?= $(exec_prefix)/kmod
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
@@ -89,6 +90,7 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -105,6 +107,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq '$(wildcard $O/kmod/*)' ''
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (5 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 06/10] mk: install kernel modules Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  9:58   ` Panu Matilainen
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 08/10] mk: install doc Thomas Monjalon
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py
where some python objects may be generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 46253ff..d6df30c 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -38,6 +38,7 @@ prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
 kerneldir   ?= $(exec_prefix)/kmod
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -106,6 +107,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq '$(wildcard $O/kmod/*)' ''
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 08/10] mk: install doc
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (6 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 09/10] mk: install examples Thomas Monjalon
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

The HTML API and HTML/PDF guides may be installed if generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index d6df30c..6a26d5b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -42,6 +42,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?= $(datadir)
 
@@ -127,3 +128,13 @@ install-sdk:
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
+
+install-doc:
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+ifneq '$(wildcard $O/doc/*/*/*pdf)' ''
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 09/10] mk: install examples
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (7 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 08/10] mk: install doc Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 10/10] app/proc_info: rename binary with prefix Thomas Monjalon
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

The examples are part of the installed documentation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 6a26d5b..e151c46 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -138,3 +138,4 @@ ifneq '$(wildcard $O/doc/*/*/*pdf)' ''
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(docdir)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH 10/10] app/proc_info: rename binary with prefix
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (8 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 09/10] mk: install examples Thomas Monjalon
@ 2015-12-02  3:57 ` Thomas Monjalon
  2015-12-02  7:44 ` [dpdk-dev] [PATCH 00/10] standard make install Panu Matilainen
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
  11 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  3:57 UTC (permalink / raw)
  To: dev

In order to be installed system-wise, this application needs
a prefix. So it makes clear that it is DPDK related.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 app/proc_info/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/proc_info/Makefile b/app/proc_info/Makefile
index 243b060..33e058e 100644
--- a/app/proc_info/Makefile
+++ b/app/proc_info/Makefile
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 00/10] standard make install
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (9 preceding siblings ...)
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 10/10] app/proc_info: rename binary with prefix Thomas Monjalon
@ 2015-12-02  7:44 ` Panu Matilainen
  2015-12-02  9:25   ` Thomas Monjalon
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
  11 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02  7:44 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> Following the recent discussions, this is a proposal to have a standard
> installation process while keeping compatibility with most of the old
> behaviours.
> Thank you Mario and Bruce for having submitted other proposals.
> I hope there will be a strong consensus for this one.

Mm, can't help it but this situation reminds me of 
https://imgs.xkcd.com/comics/standards.png

That aside, a bigger problem is that it doesn't seem to work.

make clean
make config T=x86_64-native-linuxapp-gcc
make
make install DESTDIR=/tmp/dpdk-root

...results in this:

[pmatilai@sopuli dpdk]$ make DESTDIR=/tmp/dpdk-root install
================== Installing /tmp/dpdk-root/usr/local/
make[3]: Nothing to be done for 'install-kmod'.
tar: include: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
cp: cannot stat ‘./.config’: No such file or directory
/srv/work/repos/dpdk/mk/rte.sdkinstall.mk:122: recipe for target 
'install-sdk' failed
make[3]: *** [install-sdk] Error 1
/srv/work/repos/dpdk/mk/rte.sdkroot.mk:104: recipe for target 
'install-sdk' failed
make[2]: *** [install-sdk] Error 2
/srv/work/repos/dpdk/mk/rte.sdkinstall.mk:93: recipe for target 
'install' failed
make[1]: *** [install] Error 2
/srv/work/repos/dpdk/mk/rte.sdkroot.mk:102: recipe for target 'install' 
failed
make: *** [install] Error 2
[pmatilai@sopuli dpdk]$

The failure appears to be install-sdk failing since invoking it alone 
results in similar errors.

install-runtime appears to do something but it mainly installs sources 
to various directories in DESTDIR, eg:
[pmatilai@sopuli dpdk]$ find /tmp/dpdk-root/
/tmp/dpdk-root/
/tmp/dpdk-root/usr
/tmp/dpdk-root/usr/local
/tmp/dpdk-root/usr/local/lib
/tmp/dpdk-root/usr/local/lib/librte_mempool
/tmp/dpdk-root/usr/local/lib/librte_mempool/rte_dom0_mempool.c
/tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool.c
/tmp/dpdk-root/usr/local/lib/librte_mempool/Makefile
/tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool_version.map
/tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool.h
[...]
/tmp/dpdk-root/usr/local/bin/test-pmd
/tmp/dpdk-root/usr/local/bin/test-pmd/testpmd.h
/tmp/dpdk-root/usr/local/bin/test-pmd/icmpecho.c
/tmp/dpdk-root/usr/local/bin/test-pmd/parameters.c
/tmp/dpdk-root/usr/local/bin/test-pmd/macswap.c
/tmp/dpdk-root/usr/local/bin/test-pmd/csumonly.c
/tmp/dpdk-root/usr/local/bin/test-pmd/macfwd.c
[...]


install-kmod doesn't seem to do anything at all:

[pmatilai@sopuli dpdk]$ rm -rf /tmp/dpdk-root/
[pmatilai@sopuli dpdk]$ ls build/kmod/
igb_uio.ko  rte_kni.ko
[pmatilai@sopuli dpdk]$ make DESTDIR=/tmp/dpdk-root install-kmod
make[1]: Nothing to be done for 'install-kmod'.
[pmatilai@sopuli dpdk]$ find /tmp/dpdk-root/
find: ‘/tmp/dpdk-root/’: No such file or directory
[pmatilai@sopuli dpdk]$

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 00/10] standard make install
  2015-12-02  7:44 ` [dpdk-dev] [PATCH 00/10] standard make install Panu Matilainen
@ 2015-12-02  9:25   ` Thomas Monjalon
  2015-12-02  9:47     ` Panu Matilainen
  0 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02  9:25 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-02 09:44, Panu Matilainen:
> That aside, a bigger problem is that it doesn't seem to work.
> 
> make clean
> make config T=x86_64-native-linuxapp-gcc
> make
> make install DESTDIR=/tmp/dpdk-root

Oh, I forgot to test the simple case where O= is not specified!

It should be fixed with this change:

--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -31,8 +31,10 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 # Build directory is given with O=
-O ?= .
+ifndef T
+O ?= build
 BUILD_DIR := $O
+endif
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
@@ -52,6 +54,7 @@ sdkdir      ?= $(datadir)
 # with make install T=<config>
 ifdef T
 # The build directory is T and may be prepended with O
+O ?= .
 BUILD_DIR := $O/$T
 # Default usage of T= will install an almost flat staging tree
 export prefix =

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 00/10] standard make install
  2015-12-02  9:25   ` Thomas Monjalon
@ 2015-12-02  9:47     ` Panu Matilainen
  2015-12-02 10:07       ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02  9:47 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 12/02/2015 11:25 AM, Thomas Monjalon wrote:
> 2015-12-02 09:44, Panu Matilainen:
>> That aside, a bigger problem is that it doesn't seem to work.
>>
>> make clean
>> make config T=x86_64-native-linuxapp-gcc
>> make
>> make install DESTDIR=/tmp/dpdk-root
>
> Oh, I forgot to test the simple case where O= is not specified!
>
> It should be fixed with this change:
>

Okay, that helped a bunch :)

Now that I can actually test it, seems mostly ok to me. As for the rest, 
I'll comment on the specific patches.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 06/10] mk: install kernel modules
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 06/10] mk: install kernel modules Thomas Monjalon
@ 2015-12-02  9:53   ` Panu Matilainen
  2015-12-02 10:09     ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02  9:53 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> Add kernel modules to "make install".
> Nothing is done if there is no kernel module compiled.
>
> On native Linux, this path is suggested:
> 	kerneldir=/lib/modules/$(uname -r)/extra/dpdk
>
> Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>   mk/rte.sdkinstall.mk | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 5585974..46253ff 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -36,6 +36,7 @@ BUILD_DIR := $O
>
>   prefix      ?=     /usr/local
>   exec_prefix ?=      $(prefix)
> +kerneldir   ?= $(exec_prefix)/kmod
>   bindir      ?= $(exec_prefix)/bin
>   libdir      ?= $(exec_prefix)/lib
>   includedir  ?=      $(prefix)/include/dpdk
> @@ -89,6 +90,7 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
>   else
>   	@echo ================== Installing $(DESTDIR)$(prefix)/
>   	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
> +	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
>   	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
>   	@echo Installation in $(DESTDIR)$(prefix)/ complete
>   endif
> @@ -105,6 +107,12 @@ install-runtime:
>   	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
>   	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
>
> +install-kmod:
> +ifneq '$(wildcard $O/kmod/*)' ''
> +	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
> +	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
> +endif
> +
>   install-sdk:
>   	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
>   	$(Q)tar -chf -     -C $O include | \
>

This by default installs the modules to /usr/local/kmod/ with no kernel 
version etc. That's so broken that it'd be better not to install them at 
all.

So either get the kerneldir right (the correct path is known on Linux 
and surely BSD too) or dont install them at all unless kerneldir is 
manually specified. For Linux, it should default to 
/lib/modules/<kernelver>/extra/dpdk on Linux, where <kernelver> is the 
version those modules were built against (which might or might not have 
anything to do with uname -r output).

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory Thomas Monjalon
@ 2015-12-02  9:58   ` Panu Matilainen
  0 siblings, 0 replies; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02  9:58 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py
> where some python objects may be generated.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>   mk/rte.sdkinstall.mk | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 46253ff..d6df30c 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -38,6 +38,7 @@ prefix      ?=     /usr/local
>   exec_prefix ?=      $(prefix)
>   kerneldir   ?= $(exec_prefix)/kmod
>   bindir      ?= $(exec_prefix)/bin
> +sbindir     ?= $(exec_prefix)/sbin
>   libdir      ?= $(exec_prefix)/lib
>   includedir  ?=      $(prefix)/include/dpdk
>   datarootdir ?=      $(prefix)/share
> @@ -106,6 +107,9 @@ install-runtime:
>   		--keep-newer-files --warning=no-ignore-newer
>   	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
>   	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
> +	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
> +	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/dpdk_nic_bind.py, \
> +	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
>
>   install-kmod:
>   ifneq '$(wildcard $O/kmod/*)' ''
>

This symlink is broken, it expects dpdk_nic_bind.py to reside in 
$(datadir) root when it actually is in $(datadir)/tools/

Other than that, getting rid of the .py suffix is a nice touch.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 00/10] standard make install
  2015-12-02  9:47     ` Panu Matilainen
@ 2015-12-02 10:07       ` Thomas Monjalon
  0 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02 10:07 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-02 11:47, Panu Matilainen:
> On 12/02/2015 11:25 AM, Thomas Monjalon wrote:
> > 2015-12-02 09:44, Panu Matilainen:
> >> That aside, a bigger problem is that it doesn't seem to work.
> >>
> >> make clean
> >> make config T=x86_64-native-linuxapp-gcc
> >> make
> >> make install DESTDIR=/tmp/dpdk-root
> >
> > Oh, I forgot to test the simple case where O= is not specified!
> >
> > It should be fixed with this change:
> >
> 
> Okay, that helped a bunch :)
> 
> Now that I can actually test it, seems mostly ok to me. As for the rest, 
> I'll comment on the specific patches.

OK thanks :)

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 06/10] mk: install kernel modules
  2015-12-02  9:53   ` Panu Matilainen
@ 2015-12-02 10:09     ` Thomas Monjalon
  0 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02 10:09 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-02 11:53, Panu Matilainen:
> On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> > Add kernel modules to "make install".
> > Nothing is done if there is no kernel module compiled.
> >
> > On native Linux, this path is suggested:
> > 	kerneldir=/lib/modules/$(uname -r)/extra/dpdk
[...]
> > +kerneldir   ?= $(exec_prefix)/kmod
> 
> This by default installs the modules to /usr/local/kmod/ with no kernel 
> version etc. That's so broken that it'd be better not to install them at 
> all.
> 
> So either get the kerneldir right (the correct path is known on Linux 
> and surely BSD too) or dont install them at all unless kerneldir is 
> manually specified. For Linux, it should default to 
> /lib/modules/<kernelver>/extra/dpdk on Linux, where <kernelver> is the 
> version those modules were built against (which might or might not have 
> anything to do with uname -r output).

Yes. That's what Mario did.
I wanted to keep the same default as with the old T= command.
But both are do-able by using "ifdef T".

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02  3:57 ` [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree Thomas Monjalon
@ 2015-12-02 10:27   ` Panu Matilainen
  2015-12-02 11:25     ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02 10:27 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> The rule "install" follows these conventions:
> https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
> https://www.gnu.org/prep/standards/html_node/DESTDIR.html
>
> The variable sdkdir has been added to the more standards ones,
> to configure the directory used with RTE_SDK when using the DPDK makefiles
> to build an application.
>
> The old installed tree was static and always had .config, includes and
> libs in a RTE_TARGET subdirectory. There is no such directory anymore in
> an installed SDK. So the top directory is checked.
> But RTE_TARGET can still be used, especially to build an app with a
> compiled but not installed SDK.
> That's why both cases are looked for RTE_SDK_BIN.
>
> The default prefix /usr/local is empty in the T= case which is
> used only for a local install.
> It is still possible to build DPDK with the "install T=" rule without
> specifying any DESTDIR. In such case there is no install, as before.
>
> The old usage of an installed SDK is:
>      make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
>           RTE_TARGET=x86_64-native-linuxapp-gcc
> RTE_TARGET can be specified but is useless now with an installed SDK.
> The RTE_SDK directory must now point to a different path depending of
> the installation.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
[...]
> @@ -32,10 +33,30 @@
>   # Build directory is given with O=
>   O ?= .
>
> +prefix      ?=     /usr/local
> +exec_prefix ?=      $(prefix)
> +bindir      ?= $(exec_prefix)/bin
> +libdir      ?= $(exec_prefix)/lib
> +includedir  ?=      $(prefix)/include/dpdk
> +datarootdir ?=      $(prefix)/share
> +datadir     ?=       $(datarootdir)/dpdk
> +sdkdir      ?= $(datadir)
> +
> +# The install directories may be staged in DESTDIR
[...]
> +	@echo ================== Installing $(DESTDIR)$(prefix)/
> +	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
> +	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
> +	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
> +	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
> +		--exclude 'app/cmdline*' --exclude app/test \
> +		--exclude app/testacl --exclude app/testpipeline | \
> +	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
> +		--keep-newer-files --warning=no-ignore-newer
> +	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
> +	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
> +	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
> +	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
> +	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
> +		--keep-newer-files --warning=no-ignore-newer
> +	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
> +	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
> +	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
> +	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
> +	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
> +	@echo Installation in $(DESTDIR)$(prefix)/ complete
> +endif

$(prefix)/share is supposed to be shareable across different 
architectures. Most of the content here is, but at least the lib symlink 
and .config file are not.

One option is to install .config and the symlinks within $(sdkdir)/$(T) 
directories, then it can be shared across architectures because each 
lives in their own directory. Another possibility is moving the whole 
sdk directory into a subdir in $(libdir), but that misses the 
opportunity to share across architectures (whether anybody actually 
cares is a whole other question :)

$(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to 
an empty staging root, but on a real-world installation it'd point to 
/usr/lib(something) which has hundreds or thousands of other unrelated 
libraries. My memory is hazy on details but I think this caused an 
actual problem with something because I ended up $(sdkdir)/lib an actual 
directory populated with symlinks to the individual DPDK libraries.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02 10:27   ` Panu Matilainen
@ 2015-12-02 11:25     ` Thomas Monjalon
  2015-12-02 12:54       ` Panu Matilainen
  0 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02 11:25 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-02 12:27, Panu Matilainen:
> On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
> > The old installed tree was static and always had .config, includes and
> > libs in a RTE_TARGET subdirectory. There is no such directory anymore in
> > an installed SDK. So the top directory is checked.
> > But RTE_TARGET can still be used, especially to build an app with a
> > compiled but not installed SDK.
> > That's why both cases are looked for RTE_SDK_BIN.
[...]
> > The old usage of an installed SDK is:
> >      make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
> >           RTE_TARGET=x86_64-native-linuxapp-gcc
> > RTE_TARGET can be specified but is useless now with an installed SDK.
> > The RTE_SDK directory must now point to a different path depending of
> > the installation.
[...]
> > +	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
> > +	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
> > +	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
> > +	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
> > +	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
> 
> $(prefix)/share is supposed to be shareable across different 
> architectures. Most of the content here is, but at least the lib symlink 
> and .config file are not.

The case you want to address is multilib 32/x32/64, right?

> One option is to install .config and the symlinks within $(sdkdir)/$(T) 
> directories, then it can be shared across architectures because each 
> lives in their own directory. Another possibility is moving the whole 
> sdk directory into a subdir in $(libdir), but that misses the 
> opportunity to share across architectures (whether anybody actually 
> cares is a whole other question :)

Yes, I tried to remove the use of RTE_TARGET when building an example.
But we can keep it with a subdirectory in $(sdkdir).

> $(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to 
> an empty staging root, but on a real-world installation it'd point to 
> /usr/lib(something) which has hundreds or thousands of other unrelated 
> libraries. My memory is hazy on details but I think this caused an 
> actual problem with something because I ended up $(sdkdir)/lib an actual 
> directory populated with symlinks to the individual DPDK libraries.

I don't see the problem.
I suggest to keep it and see how to fix it if an issue is raised.

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02 11:25     ` Thomas Monjalon
@ 2015-12-02 12:54       ` Panu Matilainen
  2015-12-02 13:05         ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02 12:54 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 12/02/2015 01:25 PM, Thomas Monjalon wrote:
> 2015-12-02 12:27, Panu Matilainen:
>> On 12/02/2015 05:57 AM, Thomas Monjalon wrote:
>>> The old installed tree was static and always had .config, includes and
>>> libs in a RTE_TARGET subdirectory. There is no such directory anymore in
>>> an installed SDK. So the top directory is checked.
>>> But RTE_TARGET can still be used, especially to build an app with a
>>> compiled but not installed SDK.
>>> That's why both cases are looked for RTE_SDK_BIN.
> [...]
>>> The old usage of an installed SDK is:
>>>       make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
>>>            RTE_TARGET=x86_64-native-linuxapp-gcc
>>> RTE_TARGET can be specified but is useless now with an installed SDK.
>>> The RTE_SDK directory must now point to a different path depending of
>>> the installation.
> [...]
>>> +	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
>>> +	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
>>> +	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
>>> +	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
>>> +	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
>>
>> $(prefix)/share is supposed to be shareable across different
>> architectures. Most of the content here is, but at least the lib symlink
>> and .config file are not.
>
> The case you want to address is multilib 32/x32/64, right?

That, plus modern Debian/Ubuntu supports multiarch, not just -lib.

And then there's the pedantic side, ie to be in line with the FHS 
definition: 
http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA

>
>> One option is to install .config and the symlinks within $(sdkdir)/$(T)
>> directories, then it can be shared across architectures because each
>> lives in their own directory. Another possibility is moving the whole
>> sdk directory into a subdir in $(libdir), but that misses the
>> opportunity to share across architectures (whether anybody actually
>> cares is a whole other question :)
>
> Yes, I tried to remove the use of RTE_TARGET when building an example.
> But we can keep it with a subdirectory in $(sdkdir).

Just realized my suggestion $(sdkdir)/$(T) would not cut it because if 
T= is specified then this installation method wont be invoked at all :D

So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual 
added value to having the whole target string there, but I wont mind either.

>
>> $(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to
>> an empty staging root, but on a real-world installation it'd point to
>> /usr/lib(something) which has hundreds or thousands of other unrelated
>> libraries. My memory is hazy on details but I think this caused an
>> actual problem with something because I ended up $(sdkdir)/lib an actual
>> directory populated with symlinks to the individual DPDK libraries.
>
> I don't see the problem.
> I suggest to keep it and see how to fix it if an issue is raised.

The problem probably had to do with something external, like compiling 
OVS or pktgen, but ... this is too hand-wavy to worry about right now. 
Just wanted to mention it because I dont think I added the extra 
complexity in packaging just for fun.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02 12:54       ` Panu Matilainen
@ 2015-12-02 13:05         ` Thomas Monjalon
  2015-12-02 13:29           ` Panu Matilainen
  0 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-02 13:05 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-02 14:54, Panu Matilainen:
> On 12/02/2015 01:25 PM, Thomas Monjalon wrote:
> > 2015-12-02 12:27, Panu Matilainen:
> >> $(prefix)/share is supposed to be shareable across different
> >> architectures. Most of the content here is, but at least the lib symlink
> >> and .config file are not.
> >
> > The case you want to address is multilib 32/x32/64, right?
> 
> That, plus modern Debian/Ubuntu supports multiarch, not just -lib.

We do not support completely different platforms (e.g. ARM and x86)
with only one include directory. At the moment, only variants (32/64)
live together.

> >> One option is to install .config and the symlinks within $(sdkdir)/$(T)
> >> directories, then it can be shared across architectures because each
> >> lives in their own directory. Another possibility is moving the whole
> >> sdk directory into a subdir in $(libdir), but that misses the
> >> opportunity to share across architectures (whether anybody actually
> >> cares is a whole other question :)
> >
> > Yes, I tried to remove the use of RTE_TARGET when building an example.
> > But we can keep it with a subdirectory in $(sdkdir).
> 
> Just realized my suggestion $(sdkdir)/$(T) would not cut it because if 
> T= is specified then this installation method wont be invoked at all :D

I don't understand what you mean.
In my patchset, the installation is the same (except some default values)
with and without T=.

> So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual 
> added value to having the whole target string there, but I wont mind either.

RTE_TARGET is a safe choice for future.

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree
  2015-12-02 13:05         ` Thomas Monjalon
@ 2015-12-02 13:29           ` Panu Matilainen
  0 siblings, 0 replies; 67+ messages in thread
From: Panu Matilainen @ 2015-12-02 13:29 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 12/02/2015 03:05 PM, Thomas Monjalon wrote:
> 2015-12-02 14:54, Panu Matilainen:
>> On 12/02/2015 01:25 PM, Thomas Monjalon wrote:
>>> 2015-12-02 12:27, Panu Matilainen:
>>>> $(prefix)/share is supposed to be shareable across different
>>>> architectures. Most of the content here is, but at least the lib symlink
>>>> and .config file are not.
>>>
>>> The case you want to address is multilib 32/x32/64, right?
>>
>> That, plus modern Debian/Ubuntu supports multiarch, not just -lib.
>
> We do not support completely different platforms (e.g. ARM and x86)
> with only one include directory. At the moment, only variants (32/64)
> live together.

Actually even the variants will run into problems because eg 
rte_config.h will differ between 32- and 64-bit. But that's a problem 
for another day, this is hardly the most pressing of issues :)

>
>>>> One option is to install .config and the symlinks within $(sdkdir)/$(T)
>>>> directories, then it can be shared across architectures because each
>>>> lives in their own directory. Another possibility is moving the whole
>>>> sdk directory into a subdir in $(libdir), but that misses the
>>>> opportunity to share across architectures (whether anybody actually
>>>> cares is a whole other question :)
>>>
>>> Yes, I tried to remove the use of RTE_TARGET when building an example.
>>> But we can keep it with a subdirectory in $(sdkdir).
>>
>> Just realized my suggestion $(sdkdir)/$(T) would not cut it because if
>> T= is specified then this installation method wont be invoked at all :D
>
> I don't understand what you mean.
> In my patchset, the installation is the same (except some default values)
> with and without T=.

Hmm, must've misuderstood/mixed up with something Marios patches do. 
Never mind, I was just mumbling out loud anyhow.

>
>> So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual
>> added value to having the whole target string there, but I wont mind either.
>
> RTE_TARGET is a safe choice for future.
>

Nod.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
                   ` (10 preceding siblings ...)
  2015-12-02  7:44 ` [dpdk-dev] [PATCH 00/10] standard make install Panu Matilainen
@ 2015-12-03  5:01 ` Thomas Monjalon
  2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 01/12] mk: remove testall Thomas Monjalon
                     ` (14 more replies)
  11 siblings, 15 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:01 UTC (permalink / raw)
  To: dev

Following the recent discussions, this is a proposal to have a standard
installation process while keeping compatibility with most of the old
behaviours.

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

More details below and in the commit messages.

These variables can be overriden:

kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
prefix      ?=     /usr/local
exec_prefix ?=      $(prefix)
bindir      ?= $(exec_prefix)/bin
sbindir     ?= $(exec_prefix)/sbin
libdir      ?= $(exec_prefix)/lib
includedir  ?=      $(prefix)/include/dpdk
datarootdir ?=      $(prefix)/share
docdir      ?=       $(datarootdir)/doc/dpdk
datadir     ?=       $(datarootdir)/dpdk
sdkdir      ?=                $(datadir)
targetdir   ?=                $(datadir)/$(RTE_TARGET)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk install-doc

--------

System-wise install example with
    DESTDIR=
    prefix=/usr
    kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/tools/

# make install-kmod
/lib/modules/kver/extra/

# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/

# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/guides/
/usr/share/dpdk/examples/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py
install/share/doc/dpdk/
install/share/dpdk/examples/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/
install/share/dpdk/x86_64-native-linuxapp-gcc/.config
install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
install/share/dpdk/x86_64-native-linuxapp-gcc/lib     -> install/lib/

It should be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.

--------

Thomas Monjalon (12):
  mk: remove testall
  mk: remove multi-target install
  mk: move installation procedure in install rule
  mk: install a standard cutomizable tree
  mk: introduce new install syntax
  mk: split install rule
  mk: install kernel modules
  mk: install binding tool in sbin directory
  mk: install doc
  mk: install examples
  app/proc_info: rename binary with prefix
  pkg: update RPM with standard install

 app/proc_info/Makefile                           |   2 +-
 doc/build-sdk-quick.txt                          |  11 +-
 doc/guides/linux_gsg/build_dpdk.rst              |  16 ---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  28 +----
 doc/guides/sample_app_ug/proc_info.rst           |   8 +-
 mk/internal/rte.extvars.mk                       |   4 +
 mk/rte.sdkbuild.mk                               |  16 ---
 mk/rte.sdkinstall.mk                             | 148 +++++++++++++++++------
 mk/rte.sdkroot.mk                                |  10 +-
 mk/rte.sdktest.mk                                |   4 +-
 mk/rte.sdktestall.mk                             |  57 ---------
 mk/rte.vars.mk                                   |  10 +-
 pkg/dpdk.spec                                    |  59 +++------
 tools/setup.sh                                   |  31 ++---
 14 files changed, 163 insertions(+), 241 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk

-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 01/12] mk: remove testall
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
@ 2015-12-03  5:01   ` Thomas Monjalon
  2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 02/12] mk: remove multi-target install Thomas Monjalon
                     ` (13 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:01 UTC (permalink / raw)
  To: dev

It is not possible to test every configs on an unique machine.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 13 ------
 mk/rte.sdkroot.mk                                |  4 --
 mk/rte.sdktestall.mk                             | 57 ------------------------
 3 files changed, 74 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk

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 a5cd196..e02c544 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -138,19 +138,6 @@ Test Targets
 
         make test O=mybuild
 
-*   testall
-
-    Launch automatic tests for all installed target directories (after a make install).
-    The name of the targets to test can be optionally specified using T=mytarget.
-    The target name can contain wildcard (\*) characters.
-    The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_  prefix).
-
-    Examples:
-
-    .. code-block:: console
-
-        make testall, make testall T=x86_64-*
-
 Documentation Targets
 ---------------------
 
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..0e97308 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -93,10 +93,6 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: testall
-testall:
-	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
-
 .PHONY: install uninstall
 install uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
diff --git a/mk/rte.sdktestall.mk b/mk/rte.sdktestall.mk
deleted file mode 100644
index 9e7f775..0000000
--- a/mk/rte.sdktestall.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#   BSD LICENSE
-#
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
-#   All rights reserved.
-#
-#   Redistribution and use in source and binary forms, with or without
-#   modification, are permitted provided that the following conditions
-#   are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in
-#       the documentation and/or other materials provided with the
-#       distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-ifdef O
-ifeq ("$(origin O)", "command line")
-$(error "Cannot use O= with testall target")
-endif
-endif
-
-# Targets to test 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
-
-#
-# testall: launch test for all supported targets
-#
-TESTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
-	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-TESTALL_TARGETS := $(addsuffix _testall,\
-	$(filter-out %~,$(TESTALL_CONFIGS)))
-.PHONY: testall
-testall: $(TESTALL_TARGETS)
-
-%_testall:
-	@echo ================== Test $*
-	$(Q)$(MAKE) fast_test O=$*
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 02/12] mk: remove multi-target install
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
  2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 01/12] mk: remove testall Thomas Monjalon
@ 2015-12-03  5:01   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 03/12] mk: move installation procedure in install rule Thomas Monjalon
                     ` (12 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:01 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 03/12] mk: move installation procedure in install rule
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
  2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 01/12] mk: remove testall Thomas Monjalon
  2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 02/12] mk: remove multi-target install Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 04/12] mk: install a standard cutomizable tree Thomas Monjalon
                     ` (11 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The real installation was called "binary install" and was done
after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index 38ec7bd..85f603c 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3e6e8ca..54ea501 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -36,9 +36,8 @@
 O ?= .
 BUILD_DIR := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(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 \
@@ -55,3 +54,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+
+.PHONY: install
+install: pre_install
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(BUILD_DIR) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(BUILD_DIR)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 04/12] mk: install a standard cutomizable tree
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (2 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 03/12] mk: move installation procedure in install rule Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 05/12] mk: introduce new install syntax Thomas Monjalon
                     ` (10 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The rule "install" follows these conventions:
http://gnu.org/prep/standards/html_node/Directory-Variables.html
http://gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones,
to configure the directory used with RTE_SDK when using the DPDK makefiles
to build an application.

It is still possible to build DPDK with the "install T=" rule without
specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:
    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc
RTE_TARGET can be specified but is useless now with an installed SDK.
The RTE_SDK directory must now point to a different path depending of
the installation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/build-sdk-quick.txt                          |  1 +
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  6 ++-
 mk/internal/rte.extvars.mk                       |  4 ++
 mk/rte.sdkinstall.mk                             | 59 ++++++++++++++++++------
 mk/rte.vars.mk                                   | 10 +---
 5 files changed, 58 insertions(+), 22 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index b5f752e..662ef63 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
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 458fc91..b0429d8 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -111,11 +111,15 @@ Install Targets
     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).
 
+    The GNU standards variables may be used:
+    http://gnu.org/prep/standards/html_node/Directory-Variables.html and
+    http://gnu.org/prep/standards/html_node/DESTDIR.html
+
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc
+        make install T=x86_64-native-linuxapp-gcc prefix=/usr
 
 Test Targets
 ------------
diff --git a/mk/internal/rte.extvars.mk b/mk/internal/rte.extvars.mk
index e248d19..040d39f 100644
--- a/mk/internal/rte.extvars.mk
+++ b/mk/internal/rte.extvars.mk
@@ -51,7 +51,11 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
 
 #
 # Output files wil go in a separate directory: default output is
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 54ea501..4816998 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -1,6 +1,7 @@
 #   BSD LICENSE
 #
 #   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright 2015 6WIND S.A.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -36,6 +37,25 @@
 O ?= .
 BUILD_DIR := $O/$T
 
+prefix      ?=     /usr/local
+exec_prefix ?=      $(prefix)
+bindir      ?= $(exec_prefix)/bin
+libdir      ?= $(exec_prefix)/lib
+includedir  ?=      $(prefix)/include/dpdk
+datarootdir ?=      $(prefix)/share
+datadir     ?=       $(datarootdir)/dpdk
+sdkdir      ?=                $(datadir)
+targetdir   ?=                $(datadir)/$(RTE_TARGET)
+
+# The install directories may be staged in DESTDIR
+
+# Create the directory $1 if not exists
+rte_mkdir = test -d $1 || mkdir -p $1
+
+# Create the relative symbolic link $2 -> $1
+# May be replaced with --relative option of ln from coreutils-8.16
+rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
+
 .PHONY: pre_install
 pre_install:
 	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
@@ -57,16 +77,29 @@ pre_install:
 
 .PHONY: install
 install: pre_install
-	@echo ================== Installing $(DESTDIR)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/$T
-	$(Q)tar -C $(BUILD_DIR) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(BUILD_DIR)/app/testpmd \
-	  $(DESTDIR)/$T/app/testpmd
-	@echo Installation in $(DESTDIR) complete
+ifeq ($(DESTDIR)$(if $T,,+),)
+	@echo Installation cannot run with T defined and DESTDIR undefined
+else
+	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
+	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
+	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+		--exclude 'app/cmdline*' --exclude app/test \
+		--exclude app/testacl --exclude app/testpipeline | \
+	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
+	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
+	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
+	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(targetdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk
index f87cf4b..7e7ee14 100644
--- a/mk/rte.vars.mk
+++ b/mk/rte.vars.mk
@@ -61,18 +61,12 @@ ifneq ($(BUILDING_RTE_SDK),)
   RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
   RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)
-  RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
   RTE_SDK_BIN := $(RTE_OUTPUT)
 endif
 
-RTE_LIBNAME := dpdk
+RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
+RTE_LIBNAME := dpdk
 
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 05/12] mk: introduce new install syntax
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (3 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 04/12] mk: install a standard cutomizable tree Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 06/12] mk: split install rule Thomas Monjalon
                     ` (9 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The old install command was:
	make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:
	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T
is not used. It is done only in pre_install to keep compatibility with the
old syntax based on T= option.

The default prefix /usr/local is empty in the T= case which is
used only for a local install.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 doc/build-sdk-quick.txt                          |  7 ++++---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  4 +---
 mk/rte.sdkinstall.mk                             | 12 ++++++++++++
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index 662ef63..acd1bfe 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
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 b0429d8..fb3520e 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -107,8 +107,6 @@ Install Targets
 
 *   Install
 
-    Build the DPDK binary.
-    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).
 
     The GNU standards variables may be used:
@@ -119,7 +117,7 @@ Install Targets
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc prefix=/usr
+        make install DESTDIR=myinstall prefix=/usr
 
 Test Targets
 ------------
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 4816998..6a7aedd 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -33,11 +33,21 @@
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
 
+ifdef T # config, build and install combined
 # The build directory is T and may be prepended with O
 O ?= .
 BUILD_DIR := $O/$T
+else # standard install
+# Build directory is given with O=
+O ?= build
+BUILD_DIR := $O
+endif
 
+ifdef T # defaults with T= will install an almost flat staging tree
+export prefix ?=
+else
 prefix      ?=     /usr/local
+endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
@@ -58,6 +68,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef 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 \
@@ -74,6 +85,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+endif
 
 .PHONY: install
 install: pre_install
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 06/12] mk: split install rule
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (4 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 05/12] mk: introduce new install syntax Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 07/12] mk: install kernel modules Thomas Monjalon
                     ` (8 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install
rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 6a7aedd..509b50e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(targetdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 9fdecf4..ce6b0fc 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -96,6 +96,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 .PHONY: install
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 07/12] mk: install kernel modules
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (5 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 06/12] mk: split install rule Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 08/12] mk: install binding tool in sbin directory Thomas Monjalon
                     ` (7 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

When using "make install T=", the default path is the same as before.

The Linux path is based on host kernel version.

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 509b50e..3daf241 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,9 +43,17 @@ O ?= build
 BUILD_DIR := $O
 endif
 
+include $(RTE_SDK)/mk/rte.vars.mk
+
 ifdef T # defaults with T= will install an almost flat staging tree
 export prefix ?=
+kerneldir   ?= $(prefix)/kmod
+else
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
 else
+kerneldir   ?= /boot/modules
+endif
 prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
@@ -94,6 +102,7 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -110,6 +119,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq ($(wildcard $O/kmod/*),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 08/12] mk: install binding tool in sbin directory
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (6 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 07/12] mk: install kernel modules Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 09/12] mk: install doc Thomas Monjalon
                     ` (6 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py
where some python objects may be generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3daf241..884c915 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -58,6 +58,7 @@ prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -118,6 +119,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq ($(wildcard $O/kmod/*),)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 09/12] mk: install doc
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (7 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 08/12] mk: install binding tool in sbin directory Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 10/12] mk: install examples Thomas Monjalon
                     ` (5 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The HTML API and HTML/PDF guides may be installed if generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 884c915..902a933 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -62,6 +62,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?=                $(datadir)
 targetdir   ?=                $(datadir)/$(RTE_TARGET)
@@ -105,6 +106,7 @@ else
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-doc
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
 
@@ -140,3 +142,15 @@ install-sdk:
 	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+
+install-doc:
+ifneq ($(wildcard $O/doc),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+endif
+ifneq ($(wildcard $O/doc/*/*/*pdf),)
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 10/12] mk: install examples
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (8 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 09/12] mk: install doc Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03 13:19     ` Panu Matilainen
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 11/12] app/proc_info: rename binary with prefix Thomas Monjalon
                     ` (4 subsequent siblings)
  14 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The examples are part of the installed documentation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 902a933..13fa819 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 11/12] app/proc_info: rename binary with prefix
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (9 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 10/12] mk: install examples Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 12/12] pkg: update RPM with standard install Thomas Monjalon
                     ` (3 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

In order to be installed system-wise, this application needs
a prefix. So it makes clear that it is DPDK related.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 app/proc_info/Makefile                 | 2 +-
 doc/guides/sample_app_ug/proc_info.rst | 8 ++++----
 mk/rte.sdktest.mk                      | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/app/proc_info/Makefile b/app/proc_info/Makefile
index 243b060..33e058e 100644
--- a/app/proc_info/Makefile
+++ b/app/proc_info/Makefile
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
diff --git a/doc/guides/sample_app_ug/proc_info.rst b/doc/guides/sample_app_ug/proc_info.rst
index a0c0b06..542950b 100644
--- a/doc/guides/sample_app_ug/proc_info.rst
+++ b/doc/guides/sample_app_ug/proc_info.rst
@@ -30,10 +30,10 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-proc_info Application
-========================
+dpdk_proc_info Application
+==========================
 
-The proc_info application is a Data Plane Development Kit (DPDK) application
+The dpdk_proc_info application is a Data Plane Development Kit (DPDK) application
 that runs as a DPDK secondary process and is capable of retrieving port
 statistics, resetting port statistics and printing DPDK memory information.
 This application extends the original functionality that was supported by
@@ -45,7 +45,7 @@ The application has a number of command line options:
 
 .. code-block:: console
 
-   ./$(RTE_TARGET)/app/proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
+   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
    --stats-reset | --xstats-reset]
 
 Parameters
diff --git a/mk/rte.sdktest.mk b/mk/rte.sdktest.mk
index 59a29de..ee25f28 100644
--- a/mk/rte.sdktest.mk
+++ b/mk/rte.sdktest.mk
@@ -66,7 +66,7 @@ test fast_test ring_test mempool_test perf_test:
 	fi
 
 # this is a special target to ease the pain of running coverage tests
-# this runs all the autotests, cmdline_test script and proc_info
+# this runs all the autotests, cmdline_test script and dpdk_proc_info
 coverage:
 	@mkdir -p $(AUTOTEST_DIR) ; \
 	cd $(AUTOTEST_DIR) ; \
@@ -78,7 +78,7 @@ coverage:
 			$(RTE_OUTPUT)/app/test \
 			$(RTE_TARGET) \
 			$(BLACKLIST) $(WHITELIST) ; \
-		$(RTE_OUTPUT)/app/proc_info --file-prefix=ring_perf -- -m; \
+		$(RTE_OUTPUT)/app/dpdk_proc_info --file-prefix=ring_perf -- -m; \
 	else \
 		echo "No test found, please do a 'make build' first, or specify O=" ;\
 	fi
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v2 12/12] pkg: update RPM with standard install
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (10 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 11/12] app/proc_info: rename binary with prefix Thomas Monjalon
@ 2015-12-03  5:02   ` Thomas Monjalon
  2015-12-03 10:57   ` [dpdk-dev] [PATCH v2 00/12] standard make install Bruce Richardson
                     ` (2 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03  5:02 UTC (permalink / raw)
  To: dev

The "make install" is more standard now.
So the recipe can be simplified.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 pkg/dpdk.spec | 59 ++++++++++++++++-------------------------------------------
 1 file changed, 16 insertions(+), 43 deletions(-)

diff --git a/pkg/dpdk.spec b/pkg/dpdk.spec
index 7437025..e68985f 100644
--- a/pkg/dpdk.spec
+++ b/pkg/dpdk.spec
@@ -41,8 +41,9 @@ Group: System Environment/Libraries
 License: BSD and LGPLv2 and GPLv2
 
 ExclusiveArch: i686, x86_64
-%global target %{_arch}-native-linuxapp-gcc
 %global machine default
+%global target %{_arch}-%{machine}-linuxapp-gcc
+%global config %{_arch}-native-linuxapp-gcc
 
 BuildRequires: kernel-devel, kernel-headers, libpcap-devel, xen-devel
 BuildRequires: doxygen, python-sphinx, inkscape
@@ -69,16 +70,11 @@ BuildArch: noarch
 DPDK doc is divided in two parts: API details in doxygen HTML format
 and guides in sphinx HTML/PDF formats.
 
-%global destdir %{buildroot}%{_prefix}
-%global moddir  /lib/modules/%(uname -r)/extra
-%global datadir %{_datadir}/dpdk
-%global docdir  %{_docdir}/dpdk
-
 %prep
 %setup -q
 
 %build
-make O=%{target} T=%{target} config
+make O=%{target} T=%{config} config
 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
@@ -93,51 +89,28 @@ make O=%{target} doc
 
 %install
 rm -rf %{buildroot}
-make            O=%{target}      DESTDIR=%{destdir}
-mkdir -p                                 %{buildroot}%{moddir}
-mv     %{destdir}/%{target}/kmod/*.ko    %{buildroot}%{moddir}
-rmdir  %{destdir}/%{target}/kmod
-mkdir -p                                 %{buildroot}%{_sbindir}
-ln -s  %{datadir}/tools/*nic_bind.py     %{buildroot}%{_sbindir}/dpdk_nic_bind
-mkdir -p                                 %{buildroot}%{_bindir}
-mv     %{destdir}/%{target}/app/testpmd  %{buildroot}%{_bindir}
-rmdir  %{destdir}/%{target}/app
-mv     %{destdir}/%{target}/include      %{buildroot}%{_includedir}
-mv     %{destdir}/%{target}/lib          %{buildroot}%{_libdir}
-mkdir -p                                 %{buildroot}%{docdir}
-rm -rf %{destdir}/%{target}/doc/*/*/.{build,doc}*
-mv     %{destdir}/%{target}/doc/html/*   %{buildroot}%{docdir}
-mv     %{destdir}/%{target}/doc/*/*/*pdf %{buildroot}%{docdir}/guides
-rm -rf %{destdir}/%{target}/doc
-mkdir -p                                 %{buildroot}%{datadir}
-mv     %{destdir}/%{target}/.config      %{buildroot}%{datadir}/config
-mv     %{destdir}/%{target}              %{buildroot}%{datadir}
-mv     %{destdir}/scripts                %{buildroot}%{datadir}
-mv     %{destdir}/mk                     %{buildroot}%{datadir}
-cp -a             examples               %{buildroot}%{datadir}
-cp -a             tools                  %{buildroot}%{datadir}
-ln -s             %{datadir}/config      %{buildroot}%{datadir}/%{target}/.config
-ln -s             %{_includedir}         %{buildroot}%{datadir}/%{target}/include
-ln -s             %{_libdir}             %{buildroot}%{datadir}/%{target}/lib
+make install O=%{target} DESTDIR=%{buildroot} \
+	prefix=%{_prefix} bindir=%{_bindir} sbindir=%{_sbindir} \
+	includedir=%{_includedir}/dpdk libdir=%{_libdir} \
+	datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk
 
 %files
-%dir %{datadir}
-%{datadir}/config
-%{datadir}/tools
-%{moddir}/*
+%dir %{_datadir}/dpdk
+%{_datadir}/dpdk/tools
+/lib/modules/%(uname -r)/extra/*
 %{_sbindir}/*
 %{_bindir}/*
 %{_libdir}/*
 
 %files devel
-%{_includedir}/*
-%{datadir}/mk
-%{datadir}/scripts
-%{datadir}/%{target}
-%{datadir}/examples
+%{_includedir}/dpdk
+%{_datadir}/dpdk/mk
+%{_datadir}/dpdk/scripts
+%{_datadir}/dpdk/%{target}
+%{_datadir}/dpdk/examples
 
 %files doc
-%doc %{docdir}
+%doc %{_docdir}/dpdk
 
 %post
 /sbin/ldconfig
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (11 preceding siblings ...)
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 12/12] pkg: update RPM with standard install Thomas Monjalon
@ 2015-12-03 10:57   ` Bruce Richardson
  2015-12-03 11:02     ` Thomas Monjalon
  2015-12-03 13:26   ` Panu Matilainen
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
  14 siblings, 1 reply; 67+ messages in thread
From: Bruce Richardson @ 2015-12-03 10:57 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Thu, Dec 03, 2015 at 06:01:57AM +0100, Thomas Monjalon wrote:
> Following the recent discussions, this is a proposal to have a standard
> installation process while keeping compatibility with most of the old
> behaviours.
>
How compatible are we looking for here. The standard way of compiling up DPDK
up till now has always been "make install T=$RTE_TARGET", but that seems to no
longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc

bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2

When I look for backward compatibilty, this is the main thing I look for, as I'm
not aware of anyone (on my team here at least!) who does a make config first etc. 
When developing, most people just do a "make install T=..."straight up.

/Bruce

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 10:57   ` [dpdk-dev] [PATCH v2 00/12] standard make install Bruce Richardson
@ 2015-12-03 11:02     ` Thomas Monjalon
  2015-12-03 11:06       ` Thomas Monjalon
  2015-12-03 11:07       ` Bruce Richardson
  0 siblings, 2 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 11:02 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

2015-12-03 10:57, Bruce Richardson:
> On Thu, Dec 03, 2015 at 06:01:57AM +0100, Thomas Monjalon wrote:
> > Following the recent discussions, this is a proposal to have a standard
> > installation process while keeping compatibility with most of the old
> > behaviours.
> >
> How compatible are we looking for here. The standard way of compiling up DPDK
> up till now has always been "make install T=$RTE_TARGET", but that seems to no
> longer work.
> 
> bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
> x86_64-native-linuxapp-gcc
> 
> bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
> /home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
> /home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
> /home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
> make: *** [install] Error 2
> 
> When I look for backward compatibilty, this is the main thing I look for, as I'm
> not aware of anyone (on my team here at least!) who does a make config first etc. 
> When developing, most people just do a "make install T=..."straight up.

I agree.
And it works on my machine.
I'd like to understand what is the problem on yours.

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 11:02     ` Thomas Monjalon
@ 2015-12-03 11:06       ` Thomas Monjalon
  2015-12-03 11:10         ` Bruce Richardson
  2015-12-03 11:07       ` Bruce Richardson
  1 sibling, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 11:06 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

2015-12-03 12:02, Thomas Monjalon:
> 2015-12-03 10:57, Bruce Richardson:
> > On Thu, Dec 03, 2015 at 06:01:57AM +0100, Thomas Monjalon wrote:
> > > Following the recent discussions, this is a proposal to have a standard
> > > installation process while keeping compatibility with most of the old
> > > behaviours.
> > >
> > How compatible are we looking for here. The standard way of compiling up DPDK
> > up till now has always been "make install T=$RTE_TARGET", but that seems to no
> > longer work.
> > 
> > bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
> > x86_64-native-linuxapp-gcc
> > 
> > bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
> > /home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
> > /home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
> > /home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
> > make: *** [install] Error 2
> > 
> > When I look for backward compatibilty, this is the main thing I look for, as I'm
> > not aware of anyone (on my team here at least!) who does a make config first etc. 
> > When developing, most people just do a "make install T=..."straight up.
> 
> I agree.
> And it works on my machine.
> I'd like to understand what is the problem on yours.

My bad. When deleting build/.config, the bug appears.
I will fix it. Sorry for the inconvenience.

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 11:02     ` Thomas Monjalon
  2015-12-03 11:06       ` Thomas Monjalon
@ 2015-12-03 11:07       ` Bruce Richardson
  1 sibling, 0 replies; 67+ messages in thread
From: Bruce Richardson @ 2015-12-03 11:07 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Thu, Dec 03, 2015 at 12:02:42PM +0100, Thomas Monjalon wrote:
> 2015-12-03 10:57, Bruce Richardson:
> > On Thu, Dec 03, 2015 at 06:01:57AM +0100, Thomas Monjalon wrote:
> > > Following the recent discussions, this is a proposal to have a standard
> > > installation process while keeping compatibility with most of the old
> > > behaviours.
> > >
> > How compatible are we looking for here. The standard way of compiling up DPDK
> > up till now has always been "make install T=$RTE_TARGET", but that seems to no
> > longer work.
> > 
> > bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
> > x86_64-native-linuxapp-gcc
> > 
> > bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
> > /home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
> > /home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
> > /home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
> > make: *** [install] Error 2
> > 
> > When I look for backward compatibilty, this is the main thing I look for, as I'm
> > not aware of anyone (on my team here at least!) who does a make config first etc. 
> > When developing, most people just do a "make install T=..."straight up.
> 
> I agree.
> And it works on my machine.
> I'd like to understand what is the problem on yours.

Ok, it must be a local problem on my end so. I'll investigate and see if I can
see what the issue is - maybe some leftover files from previous builds or
something. I'll try with a clean clone.

/Bruce

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 11:06       ` Thomas Monjalon
@ 2015-12-03 11:10         ` Bruce Richardson
  0 siblings, 0 replies; 67+ messages in thread
From: Bruce Richardson @ 2015-12-03 11:10 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Thu, Dec 03, 2015 at 12:06:41PM +0100, Thomas Monjalon wrote:
> 2015-12-03 12:02, Thomas Monjalon:
> > 2015-12-03 10:57, Bruce Richardson:
> > > On Thu, Dec 03, 2015 at 06:01:57AM +0100, Thomas Monjalon wrote:
> > > > Following the recent discussions, this is a proposal to have a standard
> > > > installation process while keeping compatibility with most of the old
> > > > behaviours.
> > > >
> > > How compatible are we looking for here. The standard way of compiling up DPDK
> > > up till now has always been "make install T=$RTE_TARGET", but that seems to no
> > > longer work.
> > > 
> > > bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
> > > x86_64-native-linuxapp-gcc
> > > 
> > > bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
> > > /home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
> > > /home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
> > > /home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
> > > make: *** [install] Error 2
> > > 
> > > When I look for backward compatibilty, this is the main thing I look for, as I'm
> > > not aware of anyone (on my team here at least!) who does a make config first etc. 
> > > When developing, most people just do a "make install T=..."straight up.
> > 
> > I agree.
> > And it works on my machine.
> > I'd like to understand what is the problem on yours.
> 
> My bad. When deleting build/.config, the bug appears.
> I will fix it. Sorry for the inconvenience.

Thanks, saves me from doing further digging. :-)

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 10/12] mk: install examples
  2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 10/12] mk: install examples Thomas Monjalon
@ 2015-12-03 13:19     ` Panu Matilainen
  2015-12-03 13:32       ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-03 13:19 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/03/2015 07:02 AM, Thomas Monjalon wrote:
> The examples are part of the installed documentation.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>   mk/rte.sdkinstall.mk | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 902a933..13fa819 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
>   	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
>   	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
>   endif
> +	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
>

If examples are considered documentation (and I agree on that), then 
shouldn't they be installed in $(docdir) instead?

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (12 preceding siblings ...)
  2015-12-03 10:57   ` [dpdk-dev] [PATCH v2 00/12] standard make install Bruce Richardson
@ 2015-12-03 13:26   ` Panu Matilainen
  2015-12-03 13:34     ` Thomas Monjalon
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
  14 siblings, 1 reply; 67+ messages in thread
From: Panu Matilainen @ 2015-12-03 13:26 UTC (permalink / raw)
  To: Thomas Monjalon, dev

On 12/03/2015 07:01 AM, Thomas Monjalon wrote:
> Following the recent discussions, this is a proposal to have a standard
> installation process while keeping compatibility with most of the old
> behaviours.
>
> v2 changes:
> - fix default build dir
> - RTE_TARGET subdir in $(sdkdir).
> - better kerneldir defaults
> - fix dpdk_nic_bind symlink
> - always install doc if generated
> - doc
> - pkg/dpdk.spec
>

Except for the minor nit about examples location (one could bikeshed on 
things like these forever), seems fine to me and quick-n-dirty 
conversion of my own spec didn't reveal any nasty surprises.

It also appears more comprehensive and integrated with other workflows 
than the competing patches so FWIW, you have my ACK :)

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 10/12] mk: install examples
  2015-12-03 13:19     ` Panu Matilainen
@ 2015-12-03 13:32       ` Thomas Monjalon
  2015-12-03 13:35         ` Panu Matilainen
  0 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:32 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-12-03 15:19, Panu Matilainen:
> On 12/03/2015 07:02 AM, Thomas Monjalon wrote:
> > The examples are part of the installed documentation.
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> > ---
> >   mk/rte.sdkinstall.mk | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> > index 902a933..13fa819 100644
> > --- a/mk/rte.sdkinstall.mk
> > +++ b/mk/rte.sdkinstall.mk
> > @@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
> >   	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
> >   	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
> >   endif
> > +	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
> >
> 
> If examples are considered documentation (and I agree on that), then 
> shouldn't they be installed in $(docdir) instead?

I was hesitating. I think it's strange to install some code in
/usr/share/doc/.
It's not really important and may be changed easily at any time.

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 13:26   ` Panu Matilainen
@ 2015-12-03 13:34     ` Thomas Monjalon
  2015-12-03 15:52       ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:34 UTC (permalink / raw)
  To: Panu Matilainen, Mario Carrillo; +Cc: dev

2015-12-03 15:26, Panu Matilainen:
> On 12/03/2015 07:01 AM, Thomas Monjalon wrote:
> > Following the recent discussions, this is a proposal to have a standard
> > installation process while keeping compatibility with most of the old
> > behaviours.
> >
> > v2 changes:
> > - fix default build dir
> > - RTE_TARGET subdir in $(sdkdir).
> > - better kerneldir defaults
> > - fix dpdk_nic_bind symlink
> > - always install doc if generated
> > - doc
> > - pkg/dpdk.spec
> >
> 
> Except for the minor nit about examples location (one could bikeshed on 
> things like these forever), seems fine to me and quick-n-dirty 
> conversion of my own spec didn't reveal any nasty surprises.
> 
> It also appears more comprehensive and integrated with other workflows 
> than the competing patches so FWIW, you have my ACK :)

Thank you.
I'm going to send a v3.
Mario, what is your opinion about this series?

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 10/12] mk: install examples
  2015-12-03 13:32       ` Thomas Monjalon
@ 2015-12-03 13:35         ` Panu Matilainen
  0 siblings, 0 replies; 67+ messages in thread
From: Panu Matilainen @ 2015-12-03 13:35 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 12/03/2015 03:32 PM, Thomas Monjalon wrote:
> 2015-12-03 15:19, Panu Matilainen:
>> On 12/03/2015 07:02 AM, Thomas Monjalon wrote:
>>> The examples are part of the installed documentation.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
>>> ---
>>>    mk/rte.sdkinstall.mk | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
>>> index 902a933..13fa819 100644
>>> --- a/mk/rte.sdkinstall.mk
>>> +++ b/mk/rte.sdkinstall.mk
>>> @@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
>>>    	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
>>>    	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
>>>    endif
>>> +	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
>>>
>>
>> If examples are considered documentation (and I agree on that), then
>> shouldn't they be installed in $(docdir) instead?
>
> I was hesitating. I think it's strange to install some code in
> /usr/share/doc/.
> It's not really important and may be changed easily at any time.
>

Installing source code anywhere at all seems a bit strange, being in doc 
seems like the least-worst alternative to me :) But like said, no big deal.

	- Panu -

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 00/13] standard make install
  2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
                     ` (13 preceding siblings ...)
  2015-12-03 13:26   ` Panu Matilainen
@ 2015-12-03 13:45   ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 01/13] mk: remove testall Thomas Monjalon
                       ` (14 more replies)
  14 siblings, 15 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

Following the recent discussions, this is a proposal to have a standard
installation process while keeping compatibility with most of the old
behaviours.

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

v3 changes:
- fix install in a clean dir
- take responsibility in MAINTAINERS

More details below and in the commit messages.

These variables can be overriden:

kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
prefix      ?=     /usr/local
exec_prefix ?=      $(prefix)
bindir      ?= $(exec_prefix)/bin
sbindir     ?= $(exec_prefix)/sbin
libdir      ?= $(exec_prefix)/lib
includedir  ?=      $(prefix)/include/dpdk
datarootdir ?=      $(prefix)/share
docdir      ?=       $(datarootdir)/doc/dpdk
datadir     ?=       $(datarootdir)/dpdk
sdkdir      ?=                $(datadir)
targetdir   ?=                $(datadir)/$(RTE_TARGET)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk install-doc

--------

System-wise install example with
    DESTDIR=
    prefix=/usr
    kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/tools/

# make install-kmod
/lib/modules/kver/extra/

# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/

# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/guides/
/usr/share/dpdk/examples/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py
install/share/doc/dpdk/
install/share/dpdk/examples/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/
install/share/dpdk/x86_64-native-linuxapp-gcc/.config
install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
install/share/dpdk/x86_64-native-linuxapp-gcc/lib     -> install/lib/

It should be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.

--------

Thomas Monjalon (13):
  mk: remove testall
  mk: remove multi-target install
  mk: move installation procedure in install rule
  mk: install a standard cutomizable tree
  mk: introduce new install syntax
  mk: split install rule
  mk: install kernel modules
  mk: install binding tool in sbin directory
  mk: install doc
  mk: install examples
  app/proc_info: rename binary with prefix
  pkg: update RPM with standard install
  maintainers: take responsibility for build system

 MAINTAINERS                                      |   2 +-
 app/proc_info/Makefile                           |   2 +-
 doc/build-sdk-quick.txt                          |  11 +-
 doc/guides/linux_gsg/build_dpdk.rst              |  16 ---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  28 +----
 doc/guides/sample_app_ug/proc_info.rst           |   8 +-
 mk/internal/rte.extvars.mk                       |   4 +
 mk/rte.sdkbuild.mk                               |  16 ---
 mk/rte.sdkinstall.mk                             | 150 +++++++++++++++++------
 mk/rte.sdkroot.mk                                |  11 +-
 mk/rte.sdktest.mk                                |   4 +-
 mk/rte.sdktestall.mk                             |  57 ---------
 mk/rte.vars.mk                                   |  10 +-
 pkg/dpdk.spec                                    |  59 +++------
 tools/setup.sh                                   |  31 ++---
 15 files changed, 167 insertions(+), 242 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk

-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 01/13] mk: remove testall
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 02/13] mk: remove multi-target install Thomas Monjalon
                       ` (13 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

It is not possible to test every configs on an unique machine.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 13 ------
 mk/rte.sdkroot.mk                                |  4 --
 mk/rte.sdktestall.mk                             | 57 ------------------------
 3 files changed, 74 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk

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 a5cd196..e02c544 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -138,19 +138,6 @@ Test Targets
 
         make test O=mybuild
 
-*   testall
-
-    Launch automatic tests for all installed target directories (after a make install).
-    The name of the targets to test can be optionally specified using T=mytarget.
-    The target name can contain wildcard (\*) characters.
-    The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_  prefix).
-
-    Examples:
-
-    .. code-block:: console
-
-        make testall, make testall T=x86_64-*
-
 Documentation Targets
 ---------------------
 
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..0e97308 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -93,10 +93,6 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: testall
-testall:
-	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
-
 .PHONY: install uninstall
 install uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
diff --git a/mk/rte.sdktestall.mk b/mk/rte.sdktestall.mk
deleted file mode 100644
index 9e7f775..0000000
--- a/mk/rte.sdktestall.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#   BSD LICENSE
-#
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
-#   All rights reserved.
-#
-#   Redistribution and use in source and binary forms, with or without
-#   modification, are permitted provided that the following conditions
-#   are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in
-#       the documentation and/or other materials provided with the
-#       distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-ifdef O
-ifeq ("$(origin O)", "command line")
-$(error "Cannot use O= with testall target")
-endif
-endif
-
-# Targets to test 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
-
-#
-# testall: launch test for all supported targets
-#
-TESTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
-	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-TESTALL_TARGETS := $(addsuffix _testall,\
-	$(filter-out %~,$(TESTALL_CONFIGS)))
-.PHONY: testall
-testall: $(TESTALL_TARGETS)
-
-%_testall:
-	@echo ================== Test $*
-	$(Q)$(MAKE) fast_test O=$*
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 02/13] mk: remove multi-target install
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 01/13] mk: remove testall Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 03/13] mk: move installation procedure in install rule Thomas Monjalon
                       ` (12 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

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.

The variable BUILD_DIR is also renamed to RTE_OUTPUT used in other files.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.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..0b80104 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 ?= .
+RTE_OUTPUT := $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 $(RTE_OUTPUT)/.config ]; then \
+		$(MAKE) config O=$(RTE_OUTPUT); \
+	elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
+		$(MAKE) config O=$(RTE_OUTPUT); \
 	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 $(RTE_OUTPUT)/.config.orig ] ; then \
+			tmp_build=$(RTE_OUTPUT)/.config.tmp; \
+			$(MAKE) config O=$$tmp_build; \
+			if ! cmp -s $(RTE_OUTPUT)/.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=$(RTE_OUTPUT)
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

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 03/13] mk: move installation procedure in install rule
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 01/13] mk: remove testall Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 02/13] mk: remove multi-target install Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 04/13] mk: install a standard cutomizable tree Thomas Monjalon
                       ` (11 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The real installation was called "binary install" and was done
after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 mk/rte.sdkroot.mk    |  1 +
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index 38ec7bd..85f603c 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 0b80104..c5d0881 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -36,9 +36,8 @@
 O ?= .
 RTE_OUTPUT := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
 		$(MAKE) config O=$(RTE_OUTPUT); \
 	elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
@@ -55,3 +54,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(RTE_OUTPUT)
+
+.PHONY: install
+install:
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(RTE_OUTPUT) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 9fdecf4..533afe9 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -95,6 +95,7 @@ test fast_test ring_test mempool_test perf_test coverage:
 
 .PHONY: install
 install:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 04/13] mk: install a standard cutomizable tree
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (2 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 03/13] mk: move installation procedure in install rule Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 05/13] mk: introduce new install syntax Thomas Monjalon
                       ` (10 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The rule "install" follows these conventions:
http://gnu.org/prep/standards/html_node/Directory-Variables.html
http://gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones,
to configure the directory used with RTE_SDK when using the DPDK makefiles
to build an application.

It is still possible to build DPDK with the "install T=" rule without
specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:
    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc
RTE_TARGET can be specified but is useless now with an installed SDK.
The RTE_SDK directory must now point to a different path depending of
the installation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 doc/build-sdk-quick.txt                          |  1 +
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  6 ++-
 mk/internal/rte.extvars.mk                       |  4 ++
 mk/rte.sdkinstall.mk                             | 59 ++++++++++++++++++------
 mk/rte.vars.mk                                   | 10 +---
 5 files changed, 58 insertions(+), 22 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index b5f752e..662ef63 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
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 458fc91..b0429d8 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -111,11 +111,15 @@ Install Targets
     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).
 
+    The GNU standards variables may be used:
+    http://gnu.org/prep/standards/html_node/Directory-Variables.html and
+    http://gnu.org/prep/standards/html_node/DESTDIR.html
+
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc
+        make install T=x86_64-native-linuxapp-gcc prefix=/usr
 
 Test Targets
 ------------
diff --git a/mk/internal/rte.extvars.mk b/mk/internal/rte.extvars.mk
index e248d19..040d39f 100644
--- a/mk/internal/rte.extvars.mk
+++ b/mk/internal/rte.extvars.mk
@@ -51,7 +51,11 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
 
 #
 # Output files wil go in a separate directory: default output is
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c5d0881..3201b5b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -1,6 +1,7 @@
 #   BSD LICENSE
 #
 #   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright 2015 6WIND S.A.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -36,6 +37,25 @@
 O ?= .
 RTE_OUTPUT := $O/$T
 
+prefix      ?=     /usr/local
+exec_prefix ?=      $(prefix)
+bindir      ?= $(exec_prefix)/bin
+libdir      ?= $(exec_prefix)/lib
+includedir  ?=      $(prefix)/include/dpdk
+datarootdir ?=      $(prefix)/share
+datadir     ?=       $(datarootdir)/dpdk
+sdkdir      ?=                $(datadir)
+targetdir   ?=                $(datadir)/$(RTE_TARGET)
+
+# The install directories may be staged in DESTDIR
+
+# Create the directory $1 if not exists
+rte_mkdir = test -d $1 || mkdir -p $1
+
+# Create the relative symbolic link $2 -> $1
+# May be replaced with --relative option of ln from coreutils-8.16
+rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
+
 .PHONY: pre_install
 pre_install:
 	$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
@@ -57,16 +77,29 @@ pre_install:
 
 .PHONY: install
 install:
-	@echo ================== Installing $(DESTDIR)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/$T
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/$T/app/testpmd
-	@echo Installation in $(DESTDIR) complete
+ifeq ($(DESTDIR)$(if $T,,+),)
+	@echo Installation cannot run with T defined and DESTDIR undefined
+else
+	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
+	$(Q)cp -a $(RTE_OUTPUT)/lib/* $(DESTDIR)$(libdir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
+	$(Q)tar -cf -      -C $(RTE_OUTPUT) app  --exclude 'app/*.map' \
+		--exclude 'app/cmdline*' --exclude app/test \
+		--exclude app/testacl --exclude app/testpipeline | \
+	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
+	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
+	$(Q)tar -chf -     -C $(RTE_OUTPUT) include | \
+	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
+	$(Q)cp -a               $(RTE_OUTPUT)/.config    $(DESTDIR)$(targetdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk
index f87cf4b..7e7ee14 100644
--- a/mk/rte.vars.mk
+++ b/mk/rte.vars.mk
@@ -61,18 +61,12 @@ ifneq ($(BUILDING_RTE_SDK),)
   RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
   RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)
-  RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
   RTE_SDK_BIN := $(RTE_OUTPUT)
 endif
 
-RTE_LIBNAME := dpdk
+RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
+RTE_LIBNAME := dpdk
 
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 05/13] mk: introduce new install syntax
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (3 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 04/13] mk: install a standard cutomizable tree Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 06/13] mk: split install rule Thomas Monjalon
                       ` (9 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The old install command was:
	make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:
	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T
is not used. It is done only in pre_install to keep compatibility with the
old syntax based on T= option.

The default prefix /usr/local is empty in the T= case which is
used only for a local install.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 doc/build-sdk-quick.txt                          |  7 ++++---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  4 +---
 mk/rte.sdkinstall.mk                             | 12 ++++++++++++
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index 662ef63..acd1bfe 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
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 b0429d8..fb3520e 100644
--- a/doc/guides/prog_guide/dev_kit_root_make_help.rst
+++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst
@@ -107,8 +107,6 @@ Install Targets
 
 *   Install
 
-    Build the DPDK binary.
-    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).
 
     The GNU standards variables may be used:
@@ -119,7 +117,7 @@ Install Targets
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc prefix=/usr
+        make install DESTDIR=myinstall prefix=/usr
 
 Test Targets
 ------------
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3201b5b..dc57baf 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -33,11 +33,21 @@
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
 
+ifdef T # config, build and install combined
 # The build directory is T and may be prepended with O
 O ?= .
 RTE_OUTPUT := $O/$T
+else # standard install
+# Build directory is given with O=
+O ?= build
+RTE_OUTPUT := $O
+endif
 
+ifdef T # defaults with T= will install an almost flat staging tree
+export prefix ?=
+else
 prefix      ?=     /usr/local
+endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
@@ -58,6 +68,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef T
 	$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
 		$(MAKE) config O=$(RTE_OUTPUT); \
 	elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
@@ -74,6 +85,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(RTE_OUTPUT)
+endif
 
 .PHONY: install
 install:
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 06/13] mk: split install rule
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (4 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 05/13] mk: introduce new install syntax Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-07 23:22       ` Arevalo, Mario Alfredo C
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 07/13] mk: install kernel modules Thomas Monjalon
                       ` (8 subsequent siblings)
  14 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install
rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index dc57baf..ec093d3 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(RTE_OUTPUT)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(RTE_OUTPUT) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(RTE_OUTPUT) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-	$(Q)cp -a               $(RTE_OUTPUT)/.config    $(DESTDIR)$(targetdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 533afe9..2424dce 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,6 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 07/13] mk: install kernel modules
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (5 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 06/13] mk: split install rule Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 08/13] mk: install binding tool in sbin directory Thomas Monjalon
                       ` (7 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

When using "make install T=", the default path is the same as before.

The Linux path is based on host kernel version.

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ec093d3..30dea0f 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,9 +43,19 @@ O ?= build
 RTE_OUTPUT := $O
 endif
 
+ifneq ($(MAKECMDGOALS),pre_install)
+include $(RTE_SDK)/mk/rte.vars.mk
+endif
+
 ifdef T # defaults with T= will install an almost flat staging tree
 export prefix ?=
+kerneldir   ?= $(prefix)/kmod
+else
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
 else
+kerneldir   ?= /boot/modules
+endif
 prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
@@ -94,6 +104,7 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -110,6 +121,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq ($(wildcard $O/kmod/*),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 08/13] mk: install binding tool in sbin directory
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (6 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 07/13] mk: install kernel modules Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 09/13] mk: install doc Thomas Monjalon
                       ` (6 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py
where some python objects may be generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 30dea0f..0667b70 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -60,6 +60,7 @@ prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -120,6 +121,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq ($(wildcard $O/kmod/*),)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 09/13] mk: install doc
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (7 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 08/13] mk: install binding tool in sbin directory Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 10/13] mk: install examples Thomas Monjalon
                       ` (5 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The HTML API and HTML/PDF guides may be installed if generated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 0667b70..ce077a4 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -64,6 +64,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?=                $(datadir)
 targetdir   ?=                $(datadir)/$(RTE_TARGET)
@@ -107,6 +108,7 @@ else
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-doc
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
 
@@ -142,3 +144,15 @@ install-sdk:
 	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+
+install-doc:
+ifneq ($(wildcard $O/doc),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+endif
+ifneq ($(wildcard $O/doc/*/*/*pdf),)
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 10/13] mk: install examples
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (8 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 09/13] mk: install doc Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 11/13] app/proc_info: rename binary with prefix Thomas Monjalon
                       ` (4 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The examples are part of the installed documentation.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ce077a4..c611d45 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -156,3 +156,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 11/13] app/proc_info: rename binary with prefix
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (9 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 10/13] mk: install examples Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 12/13] pkg: update RPM with standard install Thomas Monjalon
                       ` (3 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

In order to be installed system-wise, this application needs
a prefix. So it makes clear that it is DPDK related.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 app/proc_info/Makefile                 | 2 +-
 doc/guides/sample_app_ug/proc_info.rst | 8 ++++----
 mk/rte.sdktest.mk                      | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/app/proc_info/Makefile b/app/proc_info/Makefile
index 243b060..33e058e 100644
--- a/app/proc_info/Makefile
+++ b/app/proc_info/Makefile
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
diff --git a/doc/guides/sample_app_ug/proc_info.rst b/doc/guides/sample_app_ug/proc_info.rst
index a0c0b06..542950b 100644
--- a/doc/guides/sample_app_ug/proc_info.rst
+++ b/doc/guides/sample_app_ug/proc_info.rst
@@ -30,10 +30,10 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-proc_info Application
-========================
+dpdk_proc_info Application
+==========================
 
-The proc_info application is a Data Plane Development Kit (DPDK) application
+The dpdk_proc_info application is a Data Plane Development Kit (DPDK) application
 that runs as a DPDK secondary process and is capable of retrieving port
 statistics, resetting port statistics and printing DPDK memory information.
 This application extends the original functionality that was supported by
@@ -45,7 +45,7 @@ The application has a number of command line options:
 
 .. code-block:: console
 
-   ./$(RTE_TARGET)/app/proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
+   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
    --stats-reset | --xstats-reset]
 
 Parameters
diff --git a/mk/rte.sdktest.mk b/mk/rte.sdktest.mk
index 59a29de..ee25f28 100644
--- a/mk/rte.sdktest.mk
+++ b/mk/rte.sdktest.mk
@@ -66,7 +66,7 @@ test fast_test ring_test mempool_test perf_test:
 	fi
 
 # this is a special target to ease the pain of running coverage tests
-# this runs all the autotests, cmdline_test script and proc_info
+# this runs all the autotests, cmdline_test script and dpdk_proc_info
 coverage:
 	@mkdir -p $(AUTOTEST_DIR) ; \
 	cd $(AUTOTEST_DIR) ; \
@@ -78,7 +78,7 @@ coverage:
 			$(RTE_OUTPUT)/app/test \
 			$(RTE_TARGET) \
 			$(BLACKLIST) $(WHITELIST) ; \
-		$(RTE_OUTPUT)/app/proc_info --file-prefix=ring_perf -- -m; \
+		$(RTE_OUTPUT)/app/dpdk_proc_info --file-prefix=ring_perf -- -m; \
 	else \
 		echo "No test found, please do a 'make build' first, or specify O=" ;\
 	fi
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 12/13] pkg: update RPM with standard install
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (10 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 11/13] app/proc_info: rename binary with prefix Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system Thomas Monjalon
                       ` (2 subsequent siblings)
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

The "make install" is more standard now.
So the recipe can be simplified.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 pkg/dpdk.spec | 59 ++++++++++++++++-------------------------------------------
 1 file changed, 16 insertions(+), 43 deletions(-)

diff --git a/pkg/dpdk.spec b/pkg/dpdk.spec
index 7437025..e68985f 100644
--- a/pkg/dpdk.spec
+++ b/pkg/dpdk.spec
@@ -41,8 +41,9 @@ Group: System Environment/Libraries
 License: BSD and LGPLv2 and GPLv2
 
 ExclusiveArch: i686, x86_64
-%global target %{_arch}-native-linuxapp-gcc
 %global machine default
+%global target %{_arch}-%{machine}-linuxapp-gcc
+%global config %{_arch}-native-linuxapp-gcc
 
 BuildRequires: kernel-devel, kernel-headers, libpcap-devel, xen-devel
 BuildRequires: doxygen, python-sphinx, inkscape
@@ -69,16 +70,11 @@ BuildArch: noarch
 DPDK doc is divided in two parts: API details in doxygen HTML format
 and guides in sphinx HTML/PDF formats.
 
-%global destdir %{buildroot}%{_prefix}
-%global moddir  /lib/modules/%(uname -r)/extra
-%global datadir %{_datadir}/dpdk
-%global docdir  %{_docdir}/dpdk
-
 %prep
 %setup -q
 
 %build
-make O=%{target} T=%{target} config
+make O=%{target} T=%{config} config
 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
@@ -93,51 +89,28 @@ make O=%{target} doc
 
 %install
 rm -rf %{buildroot}
-make            O=%{target}      DESTDIR=%{destdir}
-mkdir -p                                 %{buildroot}%{moddir}
-mv     %{destdir}/%{target}/kmod/*.ko    %{buildroot}%{moddir}
-rmdir  %{destdir}/%{target}/kmod
-mkdir -p                                 %{buildroot}%{_sbindir}
-ln -s  %{datadir}/tools/*nic_bind.py     %{buildroot}%{_sbindir}/dpdk_nic_bind
-mkdir -p                                 %{buildroot}%{_bindir}
-mv     %{destdir}/%{target}/app/testpmd  %{buildroot}%{_bindir}
-rmdir  %{destdir}/%{target}/app
-mv     %{destdir}/%{target}/include      %{buildroot}%{_includedir}
-mv     %{destdir}/%{target}/lib          %{buildroot}%{_libdir}
-mkdir -p                                 %{buildroot}%{docdir}
-rm -rf %{destdir}/%{target}/doc/*/*/.{build,doc}*
-mv     %{destdir}/%{target}/doc/html/*   %{buildroot}%{docdir}
-mv     %{destdir}/%{target}/doc/*/*/*pdf %{buildroot}%{docdir}/guides
-rm -rf %{destdir}/%{target}/doc
-mkdir -p                                 %{buildroot}%{datadir}
-mv     %{destdir}/%{target}/.config      %{buildroot}%{datadir}/config
-mv     %{destdir}/%{target}              %{buildroot}%{datadir}
-mv     %{destdir}/scripts                %{buildroot}%{datadir}
-mv     %{destdir}/mk                     %{buildroot}%{datadir}
-cp -a             examples               %{buildroot}%{datadir}
-cp -a             tools                  %{buildroot}%{datadir}
-ln -s             %{datadir}/config      %{buildroot}%{datadir}/%{target}/.config
-ln -s             %{_includedir}         %{buildroot}%{datadir}/%{target}/include
-ln -s             %{_libdir}             %{buildroot}%{datadir}/%{target}/lib
+make install O=%{target} DESTDIR=%{buildroot} \
+	prefix=%{_prefix} bindir=%{_bindir} sbindir=%{_sbindir} \
+	includedir=%{_includedir}/dpdk libdir=%{_libdir} \
+	datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk
 
 %files
-%dir %{datadir}
-%{datadir}/config
-%{datadir}/tools
-%{moddir}/*
+%dir %{_datadir}/dpdk
+%{_datadir}/dpdk/tools
+/lib/modules/%(uname -r)/extra/*
 %{_sbindir}/*
 %{_bindir}/*
 %{_libdir}/*
 
 %files devel
-%{_includedir}/*
-%{datadir}/mk
-%{datadir}/scripts
-%{datadir}/%{target}
-%{datadir}/examples
+%{_includedir}/dpdk
+%{_datadir}/dpdk/mk
+%{_datadir}/dpdk/scripts
+%{_datadir}/dpdk/%{target}
+%{_datadir}/dpdk/examples
 
 %files doc
-%doc %{docdir}
+%doc %{_docdir}/dpdk
 
 %post
 /sbin/ldconfig
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (11 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 12/13] pkg: update RPM with standard install Thomas Monjalon
@ 2015-12-03 13:45     ` Thomas Monjalon
  2015-12-04  9:40       ` Olivier MATZ
  2015-12-03 15:31     ` [dpdk-dev] [PATCH v3 00/13] standard make install Bruce Richardson
  2015-12-06 15:00     ` Thomas Monjalon
  14 siblings, 1 reply; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 13:45 UTC (permalink / raw)
  To: dev

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 460245b..eb7df3e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -44,7 +44,7 @@ F: doc/
 
 Build System
 ------------
-M: Olivier Matz <olivier.matz@6wind.com>
+M: Thomas Monjalon <thomas.monjalon@6wind.com>
 F: GNUmakefile
 F: Makefile
 F: config/
-- 
2.5.2

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 00/13] standard make install
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (12 preceding siblings ...)
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system Thomas Monjalon
@ 2015-12-03 15:31     ` Bruce Richardson
  2015-12-03 17:05       ` Thomas Monjalon
  2015-12-06 15:00     ` Thomas Monjalon
  14 siblings, 1 reply; 67+ messages in thread
From: Bruce Richardson @ 2015-12-03 15:31 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Thu, Dec 03, 2015 at 02:45:27PM +0100, Thomas Monjalon wrote:
> Following the recent discussions, this is a proposal to have a standard
> installation process while keeping compatibility with most of the old
> behaviours.
> 
> v2 changes:
> - fix default build dir
> - RTE_TARGET subdir in $(sdkdir).
> - better kerneldir defaults
> - fix dpdk_nic_bind symlink
> - always install doc if generated
> - doc
> - pkg/dpdk.spec
> 
> v3 changes:
> - fix install in a clean dir
> - take responsibility in MAINTAINERS
> 
> More details below and in the commit messages.
> 
> These variables can be overriden:
> 
> kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
> prefix      ?=     /usr/local
> exec_prefix ?=      $(prefix)
> bindir      ?= $(exec_prefix)/bin
> sbindir     ?= $(exec_prefix)/sbin
> libdir      ?= $(exec_prefix)/lib
> includedir  ?=      $(prefix)/include/dpdk
> datarootdir ?=      $(prefix)/share
> docdir      ?=       $(datarootdir)/doc/dpdk
> datadir     ?=       $(datarootdir)/dpdk
> sdkdir      ?=                $(datadir)
> targetdir   ?=                $(datadir)/$(RTE_TARGET)
> 
> All paths are prefixed with $(DESTDIR)
> 
> One rule install = install-runtime install-kmod install-sdk install-doc
> 
> --------
> 
> System-wise install example with
>     DESTDIR=
>     prefix=/usr
>     kerneldir=/lib/modules/kver/extra
> 
> # make install-runtime
> /usr/bin/testpmd
> /usr/lib/libethdev*
> /usr/lib/librte_*
> /usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
> /usr/share/dpdk/tools/
> 
> # make install-kmod
> /lib/modules/kver/extra/
> 
> # make install-sdk
> /usr/include/dpdk/
> /usr/share/dpdk/mk/
> /usr/share/dpdk/scripts/
> /usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
> /usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
> /usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/
> 
> # make install-doc
> /usr/share/doc/dpdk/api/
> /usr/share/doc/dpdk/guides/
> /usr/share/dpdk/examples/
> 
> --------
> 
> Local install example with old (compatible) command:
> 
> # make install T=x86_64-native-linuxapp-gcc DESTDIR=install
> 
> would be equivalent to:
> 
> # make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
> # make O=x86_64-native-linuxapp-gcc
> # make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install
> 
> install/bin/testpmd
> install/include/dpdk/
> install/kmod/
> install/lib/
> install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py
> install/share/doc/dpdk/
> install/share/dpdk/examples/
> install/share/dpdk/mk/
> install/share/dpdk/scripts/
> install/share/dpdk/tools/
> install/share/dpdk/x86_64-native-linuxapp-gcc/.config
> install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
> install/share/dpdk/x86_64-native-linuxapp-gcc/lib     -> install/lib/
> 
> It should be usable to build some applications as before:
> 
> # make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc
> 
> The RTE_SDK directory must point to install/share/dpdk with a default install.
> 
> --------
> 
While I have no huge objections to this patchset, I don't like the fact that
install does completely different things depending upon whether certain variables
are defined or not. I believe the "old" default behaviour for install was
poorly named, and while it's behaviour should be kept, a new name should be given
to it to avoid having the target "install" so heavily overloaded.

/Bruce

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/12] standard make install
  2015-12-03 13:34     ` Thomas Monjalon
@ 2015-12-03 15:52       ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 67+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-12-03 15:52 UTC (permalink / raw)
  To: Thomas Monjalon, Panu Matilainen; +Cc: dev

Hi Thomas,

In general looks good :), I'm going to test this serie and sounds good the feedback from other developers, maybe I'm going to send a version number 9 in order to get a good way together :)

Thanks :)
Mario.
________________________________________
From: Thomas Monjalon [thomas.monjalon@6wind.com]
Sent: Thursday, December 03, 2015 5:34 AM
To: Panu Matilainen; Arevalo, Mario Alfredo C
Cc: dev@dpdk.org; olivier.matz@6wind.com; Richardson, Bruce
Subject: Re: [PATCH v2 00/12] standard make install

2015-12-03 15:26, Panu Matilainen:
> On 12/03/2015 07:01 AM, Thomas Monjalon wrote:
> > Following the recent discussions, this is a proposal to have a standard
> > installation process while keeping compatibility with most of the old
> > behaviours.
> >
> > v2 changes:
> > - fix default build dir
> > - RTE_TARGET subdir in $(sdkdir).
> > - better kerneldir defaults
> > - fix dpdk_nic_bind symlink
> > - always install doc if generated
> > - doc
> > - pkg/dpdk.spec
> >
>
> Except for the minor nit about examples location (one could bikeshed on
> things like these forever), seems fine to me and quick-n-dirty
> conversion of my own spec didn't reveal any nasty surprises.
>
> It also appears more comprehensive and integrated with other workflows
> than the competing patches so FWIW, you have my ACK :)

Thank you.
I'm going to send a v3.
Mario, what is your opinion about this series?

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 00/13] standard make install
  2015-12-03 15:31     ` [dpdk-dev] [PATCH v3 00/13] standard make install Bruce Richardson
@ 2015-12-03 17:05       ` Thomas Monjalon
  0 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-03 17:05 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

2015-12-03 15:31, Bruce Richardson:
> On Thu, Dec 03, 2015 at 02:45:27PM +0100, Thomas Monjalon wrote:
> > Following the recent discussions, this is a proposal to have a standard
> > installation process while keeping compatibility with most of the old
> > behaviours.
[...]
> > Local install example with old (compatible) command:
> > 
> > # make install T=x86_64-native-linuxapp-gcc DESTDIR=install
> > 
> > would be equivalent to:
> > 
> > # make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
> > # make O=x86_64-native-linuxapp-gcc
> > # make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install
> 
> While I have no huge objections to this patchset, I don't like the fact that
> install does completely different things depending upon whether certain variables
> are defined or not. I believe the "old" default behaviour for install was
> poorly named, and while it's behaviour should be kept, a new name should be given
> to it to avoid having the target "install" so heavily overloaded.

Yes.
It is a first step to fix a common complain.
The we can remove the T= syntax or move the "all-in-one feature" to another
command name. I suggest "make config-build-install" :)

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system Thomas Monjalon
@ 2015-12-04  9:40       ` Olivier MATZ
  0 siblings, 0 replies; 67+ messages in thread
From: Olivier MATZ @ 2015-12-04  9:40 UTC (permalink / raw)
  To: Thomas Monjalon, dev

Hi Thomas,

On 12/03/2015 02:45 PM, Thomas Monjalon wrote:
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 460245b..eb7df3e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -44,7 +44,7 @@ F: doc/
>  
>  Build System
>  ------------
> -M: Olivier Matz <olivier.matz@6wind.com>
> +M: Thomas Monjalon <thomas.monjalon@6wind.com>
>  F: GNUmakefile
>  F: Makefile
>  F: config/
> 

Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thank you Thomas for you hard work on this, and sorry for not being very
present recently.

Olivier

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 00/13] standard make install
  2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
                       ` (13 preceding siblings ...)
  2015-12-03 15:31     ` [dpdk-dev] [PATCH v3 00/13] standard make install Bruce Richardson
@ 2015-12-06 15:00     ` Thomas Monjalon
  14 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-06 15:00 UTC (permalink / raw)
  To: dev

2015-12-03 14:45, Thomas Monjalon:
> Following the recent discussions, this is a proposal to have a standard
> installation process while keeping compatibility with most of the old
> behaviours.
[...]
> Thomas Monjalon (13):
>   mk: remove testall
>   mk: remove multi-target install
>   mk: move installation procedure in install rule
>   mk: install a standard cutomizable tree
>   mk: introduce new install syntax
>   mk: split install rule
>   mk: install kernel modules
>   mk: install binding tool in sbin directory
>   mk: install doc
>   mk: install examples
>   app/proc_info: rename binary with prefix
>   pkg: update RPM with standard install
>   maintainers: take responsibility for build system

Applied

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 06/13] mk: split install rule
  2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 06/13] mk: split install rule Thomas Monjalon
@ 2015-12-07 23:22       ` Arevalo, Mario Alfredo C
  2015-12-07 23:51         ` Thomas Monjalon
  0 siblings, 1 reply; 67+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-12-07 23:22 UTC (permalink / raw)
  To: Thomas Monjalon, dev

Hi Thomas,

I'm testing this set of patches that has been applied, and I haven't noticed before
that you exclude some binaries in "install-runtime" (test, testpipeline, testacl etc...), I would like
to ask you the reason about this :)
 
Thanks.
Mario. 
________________________________________
From: Thomas Monjalon [thomas.monjalon@6wind.com]
Sent: Thursday, December 03, 2015 5:45 AM
To: dev@dpdk.org
Cc: olivier.matz@6wind.com; Arevalo, Mario Alfredo C; Richardson, Bruce; Panu Matilainen
Subject: [PATCH v3 06/13] mk: split install rule

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install
rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

Suggested-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index dc57baf..ec093d3 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
        @echo Installation cannot run with T defined and DESTDIR undefined
 else
        @echo ================== Installing $(DESTDIR)$(prefix)/
+       $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+       $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+       @echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
        $(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-       $(Q)cp -a $(RTE_OUTPUT)/lib/* $(DESTDIR)$(libdir)
+       $(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
        $(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-       $(Q)tar -cf -      -C $(RTE_OUTPUT) app  --exclude 'app/*.map' \
+       $(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
                --exclude 'app/cmdline*' --exclude app/test \
                --exclude app/testacl --exclude app/testpipeline | \
            tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
                --keep-newer-files --warning=no-ignore-newer
        $(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
        $(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
        $(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-       $(Q)tar -chf -     -C $(RTE_OUTPUT) include | \
+       $(Q)tar -chf -     -C $O include | \
            tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
                --keep-newer-files --warning=no-ignore-newer
        $(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
        $(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
        $(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-       $(Q)cp -a               $(RTE_OUTPUT)/.config    $(DESTDIR)$(targetdir)
+       $(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
        $(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
        $(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-       @echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 533afe9..2424dce 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,6 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 install:
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+       $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@

 .PHONY: doc help
 doc: doc-all
--
2.5.2


^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [dpdk-dev] [PATCH v3 06/13] mk: split install rule
  2015-12-07 23:22       ` Arevalo, Mario Alfredo C
@ 2015-12-07 23:51         ` Thomas Monjalon
  0 siblings, 0 replies; 67+ messages in thread
From: Thomas Monjalon @ 2015-12-07 23:51 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C; +Cc: dev

Hi,

2015-12-07 23:22, Arevalo, Mario Alfredo C:
> Hi Thomas,
> 
> I'm testing this set of patches that has been applied, and I haven't noticed before
> that you exclude some binaries in "install-runtime" (test, testpipeline, testacl etc...), I would like
> to ask you the reason about this :)

The test apps are used in the development/validation cycle.
They have no interest in a deployment IMHO.

If you see something missing, you are welcome to fix it.
Thanks

^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2015-12-07 23:52 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02  3:57 [dpdk-dev] [PATCH 00/10] standard make install Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 01/10] mk: remove multi-target install Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 02/10] mk: move installation procedure in install rule Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 03/10] mk: install a standard cutomizable tree Thomas Monjalon
2015-12-02 10:27   ` Panu Matilainen
2015-12-02 11:25     ` Thomas Monjalon
2015-12-02 12:54       ` Panu Matilainen
2015-12-02 13:05         ` Thomas Monjalon
2015-12-02 13:29           ` Panu Matilainen
2015-12-02  3:57 ` [dpdk-dev] [PATCH 04/10] mk: introduce new install syntax Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 05/10] mk: split install rule Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 06/10] mk: install kernel modules Thomas Monjalon
2015-12-02  9:53   ` Panu Matilainen
2015-12-02 10:09     ` Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 07/10] mk: install binding tool in sbin directory Thomas Monjalon
2015-12-02  9:58   ` Panu Matilainen
2015-12-02  3:57 ` [dpdk-dev] [PATCH 08/10] mk: install doc Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 09/10] mk: install examples Thomas Monjalon
2015-12-02  3:57 ` [dpdk-dev] [PATCH 10/10] app/proc_info: rename binary with prefix Thomas Monjalon
2015-12-02  7:44 ` [dpdk-dev] [PATCH 00/10] standard make install Panu Matilainen
2015-12-02  9:25   ` Thomas Monjalon
2015-12-02  9:47     ` Panu Matilainen
2015-12-02 10:07       ` Thomas Monjalon
2015-12-03  5:01 ` [dpdk-dev] [PATCH v2 00/12] " Thomas Monjalon
2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 01/12] mk: remove testall Thomas Monjalon
2015-12-03  5:01   ` [dpdk-dev] [PATCH v2 02/12] mk: remove multi-target install Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 03/12] mk: move installation procedure in install rule Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 04/12] mk: install a standard cutomizable tree Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 05/12] mk: introduce new install syntax Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 06/12] mk: split install rule Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 07/12] mk: install kernel modules Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 08/12] mk: install binding tool in sbin directory Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 09/12] mk: install doc Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 10/12] mk: install examples Thomas Monjalon
2015-12-03 13:19     ` Panu Matilainen
2015-12-03 13:32       ` Thomas Monjalon
2015-12-03 13:35         ` Panu Matilainen
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 11/12] app/proc_info: rename binary with prefix Thomas Monjalon
2015-12-03  5:02   ` [dpdk-dev] [PATCH v2 12/12] pkg: update RPM with standard install Thomas Monjalon
2015-12-03 10:57   ` [dpdk-dev] [PATCH v2 00/12] standard make install Bruce Richardson
2015-12-03 11:02     ` Thomas Monjalon
2015-12-03 11:06       ` Thomas Monjalon
2015-12-03 11:10         ` Bruce Richardson
2015-12-03 11:07       ` Bruce Richardson
2015-12-03 13:26   ` Panu Matilainen
2015-12-03 13:34     ` Thomas Monjalon
2015-12-03 15:52       ` Arevalo, Mario Alfredo C
2015-12-03 13:45   ` [dpdk-dev] [PATCH v3 00/13] " Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 01/13] mk: remove testall Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 02/13] mk: remove multi-target install Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 03/13] mk: move installation procedure in install rule Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 04/13] mk: install a standard cutomizable tree Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 05/13] mk: introduce new install syntax Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 06/13] mk: split install rule Thomas Monjalon
2015-12-07 23:22       ` Arevalo, Mario Alfredo C
2015-12-07 23:51         ` Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 07/13] mk: install kernel modules Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 08/13] mk: install binding tool in sbin directory Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 09/13] mk: install doc Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 10/13] mk: install examples Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 11/13] app/proc_info: rename binary with prefix Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 12/13] pkg: update RPM with standard install Thomas Monjalon
2015-12-03 13:45     ` [dpdk-dev] [PATCH v3 13/13] maintainers: take responsibility for build system Thomas Monjalon
2015-12-04  9:40       ` Olivier MATZ
2015-12-03 15:31     ` [dpdk-dev] [PATCH v3 00/13] standard make install Bruce Richardson
2015-12-03 17:05       ` Thomas Monjalon
2015-12-06 15:00     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).