DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
@ 2015-09-18 20:33 Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support Mario Carrillo
                   ` (16 more replies)
  0 siblings, 17 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

DPDK package lacks of a mechanism to install libraries, headers
applications and kernel modules to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1
 
and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (7):
  mk: Add hierarchy-file support
  mk: Add hierarchy-file support (sbin)
  mk: Add hierarchy-file support (doc)
  mk: Add hierarchy-file support (app)
  mk: Add hierarchy-file support (include)
  mk: Add hierarchy-file support (lib)
  mk: Add hierarchy-file support (linux mod)

 mk/internal/rte.install-post.mk | 15 +++++++++++-
 mk/rte.app.mk                   |  8 +++++++
 mk/rte.lib.mk                   | 16 +++++++++++++
 mk/rte.module.mk                |  8 +++++++
 mk/rte.sdkinstall.mk            | 52 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 1 deletion(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 2/7] mk: Add hierarchy-file support (sbin) Mario Carrillo
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK scripts, tools, examples,
makefiles and config files when invoking "make install H=1"
(hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and dpdk spec file.

scripts, tools, examples, makefiles and config files will be installed
in: $(DESTDIR)/usr/share/dpdk

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..3b8169b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,6 +43,23 @@ ifndef T
 T=*
 endif
 
+# When H (hierarchy-file) varible is equal "1" it will install files
+# according to the next proposal:
+# http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
+# some variables get values from .config in order not to set a target again.
+ifeq ($(H),1)
+include $(BUILD_DIR)/build/.config
+RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+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)
+T := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
+DATA_DIR := $(DESTDIR)/usr/share
+INCLUDE_DIR := $(DESTDIR)/usr/include
+export INCLUDE_DIR
+endif
+
 #
 # install: build sdk for all supported targets
 #
@@ -56,6 +73,22 @@ install: $(INSTALL_TARGETS)
 
 %_install:
 	@echo ================== Installing $*
+#
+# Install config and environment files
+# according to freedesktop hierarchy-file when H=1
+#
+ifeq ($(H),1)
+	$(Q)$(MAKE) all O=$(BUILD_DIR)/build
+	@[ -d $(DATA_DIR)/dpdk ] || mkdir -p $(DATA_DIR)/dpdk
+	$(Q)cp -a $(BUILD_DIR)/mk $(DATA_DIR)/dpdk
+	$(Q)cp -a $(BUILD_DIR)/scripts $(DATA_DIR)/dpdk
+	$(Q)cp -a $(BUILD_DIR)/examples $(DATA_DIR)/dpdk
+	$(Q)cp -a $(BUILD_DIR)/tools $(DATA_DIR)/dpdk
+	@[ -d $(INCLUDE_DIR) ] || mkdir -p $(INCLUDE_DIR)
+	$(Q)cp -f  $(BUILD_DIR)/build/include/rte_config.h $(INCLUDE_DIR)
+	@[ -d $(DATA_DIR)/dpdk/config ] || mkdir -p $(DATA_DIR)/dpdk/config
+	$(Q)cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config
+else
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
 	elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \
@@ -79,6 +112,7 @@ install: $(INSTALL_TARGETS)
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
+endif
 .PHONY: uninstall
 uninstall: $(UNINSTALL_TARGETS)
 
-- 
2.1.0

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

* [dpdk-dev] [PATCH 2/7] mk: Add hierarchy-file support (sbin)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 3/7] mk: Add hierarchy-file support (doc) Mario Carrillo
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK bind scripts,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and dpdk spec file

bind scripts will be installed in:
$(DESTDIR)/usr/sbin/dpdk_nic_bind

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3b8169b..2028a8b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -57,7 +57,9 @@ RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 T := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 DATA_DIR := $(DESTDIR)/usr/share
 INCLUDE_DIR := $(DESTDIR)/usr/include
+SBIN_DIR := $(DESTDIR)/usr/sbin
 export INCLUDE_DIR
+export SBIN_DIR
 endif
 
 #
@@ -88,6 +90,8 @@ ifeq ($(H),1)
 	$(Q)cp -f  $(BUILD_DIR)/build/include/rte_config.h $(INCLUDE_DIR)
 	@[ -d $(DATA_DIR)/dpdk/config ] || mkdir -p $(DATA_DIR)/dpdk/config
 	$(Q)cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config
+	@[ -d $(SBIN_DIR)/dpdk_nic_bind ] || mkdir -p $(SBIN_DIR)/dpdk_nic_bind
+	$(Q)cp -f $(BUILD_DIR)/tools/*nic_bind.py $(SBIN_DIR)/dpdk_nic_bind
 else
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
-- 
2.1.0

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

* [dpdk-dev] [PATCH 3/7] mk: Add hierarchy-file support (doc)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 2/7] mk: Add hierarchy-file support (sbin) Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 4/7] mk: Add hierarchy-file support (app) Mario Carrillo
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK documentation,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and dpdk spec file

documentation will be installed in:
$(DESTDIR)/usr/share/doc/dpdk

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 2028a8b..41b8485 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -92,6 +92,8 @@ ifeq ($(H),1)
 	$(Q)cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config
 	@[ -d $(SBIN_DIR)/dpdk_nic_bind ] || mkdir -p $(SBIN_DIR)/dpdk_nic_bind
 	$(Q)cp -f $(BUILD_DIR)/tools/*nic_bind.py $(SBIN_DIR)/dpdk_nic_bind
+	@[ -d $(DATA_DIR)/doc/dpdk/ ] || mkdir -p $(DATA_DIR)/doc/dpdk/
+	$(Q)cp -a $(BUILD_DIR)/doc/* $(DATA_DIR)/doc/dpdk
 else
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
-- 
2.1.0

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

* [dpdk-dev] [PATCH 4/7] mk: Add hierarchy-file support (app)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (2 preceding siblings ...)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 3/7] mk: Add hierarchy-file support (doc) Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include) Mario Carrillo
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK app files,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

app files will be installed in: $(DESTDIR)/usr/bin

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.app.mk        | 8 ++++++++
 mk/rte.sdkinstall.mk | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 9e1909e..ae3328c 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -155,6 +155,14 @@ LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
 
 .PHONY: all
 all: install
+#
+# if H (hierarchy-file) varible is equal "1"
+# install app in /usr/bin/ too.
+#
+ifeq ($(H),1)
+	@[ -d $(BIN_DIR) ] || mkdir -p $(BIN_DIR)
+	$(Q)cp -f $(RTE_OUTPUT)/app/$(APP) $(BIN_DIR)
+endif
 
 .PHONY: install
 install: build _postinstall
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 41b8485..723fd97 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -58,8 +58,10 @@ T := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 DATA_DIR := $(DESTDIR)/usr/share
 INCLUDE_DIR := $(DESTDIR)/usr/include
 SBIN_DIR := $(DESTDIR)/usr/sbin
+BIN_DIR := $(DESTDIR)/usr/bin
 export INCLUDE_DIR
 export SBIN_DIR
+export BIN_DIR
 endif
 
 #
-- 
2.1.0

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

* [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (3 preceding siblings ...)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 4/7] mk: Add hierarchy-file support (app) Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-22  8:03   ` Panu Matilainen
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib) Mario Carrillo
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK headers,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

headers will be installed in: $(DESTDIR)/usr/include

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/internal/rte.install-post.mk | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/mk/internal/rte.install-post.mk b/mk/internal/rte.install-post.mk
index 77addee..20c6a8b 100644
--- a/mk/internal/rte.install-post.mk
+++ b/mk/internal/rte.install-post.mk
@@ -63,9 +63,22 @@ $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))): $(2)
 		$(RTE_OUTPUT)/$(1)
 endef
 
+#
+# generate rules to install headers in
+# /usr/include
+#
+define copy_header_dir_rule
+ifeq ($(H),1)
+HEADER_DIR := $$(shell echo $(1) | sed 's/include\/*//')
+$$(shell [ -d $(INCLUDE_DIR)/$(HEADER_DIR) ] || mkdir -p $(INCLUDE_DIR)/$(HEADER_DIR))
+$$(shell cp -rf $(VPATH)/$(2) $(INCLUDE_DIR)/$(HEADER_DIR))
+endif
+endef
+
 $(foreach dir,$(SYMLINK-DIRS-y),\
 	$(foreach file,$(SYMLINK-y-$(dir)),\
-		$(eval $(call symlink_rule,$(dir),$(file)))))
+		$(eval $(call symlink_rule,$(dir),$(file))) \
+		$(eval $(call copy_header_dir_rule,$(dir),$(file)))))
 
 
 # fast way, no need to do preinstall and postinstall
-- 
2.1.0

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

* [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (4 preceding siblings ...)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include) Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-22  7:46   ` Panu Matilainen
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod) Mario Carrillo
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK libs,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

for this case, if the architecture is 64 bits libs will be
instaled in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.lib.mk        | 16 ++++++++++++++++
 mk/rte.sdkinstall.mk |  6 ++++++
 2 files changed, 22 insertions(+)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index fcc8e20..3b3136a 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -53,6 +53,22 @@ _CLEAN = doclean
 
 .PHONY: all
 all: install
+#
+# if H (hierarchy-file) varible is equal "1"
+# according to architecture. it will install files 
+# in /usr/lib64/ or /usr/lib 
+#
+ifeq ($(H),1)
+	@[ -d $(LIB_DIR) ] || mkdir -p $(LIB_DIR)
+	$(Q)cp -f $(LIB) $(LIB_DIR)
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+ifeq ($(CONFIG_RTE_NEXT_ABI),y)
+	$(Q)ln -s -f $(LIB) $(basename $(basename $(LIB_DIR)/$(LIB)))
+else
+	$(Q)ln -s -f $(LIB) $(basename $(basename $(LIB_DIR)/$(LIB)))
+endif
+endif
+endif
 
 .PHONY: install
 install: build _postinstall
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 723fd97..b506959 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -59,9 +59,15 @@ DATA_DIR := $(DESTDIR)/usr/share
 INCLUDE_DIR := $(DESTDIR)/usr/include
 SBIN_DIR := $(DESTDIR)/usr/sbin
 BIN_DIR := $(DESTDIR)/usr/bin
+ifeq ($(RTE_ARCH),x86_64)
+LIB_DIR := $(DESTDIR)/usr/lib64
+else
+LIB_DIR := $(DESTDIR)/usr/lib
+endif
 export INCLUDE_DIR
 export SBIN_DIR
 export BIN_DIR
+export LIB_DIR
 endif
 
 #
-- 
2.1.0

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

* [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (5 preceding siblings ...)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib) Mario Carrillo
@ 2015-09-18 20:33 ` Mario Carrillo
  2015-09-22  6:56   ` Panu Matilainen
  2015-09-22  6:29 ` [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Panu Matilainen
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-09-18 20:33 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK modules for linux,
when invoking "make install H=1" (hierarchy-file)

This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

headers will be installed in: $(DESTDIR)/lib/modules

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.module.mk     | 8 ++++++++
 mk/rte.sdkinstall.mk | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/mk/rte.module.mk b/mk/rte.module.mk
index 7bf77c1..4fc43ba 100644
--- a/mk/rte.module.mk
+++ b/mk/rte.module.mk
@@ -59,6 +59,14 @@ compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))
 
 .PHONY: all
 all: install
+#
+# if H (hierarchy-file) varible is equal "1"
+# install modules in /lib/modules/$(KERNEL_DIR).
+#
+ifeq ($(H),1)
+	@[ -d $(MOD_DIR)/$(KERNEL_DIR) ] || mkdir -p $(MOD_DIR)/$(KERNEL_DIR)
+	$(Q)cp -f $(MODULE).ko $(MOD_DIR)/$(KERNEL_DIR)
+endif
 
 .PHONY: install
 install: build _postinstall
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index b506959..5ddc3f7 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -59,6 +59,8 @@ DATA_DIR := $(DESTDIR)/usr/share
 INCLUDE_DIR := $(DESTDIR)/usr/include
 SBIN_DIR := $(DESTDIR)/usr/sbin
 BIN_DIR := $(DESTDIR)/usr/bin
+MOD_DIR := $(DESTDIR)/lib/modules
+KERNEL_DIR := $(shell uname -r)/extra
 ifeq ($(RTE_ARCH),x86_64)
 LIB_DIR := $(DESTDIR)/usr/lib64
 else
@@ -68,6 +70,8 @@ export INCLUDE_DIR
 export SBIN_DIR
 export BIN_DIR
 export LIB_DIR
+export MOD_DIR
+export KERNEL_DIR
 endif
 
 #
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (6 preceding siblings ...)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod) Mario Carrillo
@ 2015-09-22  6:29 ` Panu Matilainen
  2015-09-22  8:00   ` Olivier MATZ
  2015-09-22  8:16 ` Olivier MATZ
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22  6:29 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications and kernel modules to a file system tree.
>
> This patch set allows to install files according to the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> By adding a parameter H=1 (hierarchy-file) to makefile system, it is
> possible to do the next steps
>
> make config T=TARGET
> make
> make install H=1
>
> and files will be installed on the proper directory. Also you can use
> the DESTDIR variable.

Thanks for working on this!

My 5c is that I'd rather see "make install" do the right thing (as in, 
behave like a normal OSS project) by default instead of requiring some 
obscure additional parameter (which almost nobody will then find) to 
activate it.

	- Panu -

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod) Mario Carrillo
@ 2015-09-22  6:56   ` Panu Matilainen
  2015-11-27 15:40     ` Thomas Monjalon
  0 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22  6:56 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK modules for linux,
> when invoking "make install H=1" (hierarchy-file)
>
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> headers will be installed in: $(DESTDIR)/lib/modules
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>   mk/rte.module.mk     | 8 ++++++++
>   mk/rte.sdkinstall.mk | 4 ++++
>   2 files changed, 12 insertions(+)
>
> diff --git a/mk/rte.module.mk b/mk/rte.module.mk
> index 7bf77c1..4fc43ba 100644
> --- a/mk/rte.module.mk
> +++ b/mk/rte.module.mk
> @@ -59,6 +59,14 @@ compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))
>
>   .PHONY: all
>   all: install
> +#
> +# if H (hierarchy-file) varible is equal "1"
> +# install modules in /lib/modules/$(KERNEL_DIR).
> +#
> +ifeq ($(H),1)
> +	@[ -d $(MOD_DIR)/$(KERNEL_DIR) ] || mkdir -p $(MOD_DIR)/$(KERNEL_DIR)
> +	$(Q)cp -f $(MODULE).ko $(MOD_DIR)/$(KERNEL_DIR)
> +endif
>
>   .PHONY: install
>   install: build _postinstall
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index b506959..5ddc3f7 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -59,6 +59,8 @@ DATA_DIR := $(DESTDIR)/usr/share
>   INCLUDE_DIR := $(DESTDIR)/usr/include
>   SBIN_DIR := $(DESTDIR)/usr/sbin
>   BIN_DIR := $(DESTDIR)/usr/bin
> +MOD_DIR := $(DESTDIR)/lib/modules
> +KERNEL_DIR := $(shell uname -r)/extra

Please don't assume one is always building for the running kernel. 
Defaulting around uname -r is perfectly reasonable, but there needs to 
be a way to override it from the cli. For example rte.vars.mk has this:

# can be overriden by make command line or exported environment variable
RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build

	- Panu -

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

* Re: [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib) Mario Carrillo
@ 2015-09-22  7:46   ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22  7:46 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK libs,
> when invoking "make install H=1" (hierarchy-file)
>
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> for this case, if the architecture is 64 bits libs will be
> instaled in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
[...]
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 723fd97..b506959 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -59,9 +59,15 @@ DATA_DIR := $(DESTDIR)/usr/share
>   INCLUDE_DIR := $(DESTDIR)/usr/include
>   SBIN_DIR := $(DESTDIR)/usr/sbin
>   BIN_DIR := $(DESTDIR)/usr/bin
> +ifeq ($(RTE_ARCH),x86_64)
> +LIB_DIR := $(DESTDIR)/usr/lib64
> +else
> +LIB_DIR := $(DESTDIR)/usr/lib
> +endif

While this would sort of work, for now, for Fedora, RHEL and derivates, 
it is incorrect for the Debian world. It also misses ppc64 for which we 
have a config file in the tree (whether it actually builds I dont know).

The location of libdir is essentially a distro level choice, upstream 
projects are better off with a predictable default (say, /usr/lib) that 
is easy to override during build/install.

One possibility could be using systemd-path (if present) for querying 
the distro settings, eg

$ systemd-path system-library-arch
/usr/lib64

	- Panu -

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22  6:29 ` [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Panu Matilainen
@ 2015-09-22  8:00   ` Olivier MATZ
  2015-09-22  8:34     ` Panu Matilainen
  0 siblings, 1 reply; 150+ messages in thread
From: Olivier MATZ @ 2015-09-22  8:00 UTC (permalink / raw)
  To: Panu Matilainen, Mario Carrillo, dev

Hi,

On 09/22/2015 08:29 AM, Panu Matilainen wrote:
> On 09/18/2015 11:33 PM, Mario Carrillo wrote:
>> DPDK package lacks of a mechanism to install libraries, headers
>> applications and kernel modules to a file system tree.
>>
>> This patch set allows to install files according to the next
>> proposal:
>> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>>
>> By adding a parameter H=1 (hierarchy-file) to makefile system, it is
>> possible to do the next steps
>>
>> make config T=TARGET
>> make
>> make install H=1
>>
>> and files will be installed on the proper directory. Also you can use
>> the DESTDIR variable.
> 
> Thanks for working on this!
> 
> My 5c is that I'd rather see "make install" do the right thing (as in,
> behave like a normal OSS project) by default instead of requiring some
> obscure additional parameter (which almost nobody will then find) to
> activate it.

Actually, the current "install" directive means: install all stuff
required to build a project for the specified targets (example:
x86_64-native-linuxapp-gcc).

If we just do "make install T=${target}", the target is installed
into the current SDK source. Adding DESTDIR will install the binary
DPDK in a new directory. Example:

 make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install

In both cases, the result can be used to build an application (like
the one found in examples) using the the DPDK framework. So, the current
"install" directive should be understood as "install binary sdk".

>From what I understand, what Mario wants to add is a "install runtime
libraries" directive.

I agree that using H=1 is maybe not the clearest solution. What about
renaming the "install" directive to:
  - install-sdk
  - install-runtime

It would help to keep the current behavior of "install" for some time,
marking it as deprecated.

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include)
  2015-09-18 20:33 ` [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include) Mario Carrillo
@ 2015-09-22  8:03   ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22  8:03 UTC (permalink / raw)
  To: dev

On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK headers,
> when invoking "make install H=1" (hierarchy-file)
>
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> headers will be installed in: $(DESTDIR)/usr/include

While most of the DPDK headers are rte-prefixed, not all are, and in 
particular it really has no business of putting directories such as 
"common" and "general" directly into /usr/include.

Its better to put them into a dpdk-specific directory, say, 
$(DESTDIR)/usr/include/dpdk also requested here:
http://dpdk.org/ml/archives/dev/2015-September/023180.html

	- Panu -

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (7 preceding siblings ...)
  2015-09-22  6:29 ` [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Panu Matilainen
@ 2015-09-22  8:16 ` Olivier MATZ
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 150+ messages in thread
From: Olivier MATZ @ 2015-09-22  8:16 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Mario,

On 09/18/2015 10:33 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications and kernel modules to a file system tree.
> 
> This patch set allows to install files according to the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> By adding a parameter H=1 (hierarchy-file) to makefile system, it is
> possible to do the next steps
> 
> make config T=TARGET
> make
> make install H=1

The current "install" target is not designed to work on one
build directory. Instead, it takes as a parameter a list of
config templates, and the build directory is the name of the
target.

Today, we have:

  make install T="*-native-linuxapp-gcc"

is somehow equivalent to:

  make config T=i686-native-linuxapp-gcc O=i686-native-linuxapp-gcc
  make O=i686-native-linuxapp-gcc
  make config T=x86_32-native-linuxapp-gcc O=x86_32-native-linuxapp-gcc
  make O=x86_32-native-linuxapp-gcc
  make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc
  make O=x86_64-native-linuxapp-gcc

The "install H=1" directive you are adding seems to implicitly be
working on a build directory (modifiable with O=), which is the case
for the "make" command but not for the current "make install".

I'm in favor of having different command names for installing
a binary sdk and for installing the runtime libs in the hierarchical
file system, this to avoid having different behaviors for the same
name.

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22  8:00   ` Olivier MATZ
@ 2015-09-22  8:34     ` Panu Matilainen
  2015-09-22  9:00       ` Olivier MATZ
  0 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22  8:34 UTC (permalink / raw)
  To: Olivier MATZ, Mario Carrillo, dev

On 09/22/2015 11:00 AM, Olivier MATZ wrote:
> Hi,
>
> On 09/22/2015 08:29 AM, Panu Matilainen wrote:
>> On 09/18/2015 11:33 PM, Mario Carrillo wrote:
>>> DPDK package lacks of a mechanism to install libraries, headers
>>> applications and kernel modules to a file system tree.
>>>
>>> This patch set allows to install files according to the next
>>> proposal:
>>> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>>>
>>> By adding a parameter H=1 (hierarchy-file) to makefile system, it is
>>> possible to do the next steps
>>>
>>> make config T=TARGET
>>> make
>>> make install H=1
>>>
>>> and files will be installed on the proper directory. Also you can use
>>> the DESTDIR variable.
>>
>> Thanks for working on this!
>>
>> My 5c is that I'd rather see "make install" do the right thing (as in,
>> behave like a normal OSS project) by default instead of requiring some
>> obscure additional parameter (which almost nobody will then find) to
>> activate it.
>
> Actually, the current "install" directive means: install all stuff
> required to build a project for the specified targets (example:
> x86_64-native-linuxapp-gcc).
>
> If we just do "make install T=${target}", the target is installed
> into the current SDK source. Adding DESTDIR will install the binary
> DPDK in a new directory. Example:
>
>   make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install
>
> In both cases, the result can be used to build an application (like
> the one found in examples) using the the DPDK framework. So, the current
> "install" directive should be understood as "install binary sdk".

I know. What it now does is the very problem being addressed :)

The current behavior is just so alien to the rest of the OSS world it 
actually creates an extra barrier of entry to the project. Besides that, 
it forces people to manually do the cp/mv dance instead - witness 
%install in pkg/dpdk.spec. It also unnecessarily rebuilds stuff when it 
should be just copying.

>  From what I understand, what Mario wants to add is a "install runtime
> libraries" directive.

Its not limited to runtime libraries, it installs headers and such too. 
The point, AFAICS, is have "make install" do what people actually expect 
it to do - a system-wide installation. Principle of least surprise and all.

>
> I agree that using H=1 is maybe not the clearest solution. What about
> renaming the "install" directive to:
>    - install-sdk
>    - install-runtime
>
> It would help to keep the current behavior of "install" for some time,
> marking it as deprecated.

Nothing wrong with having separate targets for installing runtime- and 
sdk-specific bits, but thats not the point here.

	- Panu -

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22  8:34     ` Panu Matilainen
@ 2015-09-22  9:00       ` Olivier MATZ
  2015-09-22 10:14         ` Panu Matilainen
  2015-09-22 10:39         ` Neil Horman
  0 siblings, 2 replies; 150+ messages in thread
From: Olivier MATZ @ 2015-09-22  9:00 UTC (permalink / raw)
  To: Panu Matilainen, Mario Carrillo, dev

Hi,

On 09/22/2015 10:34 AM, Panu Matilainen wrote:
> On 09/22/2015 11:00 AM, Olivier MATZ wrote:
>> Actually, the current "install" directive means: install all stuff
>> required to build a project for the specified targets (example:
>> x86_64-native-linuxapp-gcc).
>>
>> If we just do "make install T=${target}", the target is installed
>> into the current SDK source. Adding DESTDIR will install the binary
>> DPDK in a new directory. Example:
>>
>>   make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install
>>
>> In both cases, the result can be used to build an application (like
>> the one found in examples) using the the DPDK framework. So, the current
>> "install" directive should be understood as "install binary sdk".
> 
> I know. What it now does is the very problem being addressed :)
> 
> The current behavior is just so alien to the rest of the OSS world it
> actually creates an extra barrier of entry to the project. Besides that,
> it forces people to manually do the cp/mv dance instead - witness
> %install in pkg/dpdk.spec. It also unnecessarily rebuilds stuff when it
> should be just copying.

I agree, I was just trying to summarize what the "install" does
right now, I don't say it's the proper behavior.


>>  From what I understand, what Mario wants to add is a "install runtime
>> libraries" directive.
> 
> Its not limited to runtime libraries, it installs headers and such too.
> The point, AFAICS, is have "make install" do what people actually expect
> it to do - a system-wide installation. Principle of least surprise and all.
> 
>>
>> I agree that using H=1 is maybe not the clearest solution. What about
>> renaming the "install" directive to:
>>    - install-sdk
>>    - install-runtime
>>
>> It would help to keep the current behavior of "install" for some time,
>> marking it as deprecated.
> 
> Nothing wrong with having separate targets for installing runtime- and
> sdk-specific bits, but thats not the point here.

Hmm I think it is.

My question is: do we want to keep the current install behavior for
compatibility or not? Should we consider this makefile directive as
an API? People may use it, and we should at least ask us it it should
follow a sort of API deprecation process like we do for the code.
That's why I talked about 2 new commands and deprecate the old one.

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22  9:00       ` Olivier MATZ
@ 2015-09-22 10:14         ` Panu Matilainen
  2015-09-22 10:36           ` Panu Matilainen
  2015-09-22 14:40           ` Olivier MATZ
  2015-09-22 10:39         ` Neil Horman
  1 sibling, 2 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22 10:14 UTC (permalink / raw)
  To: Olivier MATZ, Mario Carrillo, dev

On 09/22/2015 12:00 PM, Olivier MATZ wrote:
> Hi,
>
> On 09/22/2015 10:34 AM, Panu Matilainen wrote:
>> On 09/22/2015 11:00 AM, Olivier MATZ wrote:
>>> Actually, the current "install" directive means: install all stuff
>>> required to build a project for the specified targets (example:
>>> x86_64-native-linuxapp-gcc).
>>>
>>> If we just do "make install T=${target}", the target is installed
>>> into the current SDK source. Adding DESTDIR will install the binary
>>> DPDK in a new directory. Example:
>>>
>>>    make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install
>>>
>>> In both cases, the result can be used to build an application (like
>>> the one found in examples) using the the DPDK framework. So, the current
>>> "install" directive should be understood as "install binary sdk".
>>
>> I know. What it now does is the very problem being addressed :)
>>
>> The current behavior is just so alien to the rest of the OSS world it
>> actually creates an extra barrier of entry to the project. Besides that,
>> it forces people to manually do the cp/mv dance instead - witness
>> %install in pkg/dpdk.spec. It also unnecessarily rebuilds stuff when it
>> should be just copying.
>
> I agree, I was just trying to summarize what the "install" does
> right now, I don't say it's the proper behavior.

Oh, ok.

>>>   From what I understand, what Mario wants to add is a "install runtime
>>> libraries" directive.
>>
>> Its not limited to runtime libraries, it installs headers and such too.
>> The point, AFAICS, is have "make install" do what people actually expect
>> it to do - a system-wide installation. Principle of least surprise and all.
>>
>>>
>>> I agree that using H=1 is maybe not the clearest solution. What about
>>> renaming the "install" directive to:
>>>     - install-sdk
>>>     - install-runtime
>>>
>>> It would help to keep the current behavior of "install" for some time,
>>> marking it as deprecated.
>>
>> Nothing wrong with having separate targets for installing runtime- and
>> sdk-specific bits, but thats not the point here.
>
> Hmm I think it is.

"make install" usually installs everything, including headers, 
documentation etc on top of binaries and libraries.  Thats more or less 
what the patches here do. For packaging purposes they're usually split 
up to different sub-packages and in the make-system there usually are 
separate targets for the individual elements like install-doc.

The notion of SDK in DPDK is something entirely different from how the 
average OSS project is used in development of other software. Some 
projects like pktgen-dpdk rely on the SDK structure, mk snippets and 
scripts and all, others like openvswitch try to deal with it more like 
it was any old OSS citizen.

In my packaging of DPDK I ended up providing both: headers, libraries 
etc in the normal system paths, and then a separate dpdk-sdk directory 
holding the SDK-parts like mk bits and symlinking to the libs and 
headers as needed, so that you can actually point RTE_SDK to that 
dpdk-sdk dir and be able to build apps against the thing.

>
> My question is: do we want to keep the current install behavior for
> compatibility or not? Should we consider this makefile directive as
> an API? People may use it, and we should at least ask us it it should
> follow a sort of API deprecation process like we do for the code.
> That's why I talked about 2 new commands and deprecate the old one.

I'd be surprised if somebody somewhere isn't relying on the current 
specific behavior, given its explicitly documented and all. Whether it 
needs to stay, and whether it needs to stay as the default ... I 
wouldn't miss it, but its a question for those using and depending on it 
really.

	- Panu -

>
> Regards,
> Olivier
>

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22 10:14         ` Panu Matilainen
@ 2015-09-22 10:36           ` Panu Matilainen
  2015-09-22 14:40           ` Olivier MATZ
  1 sibling, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-22 10:36 UTC (permalink / raw)
  To: Olivier MATZ, Mario Carrillo, dev

On 09/22/2015 01:14 PM, Panu Matilainen wrote:
> On 09/22/2015 12:00 PM, Olivier MATZ wrote:
>> Hi,
>>
>> On 09/22/2015 10:34 AM, Panu Matilainen wrote:
>>> On 09/22/2015 11:00 AM, Olivier MATZ wrote:
>>>> Actually, the current "install" directive means: install all stuff
>>>> required to build a project for the specified targets (example:
>>>> x86_64-native-linuxapp-gcc).
>>>>
>>>> If we just do "make install T=${target}", the target is installed
>>>> into the current SDK source. Adding DESTDIR will install the binary
>>>> DPDK in a new directory. Example:
>>>>
>>>>    make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install
>>>>
>>>> In both cases, the result can be used to build an application (like
>>>> the one found in examples) using the the DPDK framework. So, the
>>>> current
>>>> "install" directive should be understood as "install binary sdk".
>>>
>>> I know. What it now does is the very problem being addressed :)
>>>
>>> The current behavior is just so alien to the rest of the OSS world it
>>> actually creates an extra barrier of entry to the project. Besides that,
>>> it forces people to manually do the cp/mv dance instead - witness
>>> %install in pkg/dpdk.spec. It also unnecessarily rebuilds stuff when it
>>> should be just copying.
>>
>> I agree, I was just trying to summarize what the "install" does
>> right now, I don't say it's the proper behavior.
>
> Oh, ok.
>
>>>>   From what I understand, what Mario wants to add is a "install runtime
>>>> libraries" directive.
>>>
>>> Its not limited to runtime libraries, it installs headers and such too.
>>> The point, AFAICS, is have "make install" do what people actually expect
>>> it to do - a system-wide installation. Principle of least surprise
>>> and all.
>>>
>>>>
>>>> I agree that using H=1 is maybe not the clearest solution. What about
>>>> renaming the "install" directive to:
>>>>     - install-sdk
>>>>     - install-runtime
>>>>
>>>> It would help to keep the current behavior of "install" for some time,
>>>> marking it as deprecated.
>>>
>>> Nothing wrong with having separate targets for installing runtime- and
>>> sdk-specific bits, but thats not the point here.
>>
>> Hmm I think it is.
>
> "make install" usually installs everything, including headers,
> documentation etc on top of binaries and libraries.  Thats more or less
> what the patches here do. For packaging purposes they're usually split
> up to different sub-packages and in the make-system there usually are
> separate targets for the individual elements like install-doc.
>
> The notion of SDK in DPDK is something entirely different from how the
> average OSS project is used in development of other software. Some
> projects like pktgen-dpdk rely on the SDK structure, mk snippets and
> scripts and all, others like openvswitch try to deal with it more like
> it was any old OSS citizen.

...so...

Talking about "runtime" misses the point, it'd be more like:
- install-sdk (for current dpdk specific sdk hierarchy)
- install-fhs (for filesystem hierarchy standard)

Getting the latter implemented would be the first step (which is what 
these patches are about, even if the details differ). Changing default 
behavior is a kind of different question (that I dragged into the 
picture, sorry for mixing it up).

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22  9:00       ` Olivier MATZ
  2015-09-22 10:14         ` Panu Matilainen
@ 2015-09-22 10:39         ` Neil Horman
  1 sibling, 0 replies; 150+ messages in thread
From: Neil Horman @ 2015-09-22 10:39 UTC (permalink / raw)
  To: Olivier MATZ; +Cc: dev

On Tue, Sep 22, 2015 at 11:00:08AM +0200, Olivier MATZ wrote:
> Hi,
> 
> On 09/22/2015 10:34 AM, Panu Matilainen wrote:
> > On 09/22/2015 11:00 AM, Olivier MATZ wrote:
> >> Actually, the current "install" directive means: install all stuff
> >> required to build a project for the specified targets (example:
> >> x86_64-native-linuxapp-gcc).
> >>
> >> If we just do "make install T=${target}", the target is installed
> >> into the current SDK source. Adding DESTDIR will install the binary
> >> DPDK in a new directory. Example:
> >>
> >>   make -j32 T="*-native-linuxapp-gcc" DESTDIR=/tmp/binary-dpdk install
> >>
> >> In both cases, the result can be used to build an application (like
> >> the one found in examples) using the the DPDK framework. So, the current
> >> "install" directive should be understood as "install binary sdk".
> > 
> > I know. What it now does is the very problem being addressed :)
> > 
> > The current behavior is just so alien to the rest of the OSS world it
> > actually creates an extra barrier of entry to the project. Besides that,
> > it forces people to manually do the cp/mv dance instead - witness
> > %install in pkg/dpdk.spec. It also unnecessarily rebuilds stuff when it
> > should be just copying.
> 
> I agree, I was just trying to summarize what the "install" does
> right now, I don't say it's the proper behavior.
> 
> 
> >>  From what I understand, what Mario wants to add is a "install runtime
> >> libraries" directive.
> > 
> > Its not limited to runtime libraries, it installs headers and such too.
> > The point, AFAICS, is have "make install" do what people actually expect
> > it to do - a system-wide installation. Principle of least surprise and all.
> > 
> >>
> >> I agree that using H=1 is maybe not the clearest solution. What about
> >> renaming the "install" directive to:
> >>    - install-sdk
> >>    - install-runtime
> >>
> >> It would help to keep the current behavior of "install" for some time,
> >> marking it as deprecated.
> > 
> > Nothing wrong with having separate targets for installing runtime- and
> > sdk-specific bits, but thats not the point here.
> 
> Hmm I think it is.
> 
> My question is: do we want to keep the current install behavior for
> compatibility or not? Should we consider this makefile directive as
> an API? People may use it, and we should at least ask us it it should
> follow a sort of API deprecation process like we do for the code.
> That's why I talked about 2 new commands and deprecate the old one.
> 

No, build requirements and mechanisms should not be considered part of the API.
There might be other reasons to keep them consistent (and there may be here),
but we don't need to proect the build mechanism, as API is meant to allow
backward compatibility for applications, and the build details are orthogonal to
that.
Neil

> Regards,
> Olivier
> 

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22 10:14         ` Panu Matilainen
  2015-09-22 10:36           ` Panu Matilainen
@ 2015-09-22 14:40           ` Olivier MATZ
  2015-09-23 14:54             ` Arevalo, Mario Alfredo C
  1 sibling, 1 reply; 150+ messages in thread
From: Olivier MATZ @ 2015-09-22 14:40 UTC (permalink / raw)
  To: Panu Matilainen, Mario Carrillo, dev

Hi,

On 09/22/2015 12:14 PM, Panu Matilainen wrote:
> In my packaging of DPDK I ended up providing both: headers, libraries
> etc in the normal system paths, and then a separate dpdk-sdk directory
> holding the SDK-parts like mk bits and symlinking to the libs and
> headers as needed, so that you can actually point RTE_SDK to that
> dpdk-sdk dir and be able to build apps against the thing.

Great, it didn't know that.

>> My question is: do we want to keep the current install behavior for
>> compatibility or not? Should we consider this makefile directive as
>> an API? People may use it, and we should at least ask us it it should
>> follow a sort of API deprecation process like we do for the code.
>> That's why I talked about 2 new commands and deprecate the old one.
> 
> I'd be surprised if somebody somewhere isn't relying on the current
> specific behavior, given its explicitly documented and all. Whether it
> needs to stay, and whether it needs to stay as the default ... I
> wouldn't miss it, but its a question for those using and depending on it
> really.

Ok. So if nobody else complains, I have no objection to change the
default behavior of "make install" to this which indeed looks more
usual and distribution-friendly. In this case we may remove the
old one, it's probably better than having a H=1 option.


Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install
  2015-09-22 14:40           ` Olivier MATZ
@ 2015-09-23 14:54             ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-09-23 14:54 UTC (permalink / raw)
  To: Olivier MATZ, Panu Matilainen, dev, nhorman

Hi,
 
Thanks you for your feedback, I’ll send a version 2 based on last comments.
 
Thanks,
Mario

________________________________________
From: Olivier MATZ [olivier.matz@6wind.com]
Sent: Tuesday, September 22, 2015 7:40 AM
To: Panu Matilainen; Arevalo, Mario Alfredo C; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install

Hi,

On 09/22/2015 12:14 PM, Panu Matilainen wrote:
> In my packaging of DPDK I ended up providing both: headers, libraries
> etc in the normal system paths, and then a separate dpdk-sdk directory
> holding the SDK-parts like mk bits and symlinking to the libs and
> headers as needed, so that you can actually point RTE_SDK to that
> dpdk-sdk dir and be able to build apps against the thing.

Great, it didn't know that.

>> My question is: do we want to keep the current install behavior for
>> compatibility or not? Should we consider this makefile directive as
>> an API? People may use it, and we should at least ask us it it should
>> follow a sort of API deprecation process like we do for the code.
>> That's why I talked about 2 new commands and deprecate the old one.
>
> I'd be surprised if somebody somewhere isn't relying on the current
> specific behavior, given its explicitly documented and all. Whether it
> needs to stay, and whether it needs to stay as the default ... I
> wouldn't miss it, but its a question for those using and depending on it
> really.

Ok. So if nobody else complains, I have no objection to change the
default behavior of "make install" to this which indeed looks more
usual and distribution-friendly. In this case we may remove the
old one, it's probably better than having a H=1 option.


Regards,
Olivier

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

* [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (8 preceding siblings ...)
  2015-09-22  8:16 ` Olivier MATZ
@ 2015-09-29  0:00 ` Mario Carrillo
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers Mario Carrillo
                     ` (7 more replies)
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                   ` (6 subsequent siblings)
  16 siblings, 8 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:00 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET

v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (8):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing nic bind files
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files

 mk/rte.sdkinstall.mk | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |   6 ++-
 2 files changed, 123 insertions(+), 2 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
@ 2015-09-29  0:00   ` Mario Carrillo
  2015-09-29  8:49     ` Panu Matilainen
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 2/8] mk: Add rule for installing app files Mario Carrillo
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:00 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/usr/include/dpdk
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 17 +++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..3ec344e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,12 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
+ifeq (,$(wildcard $(BUILD_DIR)/build/.config))
 T=*
+else
+INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
+HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+endif
 endif
 
 #
@@ -72,6 +77,18 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
+#
+# install headers in /usr/include/dpdk
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers
+	@[ -d $(INCLUDE_DIR) ] || mkdir -p $(INCLUDE_DIR)
+	@for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	cp -rf $$HEADER ${INCLUDE_DIR}; \
+	echo installing: $$HEADER; \
+	done
 
 #
 # uninstall: remove all built sdk
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 2/8] mk: Add rule for installing app files
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers Mario Carrillo
@ 2015-09-29  0:00   ` Mario Carrillo
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries Mario Carrillo
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:00 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK app files,
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/usr/bin
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 14 +++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3ec344e..44e770d 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -44,7 +44,9 @@ ifeq (,$(wildcard $(BUILD_DIR)/build/.config))
 T=*
 else
 INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
+BIN_DIR := $(DESTDIR)/usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 endif
 endif
 
@@ -89,7 +91,17 @@ install-headers:
 	cp -rf $$HEADER ${INCLUDE_DIR}; \
 	echo installing: $$HEADER; \
 	done
-
+#
+# install app files in /usr/bin
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files
+	@[ -d $(INCLUDE_BIN) ] || mkdir -p $(INCLUDE_BIN)
+	@for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${BIN_DIR}; \
+	echo installing: $$BIN_FILE; \
+	done
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers Mario Carrillo
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 2/8] mk: Add rule for installing app files Mario Carrillo
@ 2015-09-29  0:00   ` Mario Carrillo
  2015-09-29  9:28     ` Panu Matilainen
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 4/8] mk: Add rule for installing modules Mario Carrillo
                     ` (4 subsequent siblings)
  7 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:00 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" for this case
if the architecture is 64 bits libraries will be instaled
in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 44e770d..9a54fb6 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,14 @@ INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
 BIN_DIR := $(DESTDIR)/usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+include $(BUILD_DIR)/build/.config
+RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+ifeq ($(RTE_ARCH),x86_64)
+LIB_DIR := /usr/lib64
+else
+LIB_DIR := /usr/lib
+endif
 endif
 endif
 
@@ -103,6 +111,18 @@ install-bin:
 	echo installing: $$BIN_FILE; \
 	done
 #
+# if architecture is 64 bits install in /usr/lib64
+# else /usr/lib
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@[ -d $(LIB_DIR) ] || mkdir -p $(LIB_DIR)
+	@for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${LIB_DIR}; \
+	echo installing: $$LIB; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 4/8] mk: Add rule for installing modules
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries Mario Carrillo
@ 2015-09-29  0:00   ` Mario Carrillo
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 5/8] mk: Add rule for installing documentation Mario Carrillo
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:00 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" for this case
if RTE_EXEC_ENV=linuxapp modules will be installed
in: $(DESTDIR)/lib/modules/$(uname -r)/build else they will be in:
$(DESTDIR)/boot/modules
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 9a54fb6..22cd7d9 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -48,13 +48,20 @@ BIN_DIR := $(DESTDIR)/usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
 ifeq ($(RTE_ARCH),x86_64)
 LIB_DIR := /usr/lib64
 else
 LIB_DIR := /usr/lib
 endif
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+KERNEL_DIR := $(DESTDIR)/lib/modules/$(shell uname -r)/build
+else
+KERNEL_DIR := $(DESTDIR)/boot/modules
+endif
 endif
 endif
 
@@ -123,6 +130,19 @@ install-lib:
 	echo installing: $$LIB; \
 	done
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# $(DESTDIR)/lib/modules/$(uname -r)/build
+# else $(DESTDIR)/boot/modules/
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@[ -d $(KERNEL_DIR) ] || mkdir -p $(KERNEL_DIR)
+	@for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${KERNEL_DIR}; \
+	echo installing: $$MOD; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 5/8] mk: Add rule for installing documentation
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 4/8] mk: Add rule for installing modules Mario Carrillo
@ 2015-09-29  0:01   ` Mario Carrillo
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 6/8] mk: Add rule for installing nic bind files Mario Carrillo
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:01 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/usr/share/doc/dpdk
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 13 +++++++++++++
 mk/rte.sdkroot.mk    |  6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 22cd7d9..c287526 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -45,10 +45,12 @@ T=*
 else
 INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
 BIN_DIR := $(DESTDIR)/usr/bin
+DATA_DIR := $(DESTDIR)/usr/share
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(BUILD_DIR)/doc/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -143,6 +145,17 @@ install-mod:
 	echo installing: $$MOD; \
 	done
 #
+# install documentation in /usr/share/doc/dpdk
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@[ -d $(DATA_DIR)/doc/dpdk ] || mkdir -p $(DATA_DIR)/doc/dpdk
+	@for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DATA_DIR}/doc/dpdk; \
+	echo installing: $$DOC; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..43f937e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,10 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 6/8] mk: Add rule for installing nic bind files
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 5/8] mk: Add rule for installing documentation Mario Carrillo
@ 2015-09-29  0:01   ` Mario Carrillo
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 7/8] mk: Add rule for installing sdk files Mario Carrillo
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 8/8] mk: Add rule for installing runtime files Mario Carrillo
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:01 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK nic bind files,
when invoking "make install-sbin" nic bind files will
be installed in: $(DESTDIR)/usr/sbin/dpdk_nic_bind
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and dpdk spec file.
Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 13 +++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c287526..fb07a66 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,11 +46,13 @@ else
 INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
 BIN_DIR := $(DESTDIR)/usr/bin
 DATA_DIR := $(DESTDIR)/usr/share
+SBIN_DIR := $(DESTDIR)/usr/sbin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 DOCS := $(wildcard $(BUILD_DIR)/doc/*)
+NIC_BIND_FILES := $(wildcard $(BUILD_DIR)/tools/*nic_bind.py)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -156,6 +158,17 @@ install-doc:
 	echo installing: $$DOC; \
 	done
 #
+# install nic bind files in /usr/sbin/dpdk_nic_bind
+#
+.PHONY: install-sbin
+install-sbin:
+	@echo ================== Installing nic bind files
+	@[ -d $(SBIN_DIR)/dpdk_nic_bin ] || mkdir -p $(SBIN_DIR)/dpdk_nic_bind
+	@for NB_FILE in ${NIC_BIND_FILES}; do \
+	cp -rf $$NB_FILE ${SBIN_DIR}/dpdk_nic_bind; \
+	echo installing: $$NB_FILE; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 43f937e..862af9e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
+install-doc install-sbin uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-uninstall:
+install-sbin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 7/8] mk: Add rule for installing sdk files
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 6/8] mk: Add rule for installing nic bind files Mario Carrillo
@ 2015-09-29  0:01   ` Mario Carrillo
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 8/8] mk: Add rule for installing runtime files Mario Carrillo
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:01 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples, tools, config files will be installed in:
$(DESTDIR)/usr/share/dpdk
and headers will be installed in: $(DESTDIR)/usr/include/dpdk
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index fb07a66..82c4053 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -169,6 +169,24 @@ install-sbin:
 	echo installing: $$NB_FILE; \
 	done
 #
+# install sdk files
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DATA_DIR)/dpdk ] || mkdir -p $(DATA_DIR)/dpdk; \
+	cp -rf $(BUILD_DIR)/mk $(DATA_DIR)/dpdk; \
+	echo installing: $(BUILD_DIR)/mk; \
+	cp -rf $(BUILD_DIR)/scripts $(DATA_DIR)/dpdk; \
+	echo installing: $(BUILD_DIR)/scripts; \
+	cp -rf $(BUILD_DIR)/examples $(DATA_DIR)/dpdk; \
+	echo installing: $(BUILD_DIR)/examples; \
+	cp -rf $(BUILD_DIR)/tools $(DATA_DIR)/dpdk; \
+	echo installing: $(BUILD_DIR)/scripts
+	@[ -d $(DATA_DIR)/dpdk/config ] || mkdir -p $(DATA_DIR)/dpdk/config; \
+	cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config; \
+	echo installing: $(BUILD_DIR)/build/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 862af9e..245ed21 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sbin uninstall
+install-doc install-sbin install-sdk uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sbin uninstall:
+install-sbin install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v2 8/8] mk: Add rule for installing runtime files
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 7/8] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-09-29  0:01   ` Mario Carrillo
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-09-29  0:01 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind files and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be installed in:
$(DESTDIR)/usr/bin (binary files)
$(DESTDIR)/lib/modules/$(uname -r)/build (modules)
$(DESTDIR)/usr/sbin/dpdk_nic_bind (nic bind files)
$(DESTDIR)/usr/share/doc/dpdk (documentation)
if the architecture is 64 bits libraries will be instaled
in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 6 ++++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 82c4053..9d08a5e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -187,6 +187,12 @@ install-sdk: install-headers
 	cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config; \
 	echo installing: $(BUILD_DIR)/build/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-sbin install-doc install-mod
+
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 245ed21..296eba2 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sbin install-sdk uninstall
+install-doc install-sbin install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sbin install-sdk uninstall:
+install-sbin install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers Mario Carrillo
@ 2015-09-29  8:49     ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-29  8:49 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 09/29/2015 03:00 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK headers,
> when invoking "make install-headers" headers will
> be installed in: $(DESTDIR)/usr/include/dpdk
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>   mk/rte.sdkinstall.mk | 17 +++++++++++++++++
>   mk/rte.sdkroot.mk    |  4 ++--
>   2 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 86c98a5..3ec344e 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -40,7 +40,12 @@ endif
>   # target name or a name containing jokers "*". Example:
>   # x86_64-native-*-gcc
>   ifndef T
> +ifeq (,$(wildcard $(BUILD_DIR)/build/.config))
>   T=*
> +else
> +INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk

This makes it cumbersome to override INCLUDE_DIR. Please keep $(DESTDIR) 
separate and only use it when actually copying, and only set INCLUDE_DIR 
here if not already set, ie

INCLUDE_DIR ?= /usr/include/dpdk

...and then something like:
     @[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)
     @for HSLINK in ${HSLINKS}; do \
     HEADER=$$(readlink -f $$HSLINK); \
     cp -rf $$HEADER ${DESTDIR}/${INCLUDE_DIR}; \
     echo installing: $$HEADER; \

The same goes for all the locations in the other patches.

The need to override includedir might not be that common, but for 
example it could be used for installing multiple versions in parallel. 
For others like LIB_DIR the ability to override is truly required 
because distros differ wildly in this regard.

Thanks for working on this!

	- Panu -

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

* Re: [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries
  2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries Mario Carrillo
@ 2015-09-29  9:28     ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-09-29  9:28 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 09/29/2015 03:00 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK libraries,
> when invoking "make install-lib" for this case
> if the architecture is 64 bits libraries will be instaled
> in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>   mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
>   mk/rte.sdkroot.mk    |  4 ++--
>   2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 44e770d..9a54fb6 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -47,6 +47,14 @@ INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
>   BIN_DIR := $(DESTDIR)/usr/bin
>   HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
>   BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
> +LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
> +include $(BUILD_DIR)/build/.config
> +RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
> +ifeq ($(RTE_ARCH),x86_64)
> +LIB_DIR := /usr/lib64
> +else
> +LIB_DIR := /usr/lib
> +endif
>   endif
>   endif

Like explained in 
http://dpdk.org/ml/archives/dev/2015-September/023839.html, this 
arch-based heuristics for LIB_DIR will be wrong at least as often as it 
is sort of right. Better IMO just to default to /usr/lib and let people 
override than try to be clever (and fail):

LIB_DIR ?= /usr/lib

>
> @@ -103,6 +111,18 @@ install-bin:
>   	echo installing: $$BIN_FILE; \
>   	done
>   #
> +# if architecture is 64 bits install in /usr/lib64
> +# else /usr/lib
> +#
> +.PHONY: install-lib
> +install-lib:
> +	@echo ================== Installing libraries
> +	@[ -d $(LIB_DIR) ] || mkdir -p $(LIB_DIR)
> +	@for LIB in ${LIBS}; do \
> +	cp -rf $$LIB ${LIB_DIR}; \

This doesn't honor $DESTDIR.

	- Panu -

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

* [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (9 preceding siblings ...)
  2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
@ 2015-10-01  0:11 ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 1/8] mk: Add rule for installing headers Mario Carrillo
                     ` (7 more replies)
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                   ` (5 subsequent siblings)
  16 siblings, 8 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (8):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing nic bind files
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files

 mk/rte.sdkinstall.mk | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |   6 ++-
 2 files changed, 131 insertions(+), 2 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 1/8] mk: Add rule for installing headers
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 2/8] mk: Add rule for installing app files Mario Carrillo
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(INCLUDE_DIR)
where INCLUDE_DIR=/usr/include/dpdk by default,
you can override INCLUDE_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 ++++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..0d5cbcf 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,12 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
+ifeq (,$(wildcard $(BUILD_DIR)/build/.config))
 T=*
+else
+INCLUDE_DIR ?= /usr/include/dpdk
+HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+endif
 endif
 
 #
@@ -72,7 +77,19 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/include/dpdk by default
+# INCLUDE_DIR can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)
+	@for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	cp -rf $$HEADER ${DESTDIR}/${INCLUDE_DIR}; \
+	echo installing: $$HEADER; \
+	done
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 2/8] mk: Add rule for installing app files
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 1/8] mk: Add rule for installing headers Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 3/8] mk: Add rule for installing libraries Mario Carrillo
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK app files,
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(BIN_DIR)
where BIN_DIR=/usr/bin by default, you can
override BIN_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 0d5cbcf..7d7c2c9 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -44,7 +44,9 @@ ifeq (,$(wildcard $(BUILD_DIR)/build/.config))
 T=*
 else
 INCLUDE_DIR ?= /usr/include/dpdk
+BIN_DIR ?= /usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 endif
 endif
 
@@ -91,6 +93,18 @@ install-headers:
 	echo installing: $$HEADER; \
 	done
 #
+# install app files in /usr/bin by default
+# BIN_DIR can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files
+	@[ -d $(DESTDIR)/$(BIN_DIR) ] || mkdir -p $(DESTDIR)/$(BIN_DIR)
+	@for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${BIN_DIR}; \
+	echo installing: $$BIN_FILE; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 3/8] mk: Add rule for installing libraries
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 1/8] mk: Add rule for installing headers Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 2/8] mk: Add rule for installing app files Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules Mario Carrillo
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(LIB_DIR)
if architecture is 64 bits then LIB_DIR=/usr/lib64
else LIB_DIR=/usr/lib by default, you can override
LIB_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 +++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 7d7c2c9..25b8122 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,14 @@ INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+include $(BUILD_DIR)/build/.config
+RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+ifeq ($(RTE_ARCH),x86_64)
+LIB_DIR ?= /usr/lib64
+else
+LIB_DIR ?= /usr/lib
+endif
 endif
 endif
 
@@ -105,6 +113,19 @@ install-bin:
 	echo installing: $$BIN_FILE; \
 	done
 #
+# if architecture is 64 bits install in /usr/lib64
+# else /usr/lib by default
+# LIB_DIR can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@[ -d $(DESTDIR)/$(LIB_DIR) ] || mkdir -p $(DESTDIR)/$(LIB_DIR)
+	@for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${LIB_DIR}; \
+	echo installing: $$LIB; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 3/8] mk: Add rule for installing libraries Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-02 10:38     ` Panu Matilainen
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 5/8] mk: Add rule for installing documentation Mario Carrillo
                     ` (3 subsequent siblings)
  7 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(KERNEL_DIR)
if RTE_EXEC_ENV=linuxapp then
KERNEL_DIR=/lib/modules/$(uname -r)/build
else KERNEL_DIR=/boot/modules
by default, you can override KERNEL_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 +++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 25b8122..dff1e4d 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -48,13 +48,20 @@ BIN_DIR ?= /usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
 ifeq ($(RTE_ARCH),x86_64)
 LIB_DIR ?= /usr/lib64
 else
 LIB_DIR ?= /usr/lib
 endif
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
+else
+KERNEL_DIR ?= /boot/modules
+endif
 endif
 endif
 
@@ -126,6 +133,20 @@ install-lib:
 	echo installing: $$LIB; \
 	done
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/build
+# else /boot/modules/ by default
+# KERNEL_DIR can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@[ -d $(DESTDIR)/$(KERNEL_DIR) ] || mkdir -p $(DESTDIR)/$(KERNEL_DIR)
+	@for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${KERNEL_DIR}; \
+	echo installing: $$MOD; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 5/8] mk: Add rule for installing documentation
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files Mario Carrillo
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(DOC_DIR) where
DOC_DIR=$(DESTDIR)/usr/share/doc/dpdk by default, you can
override DOC_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

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

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index dff1e4d..5a2fd40 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -45,10 +45,12 @@ T=*
 else
 INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
+DOC_DIR ?= /usr/share/doc/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(BUILD_DIR)/doc/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -147,6 +149,18 @@ install-mod:
 	echo installing: $$MOD; \
 	done
 #
+# install documentation in /usr/share/doc/dpdk
+# bu default, DOC_DIR can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@[ -d $(DESTDIR)/$(DOC_DIR) ] || mkdir -p $(DESTDIR)/$(DOC_DIR)
+	@for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${DOC_DIR}; \
+	echo installing: $$DOC; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..43f937e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,10 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 5/8] mk: Add rule for installing documentation Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-02 10:49     ` Panu Matilainen
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 7/8] mk: Add rule for installing sdk files Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files Mario Carrillo
  7 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK nic bind files,
when invoking "make install-sbin" nic bind files will
be installed by default in: $(DESTDIR)/$(SBIN_DIR)
where SBIN_DIR=/usr/sbin/dpdk_nic_bind by default,
you can override SBIN_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and dpdk spec file.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 5a2fd40..4eecf31 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,11 +46,13 @@ else
 INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
 DOC_DIR ?= /usr/share/doc/dpdk
+SBIN_DIR ?= /usr/sbin/dpdk_nic_bind
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 DOCS := $(wildcard $(BUILD_DIR)/doc/*)
+NIC_BIND_FILES := $(wildcard $(BUILD_DIR)/tools/*nic_bind.py)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -161,6 +163,18 @@ install-doc:
 	echo installing: $$DOC; \
 	done
 #
+# install nic bind files in /usr/sbin/dpdk_nic_bind
+# by default SBIN_DIR can be overridden.
+#
+.PHONY: install-sbin
+install-sbin:
+	@echo ================== Installing nic bind files
+	@[ -d $(DESTDIR)/$(SBIN_DIR) ] || mkdir -p $(DESTDIR)/$(SBIN_DIR)
+	@for NB_FILE in ${NIC_BIND_FILES}; do \
+	cp -rf $$NB_FILE ${DESTDIR}/${SBIN_DIR}; \
+	echo installing: $$NB_FILE; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 43f937e..862af9e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
+install-doc install-sbin uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-uninstall:
+install-sbin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 7/8] mk: Add rule for installing sdk files
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files Mario Carrillo
  7 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples, tools, config files will be installed in:
$(DESTDIR)/$(SDK_DIR)
and headers will be installed in:
$(DESTDIR)/$(INCLUDE_DIR)
where SDK_DIR=/usr/share/dpdk and INCLUDE_DIR=/usr/include/dpdk
by default, you can overrifr SDK_DIR and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 4eecf31..c508758 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,7 @@ INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
 DOC_DIR ?= /usr/share/doc/dpdk
 SBIN_DIR ?= /usr/sbin/dpdk_nic_bind
+DATA_DIR ?= /usr/share/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
@@ -175,6 +176,25 @@ install-sbin:
 	echo installing: $$NB_FILE; \
 	done
 #
+# install sdk files in /usr/share/dpdk by default
+# DATA_DIR can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(DATA_DIR) ] || mkdir -p $(DESTDIR)/$(DATA_DIR); \
+	cp -rf $(BUILD_DIR)/mk $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/mk; \
+	cp -rf $(BUILD_DIR)/scripts $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/scripts; \
+	cp -rf $(BUILD_DIR)/examples $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/examples; \
+	cp -rf $(BUILD_DIR)/tools $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/scripts
+	@[ -d $(DESTDIR)/$(DATA_DIR)/config ] || mkdir -p $(DESTDIR)/$(DATA_DIR)/config; \
+	cp -f $(BUILD_DIR)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
+	echo installing: $(BUILD_DIR)/build/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 862af9e..245ed21 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sbin uninstall
+install-doc install-sbin install-sdk uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sbin uninstall:
+install-sbin install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 7/8] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-10-01  0:11   ` Mario Carrillo
  2015-10-02 11:15     ` Panu Matilainen
  7 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-01  0:11 UTC (permalink / raw)
  To: dev; +Cc: pmatilai

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind files and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files)
$(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind (nic bind
files)
$(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)
$(DESTDIR)/$(LIB_DIR)  (libraries)
if the architecture is 64 bits then LIB_DIR=/usr/lib64
else LIB_DIR=/usr/lib
$(DESTDIR)/$(KERNEL_DIR) (modules)
if RTE_EXEC_ENV=linuxapp then
KERNEL_DIR=/lib/modules/$(uname -r)/build
else KERNEL_DIR=/boot/modules
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 6 ++++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c508758..c34bc3a 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -195,6 +195,12 @@ install-sdk: install-headers
 	cp -f $(BUILD_DIR)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
 	echo installing: $(BUILD_DIR)/build/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-sbin install-doc install-mod
+
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 245ed21..296eba2 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sbin install-sdk uninstall
+install-doc install-sbin install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sbin install-sdk uninstall:
+install-sbin install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules Mario Carrillo
@ 2015-10-02 10:38     ` Panu Matilainen
  2015-10-02 16:26       ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-10-02 10:38 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK modules,
> when invoking "make install-mod" modules will be
> installed in: $(DESTDIR)/$(KERNEL_DIR)
> if RTE_EXEC_ENV=linuxapp then
> KERNEL_DIR=/lib/modules/$(uname -r)/build

/lib/modules/$(uname -r)/build is the path you need when *building* 
external kernel modules, you dont want to install anything there.

The default install path for the kernel modules should be somewhere 
within /lib/modules/$(uname -r)/extra/, but dunno what the recommended 
naming/placing within that is.

Sorry for not catching this earlier,

	- Panu -

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

* Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files Mario Carrillo
@ 2015-10-02 10:49     ` Panu Matilainen
  2015-10-02 10:54       ` Richardson, Bruce
  0 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-10-02 10:49 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK nic bind files,
> when invoking "make install-sbin" nic bind files will
> be installed by default in: $(DESTDIR)/$(SBIN_DIR)
> where SBIN_DIR=/usr/sbin/dpdk_nic_bind by default,
> you can override SBIN_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> and dpdk spec file.
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>   mk/rte.sdkinstall.mk | 14 ++++++++++++++
>   mk/rte.sdkroot.mk    |  4 ++--
>   2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 5a2fd40..4eecf31 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -46,11 +46,13 @@ else
>   INCLUDE_DIR ?= /usr/include/dpdk
>   BIN_DIR ?= /usr/bin
>   DOC_DIR ?= /usr/share/doc/dpdk
> +SBIN_DIR ?= /usr/sbin/dpdk_nic_bind
>   HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
>   BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
>   LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
>   MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
>   DOCS := $(wildcard $(BUILD_DIR)/doc/*)
> +NIC_BIND_FILES := $(wildcard $(BUILD_DIR)/tools/*nic_bind.py)
>   include $(BUILD_DIR)/build/.config
>   RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
>   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
> @@ -161,6 +163,18 @@ install-doc:
>   	echo installing: $$DOC; \
>   	done
>   #
> +# install nic bind files in /usr/sbin/dpdk_nic_bind
> +# by default SBIN_DIR can be overridden.
> +#

This creates an out-of-path directory /usr/sbin/dpdk_nic_bind/ in which 
the dpdk_nic_bind.py is installed. Besides not being a very accessible 
location, the FHS explicitly forbids creation of subdirectories below 
/usr/[s]bin.

SBIN_DIR should be /usr/sbin unless overridden, but OTOH I think this 
could go into /usr/bin just as well, the split is fairly ambiguous 
anyway (I mean, testpmd is not something a regular user is going to run 
either)

In addition, if dpdk_nic_bind.py is installed then perhaps the 
cpu_layout.py utility should be installed too?

	- Panu -

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

* Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-10-02 10:49     ` Panu Matilainen
@ 2015-10-02 10:54       ` Richardson, Bruce
  2015-10-02 16:27         ` Arevalo, Mario Alfredo C
  2015-11-27 15:52         ` Thomas Monjalon
  0 siblings, 2 replies; 150+ messages in thread
From: Richardson, Bruce @ 2015-10-02 10:54 UTC (permalink / raw)
  To: Panu Matilainen, Arevalo, Mario Alfredo C, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Panu Matilainen
> Sent: Friday, October 2, 2015 11:50 AM
> To: Arevalo, Mario Alfredo C; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic
> bind files
> 
> On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> > Add hierarchy-file support to the DPDK nic bind files, when invoking
> > "make install-sbin" nic bind files will be installed by default in:
> > $(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind by
> > default, you can override SBIN_DIR var.
> > This hierarchy is based on:
> > http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> > and dpdk spec file.
> >
> > Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> > ---
> >   mk/rte.sdkinstall.mk | 14 ++++++++++++++
> >   mk/rte.sdkroot.mk    |  4 ++--
> >   2 files changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index
> > 5a2fd40..4eecf31 100644
> > --- a/mk/rte.sdkinstall.mk
> > +++ b/mk/rte.sdkinstall.mk
> > @@ -46,11 +46,13 @@ else
> >   INCLUDE_DIR ?= /usr/include/dpdk
> >   BIN_DIR ?= /usr/bin
> >   DOC_DIR ?= /usr/share/doc/dpdk
> > +SBIN_DIR ?= /usr/sbin/dpdk_nic_bind
> >   HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
> >   BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
> >   LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
> >   MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
> >   DOCS := $(wildcard $(BUILD_DIR)/doc/*)
> > +NIC_BIND_FILES := $(wildcard $(BUILD_DIR)/tools/*nic_bind.py)
> >   include $(BUILD_DIR)/build/.config
> >   RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
> >   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%) @@ -161,6 +163,18 @@
> > install-doc:
> >   	echo installing: $$DOC; \
> >   	done
> >   #
> > +# install nic bind files in /usr/sbin/dpdk_nic_bind # by default
> > +SBIN_DIR can be overridden.
> > +#
> 
> This creates an out-of-path directory /usr/sbin/dpdk_nic_bind/ in which
> the dpdk_nic_bind.py is installed. Besides not being a very accessible
> location, the FHS explicitly forbids creation of subdirectories below
> /usr/[s]bin.
> 
> SBIN_DIR should be /usr/sbin unless overridden, but OTOH I think this
> could go into /usr/bin just as well, the split is fairly ambiguous anyway
> (I mean, testpmd is not something a regular user is going to run
> either)
> 
> In addition, if dpdk_nic_bind.py is installed then perhaps the
> cpu_layout.py utility should be installed too?
> 
> 	- Panu -

I think there are better utilities available for determining the core layout
that cpu_layout.py. "lstopo", for one, is much more powerful. Do we want/need
to keep our own script around for that?

/Bruce

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

* Re: [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files
  2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-10-02 11:15     ` Panu Matilainen
  2015-10-02 11:25       ` Bruce Richardson
                         ` (2 more replies)
  0 siblings, 3 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-10-02 11:15 UTC (permalink / raw)
  To: Mario Carrillo, dev

On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK libraries, modules,
> binary files, nic bind files and documentation,
> when invoking "make install-fhs" (filesystem hierarchy standard)
> runtime files will be by default installed in:
> $(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files)
> $(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind (nic bind
> files)
> $(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)
> $(DESTDIR)/$(LIB_DIR)  (libraries)
> if the architecture is 64 bits then LIB_DIR=/usr/lib64
> else LIB_DIR=/usr/lib
> $(DESTDIR)/$(KERNEL_DIR) (modules)
> if RTE_EXEC_ENV=linuxapp then
> KERNEL_DIR=/lib/modules/$(uname -r)/build
> else KERNEL_DIR=/boot/modules
> All directory variables mentioned above can be overridden.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>

Hmm, I think there's a slight misunderstanding here.

What I meant earlier by install-sdk and install-fhs is to preserve the 
current behavior of "make install" as "make install-sdk" and have "make 
install-fhs" behave like normal OSS app on "make install", which 
installs everything (both devel and runtime parts)

This patch series eliminates the current behavior of "make install" 
entirely. I personally would not miss it at all, but there likely are 
people relying on it since its quite visibly documented and all. So I 
think the idea was to introduce a separate FHS-installation target and 
then deal with the notion of default behaviors etc separately.

I guess it was already this way in v2 of the series, apologies for 
missing it there.

	- Panu -

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

* Re: [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files
  2015-10-02 11:15     ` Panu Matilainen
@ 2015-10-02 11:25       ` Bruce Richardson
  2015-10-02 16:29       ` Arevalo, Mario Alfredo C
  2015-10-12  9:28       ` Jan Blunck
  2 siblings, 0 replies; 150+ messages in thread
From: Bruce Richardson @ 2015-10-02 11:25 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

On Fri, Oct 02, 2015 at 02:15:29PM +0300, Panu Matilainen wrote:
> On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> >Add hierarchy-file support to the DPDK libraries, modules,
> >binary files, nic bind files and documentation,
> >when invoking "make install-fhs" (filesystem hierarchy standard)
> >runtime files will be by default installed in:
> >$(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files)
> >$(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind (nic bind
> >files)
> >$(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)
> >$(DESTDIR)/$(LIB_DIR)  (libraries)
> >if the architecture is 64 bits then LIB_DIR=/usr/lib64
> >else LIB_DIR=/usr/lib
> >$(DESTDIR)/$(KERNEL_DIR) (modules)
> >if RTE_EXEC_ENV=linuxapp then
> >KERNEL_DIR=/lib/modules/$(uname -r)/build
> >else KERNEL_DIR=/boot/modules
> >All directory variables mentioned above can be overridden.
> >This hierarchy is based on:
> >http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> >
> 
> Hmm, I think there's a slight misunderstanding here.
> 
> What I meant earlier by install-sdk and install-fhs is to preserve the
> current behavior of "make install" as "make install-sdk" and have "make
> install-fhs" behave like normal OSS app on "make install", which installs
> everything (both devel and runtime parts)
> 
> This patch series eliminates the current behavior of "make install"
> entirely. I personally would not miss it at all, but there likely are people
> relying on it since its quite visibly documented and all. So I think the
> idea was to introduce a separate FHS-installation target and then deal with
> the notion of default behaviors etc separately.
> 
> I guess it was already this way in v2 of the series, apologies for missing
> it there.
> 
> 	- Panu -

I also think that having some way to get the old behaviour for those relying on
it would be good. Even though it's not ABI affecting, for those compiling from
source it would be nice to follow some sort of gradual deprecation process rather
than just changing everything in one go.

/Bruce

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

* Re: [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules
  2015-10-02 10:38     ` Panu Matilainen
@ 2015-10-02 16:26       ` Arevalo, Mario Alfredo C
  2015-10-05  7:13         ` Panu Matilainen
  0 siblings, 1 reply; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-02 16:26 UTC (permalink / raw)
  To: Panu Matilainen, dev

     Hi, Panu, perfect thank you for your feedback, I going to change that
path by /lib/modules/$(uname -r)/extra/ in my patch.

Thanks.
Mario.
________________________________________
From: Panu Matilainen [pmatilai@redhat.com]
Sent: Friday, October 02, 2015 3:38 AM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules

On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK modules,
> when invoking "make install-mod" modules will be
> installed in: $(DESTDIR)/$(KERNEL_DIR)
> if RTE_EXEC_ENV=linuxapp then
> KERNEL_DIR=/lib/modules/$(uname -r)/build

/lib/modules/$(uname -r)/build is the path you need when *building*
external kernel modules, you dont want to install anything there.

The default install path for the kernel modules should be somewhere
within /lib/modules/$(uname -r)/extra/, but dunno what the recommended
naming/placing within that is.

Sorry for not catching this earlier,

        - Panu -



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

* Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-10-02 10:54       ` Richardson, Bruce
@ 2015-10-02 16:27         ` Arevalo, Mario Alfredo C
  2015-11-27 15:52         ` Thomas Monjalon
  1 sibling, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-02 16:27 UTC (permalink / raw)
  To: Richardson, Bruce, Panu Matilainen, dev

Hi, Panu and Bruce, sounds good your suggestion :) , then I'm going
to change the patch for installing  dpdk_nic_bind.py and cpu_layout.py  in /usr/bin

Thanks.
Mario.
________________________________________
From: Richardson, Bruce
Sent: Friday, October 02, 2015 3:54 AM
To: Panu Matilainen; Arevalo, Mario Alfredo C; dev@dpdk.org
Subject: RE: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Panu Matilainen
> Sent: Friday, October 2, 2015 11:50 AM
> To: Arevalo, Mario Alfredo C; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic
> bind files
>
> On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> > Add hierarchy-file support to the DPDK nic bind files, when invoking
> > "make install-sbin" nic bind files will be installed by default in:
> > $(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind by
> > default, you can override SBIN_DIR var.
> > This hierarchy is based on:
> > http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> > and dpdk spec file.
> >
> > Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> > ---
> >   mk/rte.sdkinstall.mk | 14 ++++++++++++++
> >   mk/rte.sdkroot.mk    |  4 ++--
> >   2 files changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index
> > 5a2fd40..4eecf31 100644
> > --- a/mk/rte.sdkinstall.mk
> > +++ b/mk/rte.sdkinstall.mk
> > @@ -46,11 +46,13 @@ else
> >   INCLUDE_DIR ?= /usr/include/dpdk
> >   BIN_DIR ?= /usr/bin
> >   DOC_DIR ?= /usr/share/doc/dpdk
> > +SBIN_DIR ?= /usr/sbin/dpdk_nic_bind
> >   HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
> >   BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
> >   LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
> >   MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
> >   DOCS := $(wildcard $(BUILD_DIR)/doc/*)
> > +NIC_BIND_FILES := $(wildcard $(BUILD_DIR)/tools/*nic_bind.py)
> >   include $(BUILD_DIR)/build/.config
> >   RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
> >   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%) @@ -161,6 +163,18 @@
> > install-doc:
> >     echo installing: $$DOC; \
> >     done
> >   #
> > +# install nic bind files in /usr/sbin/dpdk_nic_bind # by default
> > +SBIN_DIR can be overridden.
> > +#
>
> This creates an out-of-path directory /usr/sbin/dpdk_nic_bind/ in which
> the dpdk_nic_bind.py is installed. Besides not being a very accessible
> location, the FHS explicitly forbids creation of subdirectories below
> /usr/[s]bin.
>
> SBIN_DIR should be /usr/sbin unless overridden, but OTOH I think this
> could go into /usr/bin just as well, the split is fairly ambiguous anyway
> (I mean, testpmd is not something a regular user is going to run
> either)
>
> In addition, if dpdk_nic_bind.py is installed then perhaps the
> cpu_layout.py utility should be installed too?
>
>       - Panu -

I think there are better utilities available for determining the core layout
that cpu_layout.py. "lstopo", for one, is much more powerful. Do we want/need
to keep our own script around for that?

/Bruce

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

* Re: [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files
  2015-10-02 11:15     ` Panu Matilainen
  2015-10-02 11:25       ` Bruce Richardson
@ 2015-10-02 16:29       ` Arevalo, Mario Alfredo C
  2015-10-12  9:28       ` Jan Blunck
  2 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-02 16:29 UTC (permalink / raw)
  To: Panu Matilainen, dev

Anwser for [PATCH v3 8/8] mk: Add rule for installing runtime files

Hi Panu,
 
	Thank you for  taking time in this revision :),.  In this patchset
I’ve tried to keep current behavior (make install) untouched, I mean
thye don't affect the current makefile rules and they work like "new features".
For that reason, they were created as new rules. Now you can do the next.

1) make config T=TARGET (Create a build directory with config files according TARGET and directoy environment)
2) make (build dpdk binaries)
and in this point, if you chose some new rule from serie of patches (install-sdk, install-doc, install-bin... etc)
the files that were built in the last step will be installed in paths according this site
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
this just will be possibe if build/.config exist.
3) However if you use last rules, they should have the previos behavior before patches.

example:
make install T=x86_64-native-linuxapp-gcc
then the makefiles are going to config, build and install dpdk in a directory using TARGET as a name.

thanks.
Mario.
________________________________________
From: Panu Matilainen [pmatilai@redhat.com]
Sent: Friday, October 02, 2015 4:15 AM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files

On 10/01/2015 03:11 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK libraries, modules,
> binary files, nic bind files and documentation,
> when invoking "make install-fhs" (filesystem hierarchy standard)
> runtime files will be by default installed in:
> $(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files)
> $(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind (nic bind
> files)
> $(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)
> $(DESTDIR)/$(LIB_DIR)  (libraries)
> if the architecture is 64 bits then LIB_DIR=/usr/lib64
> else LIB_DIR=/usr/lib
> $(DESTDIR)/$(KERNEL_DIR) (modules)
> if RTE_EXEC_ENV=linuxapp then
> KERNEL_DIR=/lib/modules/$(uname -r)/build
> else KERNEL_DIR=/boot/modules
> All directory variables mentioned above can be overridden.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>

Hmm, I think there's a slight misunderstanding here.

What I meant earlier by install-sdk and install-fhs is to preserve the
current behavior of "make install" as "make install-sdk" and have "make
install-fhs" behave like normal OSS app on "make install", which
installs everything (both devel and runtime parts)

This patch series eliminates the current behavior of "make install"
entirely. I personally would not miss it at all, but there likely are
people relying on it since its quite visibly documented and all. So I
think the idea was to introduce a separate FHS-installation target and
then deal with the notion of default behaviors etc separately.

I guess it was already this way in v2 of the series, apologies for
missing it there.

        - Panu -

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

* Re: [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules
  2015-10-02 16:26       ` Arevalo, Mario Alfredo C
@ 2015-10-05  7:13         ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-10-05  7:13 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C, dev

On 10/02/2015 07:26 PM, Arevalo, Mario Alfredo C wrote:
>       Hi, Panu, perfect thank you for your feedback, I going to change that
> path by /lib/modules/$(uname -r)/extra/ in my patch.

Hi,

That's not quite what I suggested:

 > The default install path for the kernel modules should be somewhere
 > within /lib/modules/$(uname -r)/extra/, but dunno what the recommended
 > naming/placing within that is.

I didn't recommend any particular directory since like said, I'm not 
aware of the recommended practise there, but almost certainly you dont 
want to litter the extra/ "root" with arbitrary modules.
Something like /lib/modules/$(uname -r)/extra/drivers/dpdk/ should be 
closer to the mark at least.

	- Panu -

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

* [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (10 preceding siblings ...)
  2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
@ 2015-10-05 20:19 ` Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers Mario Carrillo
                     ` (9 more replies)
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                   ` (4 subsequent siblings)
  16 siblings, 10 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:19 UTC (permalink / raw)
  To: dev

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
however this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET

v4:

Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.

All directory variables mentioned above can be overridden:
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (7):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files

 mk/rte.sdkinstall.mk | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 mk/rte.sdkroot.mk    |   6 ++-
 2 files changed, 118 insertions(+), 3 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-16 19:29     ` Olivier MATZ
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files Mario Carrillo
                     ` (8 subsequent siblings)
  9 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK headers.

When invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(INCLUDE_DIR)
where INCLUDE_DIR=/usr/include/dpdk by default.

You can override INCLUDE_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 18 +++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..f016171 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,10 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
+INCLUDE_DIR ?= /usr/include/dpdk
+HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+endif
 endif
 
 #
@@ -72,7 +76,19 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/include/dpdk by default
+# INCLUDE_DIR can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)
+	@for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	cp -rf $$HEADER ${DESTDIR}/${INCLUDE_DIR}; \
+	echo installing: $$HEADER; \
+	done
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-16 19:30     ` Olivier MATZ
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 3/7] mk: Add rule for installing libraries Mario Carrillo
                     ` (7 subsequent siblings)
  9 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file.

When invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(BIN_DIR)
where BIN_DIR=/usr/bin by default.

You can override BIN_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index f016171..cfcdb25 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,7 +43,11 @@ ifndef T
 T=*
 ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
 INCLUDE_DIR ?= /usr/include/dpdk
+BIN_DIR ?= /usr/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -90,6 +94,18 @@ install-headers:
 	echo installing: $$HEADER; \
 	done
 #
+# install app files in /usr/bin by default
+# BIN_DIR can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files
+	@[ -d $(DESTDIR)/$(BIN_DIR) ] || mkdir -p $(DESTDIR)/$(BIN_DIR)
+	@for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${BIN_DIR}; \
+	echo installing: $$BIN_FILE; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 3/7] mk: Add rule for installing libraries
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 4/7] mk: Add rule for installing modules Mario Carrillo
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK libraries.

When invoking "make install-lib" libraries will
be installed in:
$(DESTDIR)/$(LIB_DIR)

If architecture is 64 bits then LIB_DIR=/usr/lib64
else LIB_DIR=/usr/lib by default.

You can override LIB_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 +++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index cfcdb25..36a59fc 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -48,6 +48,14 @@ HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
 BINARY_FILES += $(NIC_FILES)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+include $(BUILD_DIR)/build/.config
+RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+ifeq ($(RTE_ARCH),x86_64)
+LIB_DIR ?= /usr/lib64
+else
+LIB_DIR ?= /usr/lib
+endif
 endif
 endif
 
@@ -106,6 +114,19 @@ install-bin:
 	echo installing: $$BIN_FILE; \
 	done
 #
+# if architecture is 64 bits install in /usr/lib64
+# else /usr/lib by default
+# LIB_DIR can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@[ -d $(DESTDIR)/$(LIB_DIR) ] || mkdir -p $(DESTDIR)/$(LIB_DIR)
+	@for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${LIB_DIR}; \
+	echo installing: $$LIB; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 4/7] mk: Add rule for installing modules
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 3/7] mk: Add rule for installing libraries Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation Mario Carrillo
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK modules.

When invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(KERNEL_DIR)

If RTE_EXEC_ENV=linuxapp then
KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KERNEL_DIR=/boot/modules by default.

You can override KERNEL_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 +++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 36a59fc..628d9fb 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -49,13 +49,20 @@ BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
 BINARY_FILES += $(NIC_FILES)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
 ifeq ($(RTE_ARCH),x86_64)
 LIB_DIR ?= /usr/lib64
 else
 LIB_DIR ?= /usr/lib
 endif
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+KERNEL_DIR ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+KERNEL_DIR ?= /boot/modules
+endif
 endif
 endif
 
@@ -127,6 +134,20 @@ install-lib:
 	echo installing: $$LIB; \
 	done
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# KERNEL_DIR can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@[ -d $(DESTDIR)/$(KERNEL_DIR) ] || mkdir -p $(DESTDIR)/$(KERNEL_DIR)
+	@for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${KERNEL_DIR}; \
+	echo installing: $$MOD; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 4/7] mk: Add rule for installing modules Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-16 19:30     ` Olivier MATZ
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files Mario Carrillo
                     ` (4 subsequent siblings)
  9 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK documentation.

When invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(DOC_DIR) where
DOC_DIR=$(DESTDIR)/usr/share/doc/dpdk by default.

You can override DOC_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

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

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 628d9fb..d917329 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -44,12 +44,14 @@ T=*
 ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
 INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
+DOC_DIR ?= /usr/share/doc/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
 BINARY_FILES += $(NIC_FILES)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(BUILD_DIR)/doc/*)
 include $(BUILD_DIR)/build/.config
 RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -148,6 +150,18 @@ install-mod:
 	echo installing: $$MOD; \
 	done
 #
+# install documentation in /usr/share/doc/dpdk
+# bu default, DOC_DIR can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@[ -d $(DESTDIR)/$(DOC_DIR) ] || mkdir -p $(DESTDIR)/$(DOC_DIR)
+	@for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${DOC_DIR}; \
+	echo installing: $$DOC; \
+	done
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..43f937e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,10 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-16 19:31     ` Olivier MATZ
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 7/7] mk: Add rule for installing runtime files Mario Carrillo
                     ` (3 subsequent siblings)
  9 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers.

When invoking "make install-sdk" makefiles, scripts,
examples, tools, config files will be installed in:
$(DESTDIR)/$(SDK_DIR)
and headers will be installed in:
$(DESTDIR)/$(INCLUDE_DIR)

Where SDK_DIR=/usr/share/dpdk and INCLUDE_DIR=/usr/include/dpdk
by default.

You can overrite SDK_DIR and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index d917329..3675c5a 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -45,6 +45,7 @@ ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
 INCLUDE_DIR ?= /usr/include/dpdk
 BIN_DIR ?= /usr/bin
 DOC_DIR ?= /usr/share/doc/dpdk
+DATA_DIR ?= /usr/share/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
@@ -162,6 +163,25 @@ install-doc:
 	echo installing: $$DOC; \
 	done
 #
+# install sdk files in /usr/share/dpdk by default
+# DATA_DIR can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(DATA_DIR) ] || mkdir -p $(DESTDIR)/$(DATA_DIR); \
+	cp -rf $(BUILD_DIR)/mk $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/mk; \
+	cp -rf $(BUILD_DIR)/scripts $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/scripts; \
+	cp -rf $(BUILD_DIR)/examples $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/examples; \
+	cp -rf $(BUILD_DIR)/tools $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(BUILD_DIR)/scripts
+	@[ -d $(DESTDIR)/$(DATA_DIR)/config ] || mkdir -p $(DESTDIR)/$(DATA_DIR)/config; \
+	cp -f $(BUILD_DIR)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
+	echo installing: $(BUILD_DIR)/build/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 43f937e..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
+install-doc install-sdk uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-uninstall:
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 7/7] mk: Add rule for installing runtime files
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-10-05 20:20   ` Mario Carrillo
  2015-10-10 17:45   ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Arevalo, Mario Alfredo C
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-05 20:20 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file and documentation.

When invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:

$(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files, nic and cpu
files)

$(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)

$(DESTDIR)/$(LIB_DIR)  (libraries)
If the architecture is 64 bits then LIB_DIR=/usr/lib64
else LIB_DIR=/usr/lib

$(DESTDIR)/$(KERNEL_DIR) (modules)
If RTE_EXEC_ENV=linuxapp then
KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KERNEL_DIR=/boot/modules

All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 5 +++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3675c5a..de86f13 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -182,6 +182,11 @@ install-sdk: install-headers
 	cp -f $(BUILD_DIR)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
 	echo installing: $(BUILD_DIR)/build/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files.
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 7/7] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-10-10 17:45   ` Arevalo, Mario Alfredo C
  2015-10-15 12:32     ` Panu Matilainen
  2015-10-14 15:58   ` Miguel Bernal Marin
  2015-10-16 19:32   ` Olivier MATZ
  9 siblings, 1 reply; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-10 17:45 UTC (permalink / raw)
  To: dev

Hi,

Good day, I was wondering if someone has any comment about it :)

Thank you.
Mario
________________________________________
From: Arevalo, Mario Alfredo C
Sent: Monday, October 05, 2015 1:19 PM
To: dev@dpdk.org
Cc: olivier.matz@6wind.com; Arevalo, Mario Alfredo C
Subject: [PATCH v4 0/7] Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
however this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET

v4:

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
                is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=/usr/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

Also you can use the DESTDIR variable.

All directory variables mentioned above can be overridden:
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v3:

Modify the makefile target to specify the files
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
                is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=/usr/share/dpdk).
make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
                examples, tools and config files).
make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (7):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files

 mk/rte.sdkinstall.mk | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 mk/rte.sdkroot.mk    |   6 ++-
 2 files changed, 118 insertions(+), 3 deletions(-)

--
2.1.0


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

* Re: [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files
  2015-10-02 11:15     ` Panu Matilainen
  2015-10-02 11:25       ` Bruce Richardson
  2015-10-02 16:29       ` Arevalo, Mario Alfredo C
@ 2015-10-12  9:28       ` Jan Blunck
  2 siblings, 0 replies; 150+ messages in thread
From: Jan Blunck @ 2015-10-12  9:28 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

On Fri, Oct 2, 2015 at 12:15 PM, Panu Matilainen <pmatilai@redhat.com> wrote:
> On 10/01/2015 03:11 AM, Mario Carrillo wrote:
>>
>> Add hierarchy-file support to the DPDK libraries, modules,
>> binary files, nic bind files and documentation,
>> when invoking "make install-fhs" (filesystem hierarchy standard)
>> runtime files will be by default installed in:
>> $(DESTDIR)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary files)
>> $(DESTDIR)/$(SBIN_DIR) where SBIN_DIR=/usr/sbin/dpdk_nic_bind (nic bind
>> files)
>> $(DESTDIR)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk (documentation)
>> $(DESTDIR)/$(LIB_DIR)  (libraries)
>> if the architecture is 64 bits then LIB_DIR=/usr/lib64
>> else LIB_DIR=/usr/lib
>> $(DESTDIR)/$(KERNEL_DIR) (modules)
>> if RTE_EXEC_ENV=linuxapp then
>> KERNEL_DIR=/lib/modules/$(uname -r)/build
>> else KERNEL_DIR=/boot/modules
>> All directory variables mentioned above can be overridden.
>> This hierarchy is based on:
>> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>>
>
> Hmm, I think there's a slight misunderstanding here.
>
> What I meant earlier by install-sdk and install-fhs is to preserve the
> current behavior of "make install" as "make install-sdk" and have "make
> install-fhs" behave like normal OSS app on "make install", which installs
> everything (both devel and runtime parts)

>From my point of view it would make sense let 'make install' do the
right thing from
a user perspective (application, library, distribution). The standard
workflow of 'make install'
is well known and supported by many build environments.

One way that could work is to detect the fact that the SDK files are
already installed (e.g.
via $RTE_SDK != $(pwd) ) and in that case skipping the install of them.

Thanks,
Jan

> This patch series eliminates the current behavior of "make install"
> entirely. I personally would not miss it at all, but there likely are people
> relying on it since its quite visibly documented and all. So I think the
> idea was to introduce a separate FHS-installation target and then deal with
> the notion of default behaviors etc separately.
>
> I guess it was already this way in v2 of the series, apologies for missing
> it there.
>
>         - Panu -

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

* Re: [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files.
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-10-10 17:45   ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Arevalo, Mario Alfredo C
@ 2015-10-14 15:58   ` Miguel Bernal Marin
  2015-10-16 19:32   ` Olivier MATZ
  9 siblings, 0 replies; 150+ messages in thread
From: Miguel Bernal Marin @ 2015-10-14 15:58 UTC (permalink / raw)
  To: Panu Matilainen, Olivier MATZ; +Cc: dev

Hi guys,

Have you had any time to check this patchset version?


On 10/5/2015 3:19 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
>
> This patch set allows to install files according to the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> however this patch set does not affect the current dpdk behavior.
>
> Using rules support is possible to do the next steps:
> make config T=TARGET
> make
> make INSTALL-TARGET
>
> v4:
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> * make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
>
> * make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
>
> * make install-lib (install libraries)(dafault path if the architecture is 64 bits
> 		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
>
> * make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
>
> * make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
> 		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).
>
> * make install-sdk (install headers, makefiles, scripts,examples, tools and
> 		config files) (default path DATA_DIR=/usr/share/dpdk).
>
> * make install-fhs (install  libraries, modules, app files,
> 		nic bind files and documentation).
>
> Also you can use the DESTDIR variable.
>
> All directory variables mentioned above can be overridden:
> (BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).
>
>
> v3:
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
> make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
> make install-lib (install libraries)(dafault path if the architecture is 64 bits
> 		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
> make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
> make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
> make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
> 		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
> make install-sdk (install headers, makefiles, scripts,examples, tools and
> 		config files) (default path DATA_DIR=/usr/share/dpdk).
> make install-fhs (install  libraries, modules, app files,
> 		nic bind files and documentation).
>
> Also you can use the DESTDIR variable.
> All directory variables mentioned above can be overridden
> (BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).
>
>
> v2:
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> make install-bin (install app files).
> make install-headers (install headers).
> make install-lib (install libraries).
> make install-sbin (install nic bind files).
> make install-doc (install documentation).
> make install-mod (install modules).
> make install-sdk (install headers, makefiles, scripts,
> 		examples, tools and config files).
> make install-fhs (install  libraries, modules, app files,
> 		nic bind files and documentation).
>
> Also you can use the DESTDIR variable.
>
>
> v1:
>
> By adding a parameter H=1 (hierarchy-file) to makefile system, it is
> possible to do the next steps
>
> make config T=TARGET
> make
> make install H=1
>
> and files will be installed on the proper directory. Also you can use
> the DESTDIR variable.
>
> Mario Carrillo (7):
>    mk: Add rule for installing headers
>    mk: Add rule for installing app files
>    mk: Add rule for installing libraries
>    mk: Add rule for installing modules
>    mk: Add rule for installing documentation
>    mk: Add rule for installing sdk files
>    mk: Add rule for installing runtime files
>
>   mk/rte.sdkinstall.mk | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>   mk/rte.sdkroot.mk    |   6 ++-
>   2 files changed, 118 insertions(+), 3 deletions(-)
>

-- 
Regards,

Miguel Bernal Marin                        Open Source Technology Center
https://clearlinux.org                                 Intel Corporation

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

* Re: [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files.
  2015-10-10 17:45   ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Arevalo, Mario Alfredo C
@ 2015-10-15 12:32     ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-10-15 12:32 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C, dev

On 10/10/2015 08:45 PM, Arevalo, Mario Alfredo C wrote:
> Hi,
>
> Good day, I was wondering if someone has any comment about it :)

Hi, sorry been busy with some other agendas :)

See below...

>
> v4:
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> * make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
>
> * make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
>
> * make install-lib (install libraries)(dafault path if the architecture is 64 bits
>                  is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

I still maintain the LIB_DIR heuristic around x86_64 arch is broken and 
that we'll be better off without it. Even auto*tools and cmake dont try 
to guess this. If you insist on heuristics, you'll need help from other 
tools, eg on systems where systemd-path is available, you can get a 
reasonable well-educated guess from it with "systemd-path 
system-library-arch".

>
> * make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
>
> * make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
>                  KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

Just noticed, this creates the /lib/modules structure even if there are 
no kernel modules to install. Not the end of the world of course.

> * make install-sdk (install headers, makefiles, scripts,examples, tools and
>                  config files) (default path DATA_DIR=/usr/share/dpdk).
>
> * make install-fhs (install  libraries, modules, app files,
>                  nic bind files and documentation).

I still think that install-fhs should include headers as well, that is 
what all normal OSS software does on "make install" anyway. Or just 
install it all (ie whole -sdk). The documentation installed with 
install-fhs includes things like the programmers guide, which is of 
little use without the sdk bits.

	- Pan u-

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

* Re: [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers Mario Carrillo
@ 2015-10-16 19:29     ` Olivier MATZ
  2015-10-19 23:35       ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 150+ messages in thread
From: Olivier MATZ @ 2015-10-16 19:29 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Mario,

Thank you for this patch series, and thank you Panu for the
good comments on this series.

Please see some comments below.

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK headers.
> 
> When invoking "make install-headers" headers will
> be installed in: $(DESTDIR)/$(INCLUDE_DIR)
> where INCLUDE_DIR=/usr/include/dpdk by default.
> 
> You can override INCLUDE_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>  mk/rte.sdkinstall.mk | 18 +++++++++++++++++-
>  mk/rte.sdkroot.mk    |  4 ++--
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 86c98a5..f016171 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -41,6 +41,10 @@ endif
>  # x86_64-native-*-gcc
>  ifndef T
>  T=*
> +ifneq (,$(wildcard $(BUILD_DIR)/build/.config))

What about using $(RTE_OUTPUT) here instead of $(BUILD_DIR)/build ?

With you patch, the following commands work:

  make config T=x86_64-native-linuxapp-gcc
  make -j32
  make install-headers DESTDIR=install

Replacing all the occurences of $(BUILD_DIR)/build by $(RTE_OUTPUT)
would also make the following commands work:

  make config T=x86_64-native-linuxapp-gcc O=build2
  make -j32 O=build2
  make install-headers O=build2 DESTDIR=install2

Note: the default value of RTE_OUTPUT is set to $(RTE_SRCDIR)/build
in mk/rte.sdkroot.mk

We also need to to replace other occurences of $(BUILD_DIR), please
see my comment on patch 2/7.


> +INCLUDE_DIR ?= /usr/include/dpdk
> +HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
> +endif
>  endif
>  
>  #
> @@ -72,7 +76,19 @@ install: $(INSTALL_TARGETS)
>  		echo "Using local configuration"; \
>  	fi
>  	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
> -
> +#
> +# install headers in /usr/include/dpdk by default
> +# INCLUDE_DIR can be overridden.
> +#
> +.PHONY: install-headers
> +install-headers:
> +	@echo ================== Installing headers;
> +	@[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)

I think it's useless to do the [ -d $(DESTDIR)/$(INCLUDE_DIR) ] as the
'mkdir -p' will do it as well.

But maybe it could be useful to check:
  [ "$${HSLINKS}" != "" ]
This would solve the issue described by Panu about the directories
created even if they are empty.

> +	@for HSLINK in ${HSLINKS}; do \

Not sure to understand what is the meaning of HSLINK?
HS = headers?


Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files Mario Carrillo
@ 2015-10-16 19:30     ` Olivier MATZ
  0 siblings, 0 replies; 150+ messages in thread
From: Olivier MATZ @ 2015-10-16 19:30 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Mario,

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK app files,
> nic bind file and cpu layout file.
> 
> When invoking "make install-bin" app files will
> be installed in: $(DESTDIR)/$(BIN_DIR)
> where BIN_DIR=/usr/bin by default.
> 
> You can override BIN_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>  mk/rte.sdkinstall.mk | 16 ++++++++++++++++
>  mk/rte.sdkroot.mk    |  4 ++--
>  2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index f016171..cfcdb25 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -43,7 +43,11 @@ ifndef T
>  T=*
>  ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
>  INCLUDE_DIR ?= /usr/include/dpdk
> +BIN_DIR ?= /usr/bin
>  HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
> +BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
> +NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)

To make it work with O=, I think $(BUILD_DIR) should be replaced
by $(RTE_SDK).


Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation Mario Carrillo
@ 2015-10-16 19:30     ` Olivier MATZ
  2015-10-19 23:36       ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 150+ messages in thread
From: Olivier MATZ @ 2015-10-16 19:30 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Mario,

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK documentation.
> 
> When invoking "make install-doc" documentation files will
> be installed in: $(DESTDIR)/$(DOC_DIR) where
> DOC_DIR=$(DESTDIR)/usr/share/doc/dpdk by default.
> 
> You can override DOC_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>  mk/rte.sdkinstall.mk | 14 ++++++++++++++
>  mk/rte.sdkroot.mk    |  6 ++++--
>  2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 628d9fb..d917329 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -44,12 +44,14 @@ T=*
>  ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
>  INCLUDE_DIR ?= /usr/include/dpdk
>  BIN_DIR ?= /usr/bin
> +DOC_DIR ?= /usr/share/doc/dpdk
>  HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
>  BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
>  NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
>  BINARY_FILES += $(NIC_FILES)
>  LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
>  MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
> +DOCS := $(wildcard $(BUILD_DIR)/doc/*)
>  include $(BUILD_DIR)/build/.config
>  RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
>  RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
> @@ -148,6 +150,18 @@ install-mod:
>  	echo installing: $$MOD; \
>  	done
>  #
> +# install documentation in /usr/share/doc/dpdk
> +# bu default, DOC_DIR can be overriden.
> +#

small typo here (bu -> by)

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files
  2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-10-16 19:31     ` Olivier MATZ
  2015-10-19 14:00       ` Panu Matilainen
  0 siblings, 1 reply; 150+ messages in thread
From: Olivier MATZ @ 2015-10-16 19:31 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Panu,

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK makefiles, scripts,
> examples, tools, config files and headers.
> 
> When invoking "make install-sdk" makefiles, scripts,
> examples, tools, config files will be installed in:
> $(DESTDIR)/$(SDK_DIR)
> and headers will be installed in:
> $(DESTDIR)/$(INCLUDE_DIR)
> 
> Where SDK_DIR=/usr/share/dpdk and INCLUDE_DIR=/usr/include/dpdk
> by default.
> 
> You can overrite SDK_DIR and INCLUDE_DIR vars.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>

I don't know if it's feasible, but I think it would be great here
to be able to install a SDK that is usable to build external
applications.

I mean, doing something like that:

  make install-sdk DESTDIR=/tmp/sdk
  cd /path/to/examples/helloworld
  make RTE_SDK=/tmp/sdk/usr/share/dpdk

Else, what is the purpose of installing the sdk?

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files.
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-10-14 15:58   ` Miguel Bernal Marin
@ 2015-10-16 19:32   ` Olivier MATZ
  9 siblings, 0 replies; 150+ messages in thread
From: Olivier MATZ @ 2015-10-16 19:32 UTC (permalink / raw)
  To: Mario Carrillo, dev

Hi Mario,

Few last comments here, please see below.

On 10/05/2015 10:19 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> 
> This patch set allows to install files according to the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> however this patch set does not affect the current dpdk behavior.
> 
> Using rules support is possible to do the next steps:
> make config T=TARGET
> make
> make INSTALL-TARGET

Just for sake of clarity: the 2 words TARGET are for different things,
right? Maybe it could be replaced by:

  make config T=<config template>
  make
  make <install target>



Thinking a bit more about "make install" current behavior and
the new one.

Today, I think nobody uses "make install" without T=. Indeed,
it is not possible to build all targets (bsd + linux) on the
same host.

So, it won't break anything to have:

  make install    -> do the same than your "make install-fhs"
  make install T=<templates>    -> same than before

In the future, to avoid confusion, we could deprecate the
"make install T=" or rename it in something else... even remove
it if there is an alternative with the new file hierarchy that
you are introducing.


Last comment, I think the "make help" and some documentation
files should be updated to reflect your changes.


Thank you for working on this!

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files
  2015-10-16 19:31     ` Olivier MATZ
@ 2015-10-19 14:00       ` Panu Matilainen
  0 siblings, 0 replies; 150+ messages in thread
From: Panu Matilainen @ 2015-10-19 14:00 UTC (permalink / raw)
  To: Olivier MATZ, Mario Carrillo, dev

On 10/16/2015 10:31 PM, Olivier MATZ wrote:
> Hi Panu,
>
> On 10/05/2015 10:20 PM, Mario Carrillo wrote:
>> Add hierarchy-file support to the DPDK makefiles, scripts,
>> examples, tools, config files and headers.
>>
>> When invoking "make install-sdk" makefiles, scripts,
>> examples, tools, config files will be installed in:
>> $(DESTDIR)/$(SDK_DIR)
>> and headers will be installed in:
>> $(DESTDIR)/$(INCLUDE_DIR)
>>
>> Where SDK_DIR=/usr/share/dpdk and INCLUDE_DIR=/usr/include/dpdk
>> by default.
>>
>> You can overrite SDK_DIR and INCLUDE_DIR vars.
>> This hierarchy is based on:
>> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>>
>> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
>
> I don't know if it's feasible, but I think it would be great here
> to be able to install a SDK that is usable to build external
> applications.
>
> I mean, doing something like that:
>
>    make install-sdk DESTDIR=/tmp/sdk
>    cd /path/to/examples/helloworld
>    make RTE_SDK=/tmp/sdk/usr/share/dpdk
>
> Else, what is the purpose of installing the sdk?

Its possible (been there), it just needs some additional symlinks and 
such, at least for lib/ and include/. However at that point the contents 
become arch-dependent (due to the lib symlink) meaning it cannot go into 
/usr/share.

	- Panu -

> Regards,
> Olivier
>

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

* Re: [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers
  2015-10-16 19:29     ` Olivier MATZ
@ 2015-10-19 23:35       ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-19 23:35 UTC (permalink / raw)
  To: Olivier MATZ, dev

Hi Olivier, thank you for your feedback , more comments below :) 

Thanks.
Mario.
________________________________________
From: Olivier MATZ [olivier.matz@6wind.com]
Sent: Friday, October 16, 2015 12:29 PM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Cc: Panu Matilainen
Subject: Re: [PATCH v4 1/7] mk: Add rule for installing headers

Hi Mario,

Thank you for this patch series, and thank you Panu for the
good comments on this series.

Please see some comments below.

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK headers.
>
> When invoking "make install-headers" headers will
> be installed in: $(DESTDIR)/$(INCLUDE_DIR)
> where INCLUDE_DIR=/usr/include/dpdk by default.
>
> You can override INCLUDE_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>  mk/rte.sdkinstall.mk | 18 +++++++++++++++++-
>  mk/rte.sdkroot.mk    |  4 ++--
>  2 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 86c98a5..f016171 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -41,6 +41,10 @@ endif
>  # x86_64-native-*-gcc
>  ifndef T
>  T=*
> +ifneq (,$(wildcard $(BUILD_DIR)/build/.config))

What about using $(RTE_OUTPUT) here instead of $(BUILD_DIR)/build ?

With you patch, the following commands work:

  make config T=x86_64-native-linuxapp-gcc
  make -j32
  make install-headers DESTDIR=install

Replacing all the occurences of $(BUILD_DIR)/build by $(RTE_OUTPUT)
would also make the following commands work:

  make config T=x86_64-native-linuxapp-gcc O=build2
  make -j32 O=build2
  make install-headers O=build2 DESTDIR=install2

Note: the default value of RTE_OUTPUT is set to $(RTE_SRCDIR)/build
in mk/rte.sdkroot.mk

We also need to to replace other occurences of $(BUILD_DIR), please
see my comment on patch 2/7.


[Mario]: Yes, you right, I can replace it :) 

> +INCLUDE_DIR ?= /usr/include/dpdk
> +HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
> +endif
>  endif
>
>  #
> @@ -72,7 +76,19 @@ install: $(INSTALL_TARGETS)
>               echo "Using local configuration"; \
>       fi
>       $(Q)$(MAKE) all O=$(BUILD_DIR)/$*
> -
> +#
> +# install headers in /usr/include/dpdk by default
> +# INCLUDE_DIR can be overridden.
> +#
> +.PHONY: install-headers
> +install-headers:
> +     @echo ================== Installing headers;
> +     @[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)

I think it's useless to do the [ -d $(DESTDIR)/$(INCLUDE_DIR) ] as the
'mkdir -p' will do it as well.

But maybe it could be useful to check:
  [ "$${HSLINKS}" != "" ]
This would solve the issue described by Panu about the directories
created even if they are empty.

[Mario]: Sounds good, that can solve the problem. 

> +     @for HSLINK in ${HSLINKS}; do \

Not sure to understand what is the meaning of HSLINK?
HS = headers?

[Mario]: HSLINKS= headers links, in dpdk installation, it creates links to headers, however for installation I would like
to get the headers paths and copy them to installation path, not create links  :) .

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation
  2015-10-16 19:30     ` Olivier MATZ
@ 2015-10-19 23:36       ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-10-19 23:36 UTC (permalink / raw)
  To: Olivier MATZ, dev

Hi Olivier,

Ooops I'm going to fix that :)

Thanks.
Mario.
________________________________________
From: Olivier MATZ [olivier.matz@6wind.com]
Sent: Friday, October 16, 2015 12:30 PM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Subject: Re: [PATCH v4 5/7] mk: Add rule for installing documentation

Hi Mario,

On 10/05/2015 10:20 PM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK documentation.
>
> When invoking "make install-doc" documentation files will
> be installed in: $(DESTDIR)/$(DOC_DIR) where
> DOC_DIR=$(DESTDIR)/usr/share/doc/dpdk by default.
>
> You can override DOC_DIR var.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
> ---
>  mk/rte.sdkinstall.mk | 14 ++++++++++++++
>  mk/rte.sdkroot.mk    |  6 ++++--
>  2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 628d9fb..d917329 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -44,12 +44,14 @@ T=*
>  ifneq (,$(wildcard $(BUILD_DIR)/build/.config))
>  INCLUDE_DIR ?= /usr/include/dpdk
>  BIN_DIR ?= /usr/bin
> +DOC_DIR ?= /usr/share/doc/dpdk
>  HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
>  BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
>  NIC_FILES := $(wildcard $(BUILD_DIR)/tools/*.py)
>  BINARY_FILES += $(NIC_FILES)
>  LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
>  MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
> +DOCS := $(wildcard $(BUILD_DIR)/doc/*)
>  include $(BUILD_DIR)/build/.config
>  RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
>  RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
> @@ -148,6 +150,18 @@ install-mod:
>       echo installing: $$MOD; \
>       done
>  #
> +# install documentation in /usr/share/doc/dpdk
> +# bu default, DOC_DIR can be overriden.
> +#

small typo here (bu -> by)

Regards,
Olivier

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

* [dpdk-dev] [PATCH v5 00/10] Add instalation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (11 preceding siblings ...)
  2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
@ 2015-10-30  1:47 ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 01/10] mk: Add rule for installing headers Mario Carrillo
                     ` (9 more replies)
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                   ` (3 subsequent siblings)
  16 siblings, 10 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.
This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

v5:

When "make install" is invoked if "T" variable is defined, 
the installation process will have the current
behaviour, else "install-fhs" rule will be called. 

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation (build-sdk-quick.txt file)

v4:

Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
And this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET



Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (10):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files
  mk: Rename install rule as mbuild rule
  mk: Add new install rule
  doc: Add information about new installation rules

 doc/build-sdk-quick.txt |  22 +++++++-
 mk/rte.sdkinstall.mk    | 139 +++++++++++++++++++++++++++++++++++++++++++++---
 mk/rte.sdkroot.mk       |   6 ++-
 3 files changed, 158 insertions(+), 9 deletions(-)

-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 01/10] mk: Add rule for installing headers
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 02/10] mk: Add rule for installing app files Mario Carrillo
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(RTE_PREFIX)/$(INCLUDE_DIR)
where INCLUDE_DIR=/include/dpdk and RTE_PREFIX=/usr/local by default,
you can override RTE_PREFIX and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..3088975 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,11 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
+RTE_PREFIX ?= /usr/local
+INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
+HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+endif
 endif
 
 #
@@ -72,7 +77,21 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/local/include/dpdk by default
+# RTE_PREFIX and INCLUDE_DIR can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@if [ ! -z "${HSLINKS}" ]; then \
+	[ -d $(DESTDIR)/$(INCLUDE_DIR) ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR); \
+	for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	cp -rf $$HEADER ${DESTDIR}/${INCLUDE_DIR}; \
+	echo installing: $$HEADER; \
+	done \
+	fi
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 02/10] mk: Add rule for installing app files
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 01/10] mk: Add rule for installing headers Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 03/10] mk: Add rule for installing libraries Mario Carrillo
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(RTE_PREFIX)/$(BIN_DIR)
where BIN_DIR=/usr/local/bin by default, you can
override RTE_PREFIX and BIN_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3088975..9277dd2 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -44,7 +44,11 @@ T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
+BIN_DIR ?= $(RTE_PREFIX)/bin
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -93,6 +97,20 @@ install-headers:
 	done \
 	fi
 #
+# install app files in /usr/local/bin by default
+# RTE_PREFIX and BIN_DIR can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files;
+	@if [ ! -z "${BINARY_FILES}" ]; then \
+	[ -d $(DESTDIR)/$(BIN_DIR) ] || mkdir -p $(DESTDIR)/$(BIN_DIR); \
+	for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${BIN_DIR}; \
+	echo installing: $$BIN_FILE; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 03/10] mk: Add rule for installing libraries
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 01/10] mk: Add rule for installing headers Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 02/10] mk: Add rule for installing app files Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 04/10] mk: Add rule for installing modules Mario Carrillo
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(RTE_PREFIX)/$(LIB_DIR)
where LIB_DIR=/usr/lib by default, you can override
RTE_PREFIX and LIB_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 9277dd2..58e5516 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -45,9 +45,11 @@ ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
+LIB_DIR ?= $(RTE_PREFIX)/lib
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 BINARY_FILES += $(NIC_FILES)
 endif
 endif
@@ -111,6 +113,20 @@ install-bin:
 	done \
 	fi
 #
+# install libs in /usr/local/lib by default
+# RTE_PREFIX and LIB_DIR can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@if [ ! -z "${LIBS}" ]; then \
+	[ -d $(DESTDIR)/$(LIB_DIR) ] || mkdir -p $(DESTDIR)/$(LIB_DIR); \
+	for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${LIB_DIR}; \
+	echo installing: $$LIB; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 04/10] mk: Add rule for installing modules
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 03/10] mk: Add rule for installing libraries Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 05/10] mk: Add rule for installing documentation Mario Carrillo
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(KMOD_DIR)
if RTE_EXEC_ENV=linuxapp then
KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KMOD_DIR=/boot/modules
by default, you can override KMOD_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 24 ++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 58e5516..829aa4f 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -50,7 +50,15 @@ HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
+include $(RTE_OUTPUT)/.config
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+KMOD_DIR ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+KMOD_DIR ?= /boot/modules
+endif
 endif
 endif
 
@@ -127,6 +135,22 @@ install-lib:
 	done \
 	fi
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# KERNEL_DIR can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@if [ ! -z "${MODULES}" ]; then \
+	[ -d $(DESTDIR)/$(KMOD_DIR) ] || mkdir -p $(DESTDIR)/$(KMOD_DIR); \
+	for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${KMOD_DIR}; \
+	echo installing: $$MOD; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 05/10] mk: Add rule for installing documentation
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 04/10] mk: Add rule for installing modules Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 06/10] mk: Add rule for installing sdk files Mario Carrillo
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(RTE_PREFIX)/$(DOC_DIR) where
DOC_DIR=$(DESTDIR)/$(RTE_PREFIX)/share/doc/dpdk by default, you can
override RTE_PREFIX and DOC_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  6 ++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 829aa4f..4c1cfab 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,11 +46,13 @@ RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
 LIB_DIR ?= $(RTE_PREFIX)/lib
+DOC_DIR ?= $(RTE_PREFIX)/share/doc/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(RTE_SDK)/doc/*)
 BINARY_FILES += $(NIC_FILES)
 include $(RTE_OUTPUT)/.config
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -151,6 +153,20 @@ install-mod:
 	done \
 	fi
 #
+# install documentation in /usr/local/share/doc/dpdk
+# by default, DOC_DIR can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@if [ ! -z "${DOCS}" ]; then \
+	[ -d $(DESTDIR)/$(DOC_DIR) ] || mkdir -p $(DESTDIR)/$(DOC_DIR); \
+	for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${DOC_DIR}; \
+	echo installing: $$DOC; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..43f937e 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,10 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 06/10] mk: Add rule for installing sdk files
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 05/10] mk: Add rule for installing documentation Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 07/10] mk: Add rule for installing runtime files Mario Carrillo
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples, tools, config files will be installed in:
$(DESTDIR)/$(RTE_PREFIX)/$(SDK_DIR)
and headers will be installed in:
$(DESTDIR)/$(RTE_PREFIX)/$(INCLUDE_DIR)
where SDK_DIR=/usr/local/share/dpdk and
INCLUDE_DIR=/usr/local/include/dpdk
by default, you can overrifr RTE_PREFIX, SDK_DIR and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 4c1cfab..c45ab9e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,7 @@ INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
 LIB_DIR ?= $(RTE_PREFIX)/lib
 DOC_DIR ?= $(RTE_PREFIX)/share/doc/dpdk
+DATA_DIR ?= $(RTE_PREFIX)/share/dpdk
 HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
@@ -167,6 +168,25 @@ install-doc:
 	done \
 	fi
 #
+# install sdk files in /usr/local/share/dpdk by default
+# where RTE_PREFIX and DATA_DIR can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(DATA_DIR) ] || mkdir -p $(DESTDIR)/$(DATA_DIR); \
+	cp -rf $(RTE_SDK)/mk $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/mk; \
+	cp -rf $(RTE_SDK)/scripts $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/scripts; \
+	cp -rf $(RTE_SDK)/examples $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/examples; \
+	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/scripts
+	@[ -d $(DESTDIR)/$(DATA_DIR)/config ] || mkdir -p $(DESTDIR)/$(DATA_DIR)/config; \
+	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
+	echo installing: $(RTE_OUTPUT)/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 43f937e..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
+install-doc install-sdk uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-uninstall:
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 07/10] mk: Add rule for installing runtime files
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 06/10] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(RTE_PREFIX)/$(BIN_DIR) where BIN_DIR=/usr/bin (binary
files)
$(DESTDIR)/$(RTE_PREFIX)/$(DOC_DIR) where DOC_DIR=/usr/share/doc/dpdk
(documentation)
$(DESTDIR)/$(RTE_PREFIX)/$(LIB_DIR) where  LIB_DIR=/usr/lib
$(DESTDIR)/$(RTE_PREFIX)/$(KMOD_DIR) (modules)
if RTE_EXEC_ENV=linuxapp then
KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KMOD_DIR=/boot/modules
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 4 ++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c45ab9e..4914bd7 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -186,6 +186,10 @@ install-sdk: install-headers
 	@[ -d $(DESTDIR)/$(DATA_DIR)/config ] || mkdir -p $(DESTDIR)/$(DATA_DIR)/config; \
 	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
 	echo installing: $(RTE_OUTPUT)/.config
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 08/10] mk: Rename install rule as mbuild rule
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 07/10] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 09/10] mk: Add new install rule Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 10/10] doc: Add information about new installation rules Mario Carrillo
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

"install" rule with the current dpdk behaviour change its name.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 8 ++++----
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 4914bd7..24aa5a5 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -70,13 +70,13 @@ endif
 #
 INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
+INSTALL_TARGETS := $(addsuffix _mbuild,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
-.PHONY: install
-install: $(INSTALL_TARGETS)
+.PHONY: mbuild
+mbuild: $(INSTALL_TARGETS)
 
-%_install:
+%_mbuild:
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index dd5f399..1b619b7 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-install install-headers install-bin install-lib install-mod install-doc \
+mbuild install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 09/10] mk: Add new install rule
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 10/10] doc: Add information about new installation rules Mario Carrillo
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

If "T" variable is defined, the installation process will have the
current behaviour, else install rule will be called.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 12 +++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 24aa5a5..3331610 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,6 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
-T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
@@ -191,6 +190,17 @@ install-sdk: install-headers
 .PHONY: install-fhs
 install-fhs: install-lib install-bin install-doc install-mod
 #
+# if "T" var is defined, mbuild rule will be called, else
+# install-fhs rule will be called.
+#
+.PHONY: install
+install:
+ifdef T
+install: mbuild
+else
+install: install-fhs
+endif
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 1b619b7..2f8f64a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: mbuild install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-mbuild install-headers install-bin install-lib install-mod install-doc \
+mbuild install install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v5 10/10] doc: Add information about new installation rules
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 09/10] mk: Add new install rule Mario Carrillo
@ 2015-10-30  1:47   ` Mario Carrillo
  9 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-10-30  1:47 UTC (permalink / raw)
  To: dev

Information about variables and rules behaviour is added to
doc/build-sdk-quick.txt

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 doc/build-sdk-quick.txt | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..a76fa91 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,10 +5,21 @@ 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
+	install          if T is defined build many targets (wildcard allowed) and install in DESTDIR
+                         else it will call install-fhs install target
 	uninstall        remove all installed targets
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
+Install commands
+        install          if T is defined build many targets (wildcard allowed) and install in DESTDIR
+                         else it will call install-fhs install target
+	install-headers  install headers files
+	install-bin      install app files a dpdk tools
+	install-lib      install libraries
+	install-doc      install documentation
+	install-mod      install modules
+	install-sdk      install headers, makefiles, scripts,examples, tools and config files
+	install-fhs      install libraries, modules, app files, nic bind files and documentation
 Build variables
 	EXTRA_CPPFLAGS   preprocessor options
 	EXTRA_CFLAGS     compiler options
@@ -23,3 +34,12 @@ Build variables
 	T         target template (install default: *) - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
+Install variables
+	RTE_PREFIX      /usr/local by default it can be overridden
+	BIN_DIR         $(RTE_PREFIX)/bin by default it can be overridden
+	INCLUDE_DIR     $(RTE_PREFIX)/include by default it can be overridden
+	LIB_DIR         $(RTE_PREFIX)/lib by default it can be overridden
+	DOC_DIR         $(RTE_PREFIX)/share/doc/dpdk by default it can be overridden
+	DATA_DIR        $(RTE_PREFIX)/shareby default it can be overridden
+	KMOD_DIR        /lib/modules/$(uname -r)/extra/drivers/dpdk  for linux
+                        /boot/modules for BSD by default, they can be overridden
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (12 preceding siblings ...)
  2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
@ 2015-11-10 17:07 ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 01/10] mk: Add rule for installing headers Mario Carrillo
                     ` (10 more replies)
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                   ` (2 subsequent siblings)
  16 siblings, 11 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.
This patch set allows to install files based on the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

v6:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation.


v5:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation (build-sdk-quick.txt file)

v4:

Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
And this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET



Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (10):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files
  mk: Rename install rule as mbuild rule
  mk: Add new install rule
  doc: Add information about new installation rules

 doc/build-sdk-quick.txt               |  22 +++++-
 doc/guides/freebsd_gsg/build_dpdk.rst |  39 ++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   |  39 ++++++++++
 mk/rte.sdkinstall.mk                  | 140 ++++++++++++++++++++++++++++++++--
 mk/rte.sdkroot.mk                     |   6 +-
 5 files changed, 238 insertions(+), 8 deletions(-)

-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 01/10] mk: Add rule for installing headers
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 02/10] mk: Add rule for installing app files Mario Carrillo
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(INCLUDE_DIR)
where INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk and RTE_PREFIX=/usr/local
by default, you can override RTE_PREFIX and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 21 +++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..2daae1d 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,11 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
+RTE_PREFIX ?= /usr/local
+INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
+HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+endif
 endif
 
 #
@@ -74,6 +79,22 @@ install: $(INSTALL_TARGETS)
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
 
 #
+# install headers in /usr/local/include/dpdk by default
+# RTE_PREFIX and INCLUDE_DIR can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@if [ ! -z "${HSLINKS}" ]; then \
+	for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	HEADER_DIR=$$(dirname $$HSLINK | sed 's/.*include\/*//'); \
+	[ -d $(DESTDIR)/$(INCLUDE_DIR)/$$HEADER_DIR ] || mkdir -p $(DESTDIR)/$(INCLUDE_DIR)/$$HEADER_DIR; \
+	cp -rf $$HEADER ${DESTDIR}/${INCLUDE_DIR}/$$HEADER_DIR; \
+	echo installing: $$HEADER; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 02/10] mk: Add rule for installing app files
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 01/10] mk: Add rule for installing headers Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 03/10] mk: Add rule for installing libraries Mario Carrillo
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(BIN_DIR)
where BIN_DIR=$(RTE_PREFIX)/usr/local/bin and RTE_PREFIX=/usr/local by
default, you can override RTE_PREFIX and BIN_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 18 ++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 2daae1d..94fb945 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -44,7 +44,11 @@ T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
+BIN_DIR ?= $(RTE_PREFIX)/bin
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -95,6 +99,20 @@ install-headers:
 	done \
 	fi
 #
+# install app files in /usr/local/bin by default
+# RTE_PREFIX and BIN_DIR can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files;
+	@if [ ! -z "${BINARY_FILES}" ]; then \
+	[ -d $(DESTDIR)/$(BIN_DIR) ] || mkdir -p $(DESTDIR)/$(BIN_DIR); \
+	for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${BIN_DIR}; \
+	echo installing: $$BIN_FILE; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 03/10] mk: Add rule for installing libraries
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 01/10] mk: Add rule for installing headers Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 02/10] mk: Add rule for installing app files Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 04/10] mk: Add rule for installing modules Mario Carrillo
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(LIB_DIR)
where LIB_DIR=$(RTE_PREFIX)/usr/lib RTE_PREFIX=/usr/local by default,
you can override RTE_PREFIX and LIB_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 94fb945..4f06591 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -45,9 +45,11 @@ ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
+LIB_DIR ?= $(RTE_PREFIX)/lib
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 BINARY_FILES += $(NIC_FILES)
 endif
 endif
@@ -113,6 +115,20 @@ install-bin:
 	done \
 	fi
 #
+# install libs in /usr/local/lib by default
+# RTE_PREFIX and LIB_DIR can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@if [ ! -z "${LIBS}" ]; then \
+	[ -d $(DESTDIR)/$(LIB_DIR) ] || mkdir -p $(DESTDIR)/$(LIB_DIR); \
+	for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${LIB_DIR}; \
+	echo installing: $$LIB; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 04/10] mk: Add rule for installing modules
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 03/10] mk: Add rule for installing libraries Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 05/10] mk: Add rule for installing documentation Mario Carrillo
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(KMOD_DIR)
if RTE_EXEC_ENV=linuxapp then
KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KMOD_DIR=/boot/modules
by default, you can override KMOD_DIR var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 24 ++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 4f06591..2ba8a52 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -50,7 +50,15 @@ HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
+include $(RTE_OUTPUT)/.config
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+KMOD_DIR ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+KMOD_DIR ?= /boot/modules
+endif
 endif
 endif
 
@@ -129,6 +137,22 @@ install-lib:
 	done \
 	fi
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# KERNEL_DIR can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@if [ ! -z "${MODULES}" ]; then \
+	[ -d $(DESTDIR)/$(KMOD_DIR) ] || mkdir -p $(DESTDIR)/$(KMOD_DIR); \
+	for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${KMOD_DIR}; \
+	echo installing: $$MOD; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 05/10] mk: Add rule for installing documentation
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 04/10] mk: Add rule for installing modules Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files Mario Carrillo
                     ` (5 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(DOC_DIR) where
DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk and RTE_PREFIX=/usr/local by
default, you can
override RTE_PREFIX and DOC_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 2ba8a52..be7b88e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,10 +46,12 @@ RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
 LIB_DIR ?= $(RTE_PREFIX)/lib
+DOC_DIR ?= $(RTE_PREFIX)/share/doc/dpdk
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+DOCS := $(wildcard $(RTE_SDK)/doc/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
 include $(RTE_OUTPUT)/.config
@@ -153,6 +155,20 @@ install-mod:
 	done \
 	fi
 #
+# install documentation in /usr/local/share/doc/dpdk
+# by default, DOC_DIR can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@if [ ! -z "${DOCS}" ]; then \
+	[ -d $(DESTDIR)/$(DOC_DIR) ] || mkdir -p $(DESTDIR)/$(DOC_DIR); \
+	for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${DOC_DIR}; \
+	echo installing: $$DOC; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..f56341d 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 05/10] mk: Add rule for installing documentation Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-30 16:20     ` Thomas Monjalon
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 07/10] mk: Add rule for installing runtime files Mario Carrillo
                     ` (4 subsequent siblings)
  10 siblings, 1 reply; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples, tools, config files will be installed in:
$(DESTDIR)/$(SDK_DIR)
and headers will be installed in:
$(DESTDIR)/$(INCLUDE_DIR)
where SDK_DIR=$(RTE_PREFIX)/share/dpdk,
INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk
RTE_PREFIX=/usr/local by default, you can override RTE_PREFIX, SDK_DIR
and INCLUDE_DIR vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index be7b88e..2e2207b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,6 +47,7 @@ INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
 BIN_DIR ?= $(RTE_PREFIX)/bin
 LIB_DIR ?= $(RTE_PREFIX)/lib
 DOC_DIR ?= $(RTE_PREFIX)/share/doc/dpdk
+DATA_DIR ?= $(RTE_PREFIX)/share/dpdk
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
@@ -169,6 +170,25 @@ install-doc:
 	done \
 	fi
 #
+# install sdk files in /usr/local/share/dpdk by default
+# where RTE_PREFIX and DATA_DIR can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(DATA_DIR) ] || mkdir -p $(DESTDIR)/$(DATA_DIR); \
+	cp -rf $(RTE_SDK)/mk $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/mk; \
+	cp -rf $(RTE_SDK)/scripts $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/scripts; \
+	cp -rf $(RTE_SDK)/examples $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/examples; \
+	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(DATA_DIR); \
+	echo installing: $(RTE_SDK)/scripts
+	@[ -d $(DESTDIR)/$(DATA_DIR)/config ] || mkdir -p $(DESTDIR)/$(DATA_DIR)/config; \
+	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
+	echo installing: $(RTE_OUTPUT)/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index f56341d..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,8 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
-install install-headers install-bin install-lib install-mod install-doc uninstall:
+install-doc install-sdk uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 07/10] mk: Add rule for installing runtime files
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(BIN_DIR) where BIN_DIR=$(RTE_PREFIX)/usr/bin (binary files)
$(DESTDIR)/$(DOC_DIR) where DOC_DIR=$(RTE_PREFIX)/usr/share/doc/dpdk
(documentation)
$(DESTDIR)/$(LIB_DIR) where  LIB_DIR=$(RTE_PREFIX)/usr/lib
$(DESTDIR)/$(KMOD_DIR) (modules)
if RTE_EXEC_ENV=linuxapp then
KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk
else KMOD_DIR=/boot/modules
and RTE_PREFIX=/usr/local
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 5 +++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 2e2207b..3e87d72 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -189,6 +189,11 @@ install-sdk: install-headers
 	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(DATA_DIR)/config; \
 	echo installing: $(RTE_OUTPUT)/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 08/10] mk: Rename install rule as mbuild rule
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 07/10] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 09/10] mk: Add new install rule Mario Carrillo
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

"install" with the current dpdk behaviour change its name.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 8 ++++----
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 3e87d72..6593e37 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -70,13 +70,13 @@ endif
 #
 INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
+INSTALL_TARGETS := $(addsuffix _mbuild,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
-.PHONY: install
-install: $(INSTALL_TARGETS)
+.PHONY: mbuild
+mbuild: $(INSTALL_TARGETS)
 
-%_install:
+%_mbuild:
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index dd5f399..1b619b7 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-install install-headers install-bin install-lib install-mod install-doc \
+mbuild install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 09/10] mk: Add new install rule
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 10/10] doc: Add information about new installation rules Mario Carrillo
  2015-11-10 17:18   ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Aaron Conole
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

If "T" variable is defined, the installation process will have the
current behaviour, else install rule will be called.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 12 +++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 6593e37..784629e 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,6 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
-T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 RTE_PREFIX ?= /usr/local
 INCLUDE_DIR ?= $(RTE_PREFIX)/include/dpdk
@@ -194,6 +193,17 @@ install-sdk: install-headers
 .PHONY: install-fhs
 install-fhs: install-lib install-bin install-doc install-mod
 #
+# if "T" var is defined, mbuild rule will be called, else
+# install-fhs rule will be called.
+#
+.PHONY: install
+install:
+ifdef T
+install: mbuild
+else
+install: install-fhs
+endif
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 1b619b7..2f8f64a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: mbuild install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-mbuild install-headers install-bin install-lib install-mod install-doc \
+mbuild install install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.1.120.g24a00ef

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

* [dpdk-dev] [PATCH v6 10/10] doc: Add information about new installation rules
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 09/10] mk: Add new install rule Mario Carrillo
@ 2015-11-10 17:07   ` Mario Carrillo
  2015-11-10 17:18   ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Aaron Conole
  10 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-11-10 17:07 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Information about variables and rules behaviour is added to
documentation.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 doc/build-sdk-quick.txt               | 22 +++++++++++++++++++-
 doc/guides/freebsd_gsg/build_dpdk.rst | 39 +++++++++++++++++++++++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   | 39 +++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+), 1 deletion(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..1c40dd7 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,10 +5,21 @@ 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
+	install          if T is defined, build a target and install in DESTDIR
+                         else call install-fhs target
 	uninstall        remove all installed targets
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
+Install commands
+        install          if T is defined, build a target and install in DESTDIR
+                         else call install-fhs  target
+        install-headers  install headers files
+        install-bin      install app files a dpdk tools
+        install-lib      install libraries
+        install-doc      install documentation
+        install-mod      install modules
+        install-sdk      install headers, makefiles, scripts,examples, tools and config files
+        install-fhs      install libraries, modules, app files, nic bind files and documentation
 Build variables
 	EXTRA_CPPFLAGS   preprocessor options
 	EXTRA_CFLAGS     compiler options
@@ -23,3 +34,12 @@ Build variables
 	T         target template (install default: *) - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
+Install variables
+        RTE_PREFIX	/usr/local by default it can be overridden
+        BIN_DIR         $(RTE_PREFIX)/bin by default it can be overridden
+        INCLUDE_DIR     $(RTE_PREFIX)/include by default it can be overridden
+        LIB_DIR         $(RTE_PREFIX)/lib by default it can be overridden
+        DOC_DIR         $(RTE_PREFIX)/share/doc/dpdk by default it can be overridden
+        DATA_DIR        $(RTE_PREFIX)/shareby default it can be overridden
+        KMOD_DIR        /lib/modules/$(uname -r)/extra/drivers/dpdk  for linux
+                        /boot/modules for BSD by default, they can be overridden
diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst
index 8eff599..7d3e098 100644
--- a/doc/guides/freebsd_gsg/build_dpdk.rst
+++ b/doc/guides/freebsd_gsg/build_dpdk.rst
@@ -136,6 +136,45 @@ The DPDK is composed of several directories:
 
 *   config, tools, scripts, mk: Framework-related makefiles, scripts and configuration
 
+
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+Following the next steps is possible configure, build and install  specific files
+according to a file hierarchy and a group of variables.
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
++------------------+--------------------------------------------------------------------------------+
+|  install target  |                                  Description                                   |
++==================+================================================================================+
+|install           |if T is not defined will call install-fhs install                               |
++------------------+--------------------------------------------------------------------------------+
+|install-headers   |install headers files where INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk              |
++------------------+--------------------------------------------------------------------------------+
+|install-bin       |install app files a dpdk tools where BIN_DIR=$(RTE_PREFIX)/bin                  |
++------------------+--------------------------------------------------------------------------------+
+|install-lib       |install libraries LIB_DIR=$(RTE_PREFIX)/lib                                     |
++------------------+--------------------------------------------------------------------------------+
+|install-doc       |install documentation DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk                      |
++------------------+--------------------------------------------------------------------------------+
+|install-mod       |install modules if RTE_EXEC_ENV=linuxapp then                                   |
+|                  |KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules|
++------------------+--------------------------------------------------------------------------------+
+|install-sdk       |install headers, makefiles, scripts,examples, tools and config files            |
+|                  |DATA_DIR=$(RTE_PREFIX)/share/dpdk                                               |
++------------------+--------------------------------------------------------------------------------+
+|install-fhs       |install libraries, modules, app files, nic bind files and documentation         |
++------------------+--------------------------------------------------------------------------------+
+
+RTE_PREFIX=/usr/local by default however RTE_PREFIX and all path variables can be overridden furthermore
+all targets can use DESTDIR variable.
+
+
 Installation of the DPDK Target Environments
 --------------------------------------------
 
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 2680e66..784c9fe 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -152,6 +152,45 @@ The user may also make modifications to the compile-time DPDK configuration by e
 
 In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
 
+
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+Following the next steps is possible configure, build and install  specific files
+according to a file hierarchy and a group of variables.
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
++------------------+--------------------------------------------------------------------------------+
+|  install target  |                                  Description                                   |
++==================+================================================================================+
+|install           |if T is not defined will call install-fhs install                               |
++------------------+--------------------------------------------------------------------------------+
+|install-headers   |install headers files where INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk              |
++------------------+--------------------------------------------------------------------------------+
+|install-bin       |install app files a dpdk tools where BIN_DIR=$(RTE_PREFIX)/bin                  |
++------------------+--------------------------------------------------------------------------------+
+|install-lib       |install libraries LIB_DIR=$(RTE_PREFIX)/lib                                     |
++------------------+--------------------------------------------------------------------------------+
+|install-doc       |install documentation DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk                      |
++------------------+--------------------------------------------------------------------------------+
+|install-mod       |install modules if RTE_EXEC_ENV=linuxapp then                                   |
+|                  |KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules|
++------------------+--------------------------------------------------------------------------------+
+|install-sdk       |install headers, makefiles, scripts,examples, tools and config files            |
+|                  |DATA_DIR=$(RTE_PREFIX)/share/dpdk                                               |
++------------------+--------------------------------------------------------------------------------+
+|install-fhs       |install libraries, modules, app files, nic bind files and documentation         |
++------------------+--------------------------------------------------------------------------------+
+
+RTE_PREFIX=/usr/local by default however RTE_PREFIX and all path variables can be overridden furthermore
+all targets can use DESTDIR variable.
+
+
 Browsing the Installed DPDK Environment Target
 ----------------------------------------------
 
-- 
2.6.1.120.g24a00ef

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

* Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
                     ` (9 preceding siblings ...)
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 10/10] doc: Add information about new installation rules Mario Carrillo
@ 2015-11-10 17:18   ` Aaron Conole
  2015-11-10 23:25     ` Arevalo, Mario Alfredo C
  10 siblings, 1 reply; 150+ messages in thread
From: Aaron Conole @ 2015-11-10 17:18 UTC (permalink / raw)
  To: Mario Carrillo; +Cc: dev, jos.c.venegas.munoz

Hi Mario,

Mario Carrillo <mario.alfredo.c.arevalo@intel.com> writes:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> This patch set allows to install files based on the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

I'm not sure what this patch holds, given the following proposal:

http://dpdk.org/ml/archives/dev/2015-November/027777.html

-Aaron

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

* Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
  2015-11-10 17:18   ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Aaron Conole
@ 2015-11-10 23:25     ` Arevalo, Mario Alfredo C
  2015-11-11 10:48       ` Bruce Richardson
  0 siblings, 1 reply; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-11-10 23:25 UTC (permalink / raw)
  To: Aaron Conole; +Cc: dev, Venegas Munoz, Jos C

Hi Aaron,


I have been working on series of patches in order to improve 
the installation process of dpdk, I sent my first version at 
sep 18.
 
http://dpdk.org/ml/archives/dev/2015-September/023761.html

I have been received feedback from different developers as
Olivier, Bruce, Panu etc... and I have been taking note about it
and I have been improving the patches in each serie, at this
moment I haven't gotten a final answer, however I'm going to continue
working. :)

Mario.
Thanks.
________________________________________
From: Aaron Conole [aconole@redhat.com]
Sent: Tuesday, November 10, 2015 9:18 AM
To: Arevalo, Mario Alfredo C
Cc: dev@dpdk.org; Venegas Munoz, Jos C; Richardson, Bruce
Subject: Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files

Hi Mario,

Mario Carrillo <mario.alfredo.c.arevalo@intel.com> writes:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> This patch set allows to install files based on the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

I'm not sure what this patch holds, given the following proposal:

http://dpdk.org/ml/archives/dev/2015-November/027777.html

-Aaron

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

* Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
  2015-11-10 23:25     ` Arevalo, Mario Alfredo C
@ 2015-11-11 10:48       ` Bruce Richardson
  2015-11-11 17:43         ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 150+ messages in thread
From: Bruce Richardson @ 2015-11-11 10:48 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C; +Cc: dev, Venegas Munoz, Jos C

On Tue, Nov 10, 2015 at 11:25:39PM +0000, Arevalo, Mario Alfredo C wrote:
> Hi Aaron,
> 
> 
> I have been working on series of patches in order to improve 
> the installation process of dpdk, I sent my first version at 
> sep 18.
>  
> http://dpdk.org/ml/archives/dev/2015-September/023761.html
> 
> I have been received feedback from different developers as
> Olivier, Bruce, Panu etc... and I have been taking note about it
> and I have been improving the patches in each serie, at this
> moment I haven't gotten a final answer, however I'm going to continue
> working. :)
> 
> Mario.
> Thanks.

Hi Mario,

it would be good if you could share your opinions of the patchset that Aaron
linked to below, and how it might interact with or impact your patchset - or if
you even think it's not worthwhile doing. There's been a worrying lack of 
comment on that thread!

On your patchset, I'm just not convinced that adding in a whole set of new
make targets is the best way to go here. It seems more like putting an extra layer
of complexity in without fixing the underlying problems [which to me is the 
fact of "make install" being used in a non-standard way.]

Regards,
/Bruce

> ________________________________________
> From: Aaron Conole [aconole@redhat.com]
> Sent: Tuesday, November 10, 2015 9:18 AM
> To: Arevalo, Mario Alfredo C
> Cc: dev@dpdk.org; Venegas Munoz, Jos C; Richardson, Bruce
> Subject: Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
> 
> Hi Mario,
> 
> Mario Carrillo <mario.alfredo.c.arevalo@intel.com> writes:
> > DPDK package lacks of a mechanism to install libraries, headers
> > applications, kernel modules and sdk files to a file system tree.
> > This patch set allows to install files based on the next
> > proposal:
> > http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> I'm not sure what this patch holds, given the following proposal:
> 
> http://dpdk.org/ml/archives/dev/2015-November/027777.html
> 
> -Aaron
> 

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

* Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
  2015-11-11 10:48       ` Bruce Richardson
@ 2015-11-11 17:43         ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-11-11 17:43 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, Venegas Munoz, Jos C

Hi Bruce,

	First thank you for your help during this time, and you are right, the objective of this is try to have a more standard installation process, I have taken a look to your patches, and you rename targets as first step in order to improve the installation process, I have the same intentions, talking about my patch set, you can see different new targets in the makefile, this seem that is more complex, but the reason about it is for flexibility, you can install only relevant files for you that could be headers, libraries, makefiles, examples etc... in hierarchy paths by default and you can overridden these paths, however if you would like to install sdk files (install headers, makefiles, scripts,examples, tools and config files)  you can use "install-sdk" or if you would like to install runtime files (libraries, modules, app files, nic bind files and documentation) "install-fhs" will be enough :) 
I mean, it's no necessary to use all targets by separate. this behavior can be obtained if you do not use "T" variable, if you use it you can get the previous behaviour in dpdk, this is for compatibility reasons. thank you for your comments and if you have more questions about this feel free to contact me :) 


Thank you so much.
Mario.

> -----Original Message-----
> From: Richardson, Bruce
> Sent: Wednesday, November 11, 2015 4:49 AM
> To: Arevalo, Mario Alfredo C
> Cc: Aaron Conole; dev@dpdk.org; Venegas Munoz, Jos C
> Subject: Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files
> 
> On Tue, Nov 10, 2015 at 11:25:39PM +0000, Arevalo, Mario Alfredo C wrote:
> > Hi Aaron,
> >
> >
> > I have been working on series of patches in order to improve the
> > installation process of dpdk, I sent my first version at sep 18.
> >
> > http://dpdk.org/ml/archives/dev/2015-September/023761.html
> >
> > I have been received feedback from different developers as Olivier,
> > Bruce, Panu etc... and I have been taking note about it and I have
> > been improving the patches in each serie, at this moment I haven't
> > gotten a final answer, however I'm going to continue working. :)
> >
> > Mario.
> > Thanks.
> 
> Hi Mario,
> 
> it would be good if you could share your opinions of the patchset that Aaron
> linked to below, and how it might interact with or impact your patchset - or if
> you even think it's not worthwhile doing. There's been a worrying lack of
> comment on that thread!
> 
> On your patchset, I'm just not convinced that adding in a whole set of new
> make targets is the best way to go here. It seems more like putting an extra
> layer of complexity in without fixing the underlying problems [which to me is
> the fact of "make install" being used in a non-standard way.]
> 
> Regards,
> /Bruce
> 
> > ________________________________________
> > From: Aaron Conole [aconole@redhat.com]
> > Sent: Tuesday, November 10, 2015 9:18 AM
> > To: Arevalo, Mario Alfredo C
> > Cc: dev@dpdk.org; Venegas Munoz, Jos C; Richardson, Bruce
> > Subject: Re: [dpdk-dev] [PATCH v6 00/10] Add installation rules for
> > dpdk files
> >
> > Hi Mario,
> >
> > Mario Carrillo <mario.alfredo.c.arevalo@intel.com> writes:
> > > DPDK package lacks of a mechanism to install libraries, headers
> > > applications, kernel modules and sdk files to a file system tree.
> > > This patch set allows to install files based on the next
> > > proposal:
> > > http://www.freedesktop.org/software/systemd/man/file-
> hierarchy.html
> >
> > I'm not sure what this patch holds, given the following proposal:
> >
> > http://dpdk.org/ml/archives/dev/2015-November/027777.html
> >
> > -Aaron
> >

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-09-22  6:56   ` Panu Matilainen
@ 2015-11-27 15:40     ` Thomas Monjalon
  2015-11-27 16:01       ` Ferruh Yigit
  0 siblings, 1 reply; 150+ messages in thread
From: Thomas Monjalon @ 2015-11-27 15:40 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: dev

2015-09-22 09:56, Panu Matilainen:
> On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> > +MOD_DIR := $(DESTDIR)/lib/modules
> > +KERNEL_DIR := $(shell uname -r)/extra
> 
> Please don't assume one is always building for the running kernel. 
> Defaulting around uname -r is perfectly reasonable, but there needs to 
> be a way to override it from the cli. For example rte.vars.mk has this:
> 
> # can be overriden by make command line or exported environment variable
> RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build

For info, the ?= operator is a way to give a default value after having
included other makefiles which may set a different value.
Both ?= and := (or simply =) are overriden by the command line.
Only "override VAR =" will not be overriden by the command line.

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

* Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-10-02 10:54       ` Richardson, Bruce
  2015-10-02 16:27         ` Arevalo, Mario Alfredo C
@ 2015-11-27 15:52         ` Thomas Monjalon
  2015-11-27 16:10           ` Bruce Richardson
  1 sibling, 1 reply; 150+ messages in thread
From: Thomas Monjalon @ 2015-11-27 15:52 UTC (permalink / raw)
  To: dev, Richardson, Bruce

2015-10-02 10:54, Richardson, Bruce:
> I think there are better utilities available for determining the core layout
> that cpu_layout.py. "lstopo", for one, is much more powerful. Do we want/need
> to keep our own script around for that?

Good question.
Anyone against dropping cpu_layout.py?

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-11-27 15:40     ` Thomas Monjalon
@ 2015-11-27 16:01       ` Ferruh Yigit
  2015-11-27 16:20         ` David Marchand
  2015-11-27 21:05         ` Arevalo, Mario Alfredo C
  0 siblings, 2 replies; 150+ messages in thread
From: Ferruh Yigit @ 2015-11-27 16:01 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Fri, Nov 27, 2015 at 04:40:51PM +0100, Thomas Monjalon wrote:
> 2015-09-22 09:56, Panu Matilainen:
> > On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> > > +MOD_DIR := $(DESTDIR)/lib/modules
> > > +KERNEL_DIR := $(shell uname -r)/extra
> > 
> > Please don't assume one is always building for the running kernel. 
> > Defaulting around uname -r is perfectly reasonable, but there needs to 
> > be a way to override it from the cli. For example rte.vars.mk has this:
> > 
> > # can be overriden by make command line or exported environment variable
> > RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build
> 
> For info, the ?= operator is a way to give a default value after having
> included other makefiles which may set a different value.
> Both ?= and := (or simply =) are overriden by the command line.
> Only "override VAR =" will not be overriden by the command line.
> 

As far as I know only "?=" assignment overridden by command line.

Basic experiment:

# cat Makefile 
A ?= a
B := b
C = c

all:
        @echo $(A) $(B) $(C)

-----

# make
a b c

# A=x B=x C=x make
x b c


ferruh

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

* Re: [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files
  2015-11-27 15:52         ` Thomas Monjalon
@ 2015-11-27 16:10           ` Bruce Richardson
  0 siblings, 0 replies; 150+ messages in thread
From: Bruce Richardson @ 2015-11-27 16:10 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Fri, Nov 27, 2015 at 04:52:11PM +0100, Thomas Monjalon wrote:
> 2015-10-02 10:54, Richardson, Bruce:
> > I think there are better utilities available for determining the core layout
> > that cpu_layout.py. "lstopo", for one, is much more powerful. Do we want/need
> > to keep our own script around for that?
> 
> Good question.
> Anyone against dropping cpu_layout.py?

At this late stage in the release, yes. In 2.3 or future release, none on my part.
:-)

/Bruce

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-11-27 16:01       ` Ferruh Yigit
@ 2015-11-27 16:20         ` David Marchand
  2015-11-27 16:23           ` Bruce Richardson
  2015-11-27 21:05         ` Arevalo, Mario Alfredo C
  1 sibling, 1 reply; 150+ messages in thread
From: David Marchand @ 2015-11-27 16:20 UTC (permalink / raw)
  To: Thomas Monjalon, Panu Matilainen, dev

On Fri, Nov 27, 2015 at 5:01 PM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> As far as I know only "?=" assignment overridden by command line.
>
> Basic experiment:
>
> # cat Makefile
> A ?= a
> B := b
> C = c
>
> all:
>         @echo $(A) $(B) $(C)
>
> -----
>
> # make
> a b c
>
> # A=x B=x C=x make
> x b c
>

Those variables are passed through env, but if you give them to make.

$ make A=x B=x C=x
x x x


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-11-27 16:20         ` David Marchand
@ 2015-11-27 16:23           ` Bruce Richardson
  2015-11-27 16:48             ` Ferruh Yigit
  0 siblings, 1 reply; 150+ messages in thread
From: Bruce Richardson @ 2015-11-27 16:23 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Fri, Nov 27, 2015 at 05:20:43PM +0100, David Marchand wrote:
> On Fri, Nov 27, 2015 at 5:01 PM, Ferruh Yigit <ferruh.yigit@intel.com>
> wrote:
> 
> > As far as I know only "?=" assignment overridden by command line.
> >
> > Basic experiment:
> >
> > # cat Makefile
> > A ?= a
> > B := b
> > C = c
> >
> > all:
> >         @echo $(A) $(B) $(C)
> >
> > -----
> >
> > # make
> > a b c
> >
> > # A=x B=x C=x make
> > x b c
> >
> 
> Those variables are passed through env, but if you give them to make.
> 
> $ make A=x B=x C=x
> x x x
> 
>
You just beat me to it! ?= can be overridden by either environment or cmdline, others
are overridden just by cmdline, which means they are passed to make, not to the
shell.

/Bruce

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-11-27 16:23           ` Bruce Richardson
@ 2015-11-27 16:48             ` Ferruh Yigit
  0 siblings, 0 replies; 150+ messages in thread
From: Ferruh Yigit @ 2015-11-27 16:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, Nov 27, 2015 at 04:23:07PM +0000, Bruce Richardson wrote:
> On Fri, Nov 27, 2015 at 05:20:43PM +0100, David Marchand wrote:
> > On Fri, Nov 27, 2015 at 5:01 PM, Ferruh Yigit <ferruh.yigit@intel.com>
> > wrote:
> > 
> > > As far as I know only "?=" assignment overridden by command line.
> > >
> > > Basic experiment:
> > >
> > > # cat Makefile
> > > A ?= a
> > > B := b
> > > C = c
> > >
> > > all:
> > >         @echo $(A) $(B) $(C)
> > >
> > > -----
> > >
> > > # make
> > > a b c
> > >
> > > # A=x B=x C=x make
> > > x b c
> > >
> > 
> > Those variables are passed through env, but if you give them to make.
> > 
> > $ make A=x B=x C=x
> > x x x
> > 
> >
> You just beat me to it! ?= can be overridden by either environment or cmdline, others
> are overridden just by cmdline, which means they are passed to make, not to the
> shell.
> 
I see, thanks for clarification.

ferruh

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

* Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
  2015-11-27 16:01       ` Ferruh Yigit
  2015-11-27 16:20         ` David Marchand
@ 2015-11-27 21:05         ` Arevalo, Mario Alfredo C
  1 sibling, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-11-27 21:05 UTC (permalink / raw)
  To: Yigit, Ferruh, Thomas Monjalon; +Cc: dev

Hi ferruh,

thank you for your comments in this serie of patches :) , I have been
working on different new patches version in order to improve them according
to feedback from different developers, at this moment I have sent the version 6
I would like to know your point of view and the point of view from more developers about it :)
this is the link where you can see the 6 version:

http://dpdk.org/ml/archives/dev/2015-November/027988.html

Thank you.
Mario.
________________________________________
From: dev [dev-bounces@dpdk.org] on behalf of Ferruh Yigit [ferruh.yigit@intel.com]
Sent: Friday, November 27, 2015 8:01 AM
To: Thomas Monjalon
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support      (linux  mod)

On Fri, Nov 27, 2015 at 04:40:51PM +0100, Thomas Monjalon wrote:
> 2015-09-22 09:56, Panu Matilainen:
> > On 09/18/2015 11:33 PM, Mario Carrillo wrote:
> > > +MOD_DIR := $(DESTDIR)/lib/modules
> > > +KERNEL_DIR := $(shell uname -r)/extra
> >
> > Please don't assume one is always building for the running kernel.
> > Defaulting around uname -r is perfectly reasonable, but there needs to
> > be a way to override it from the cli. For example rte.vars.mk has this:
> >
> > # can be overriden by make command line or exported environment variable
> > RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build
>
> For info, the ?= operator is a way to give a default value after having
> included other makefiles which may set a different value.
> Both ?= and := (or simply =) are overriden by the command line.
> Only "override VAR =" will not be overriden by the command line.
>

As far as I know only "?=" assignment overridden by command line.

Basic experiment:

# cat Makefile
A ?= a
B := b
C = c

all:
        @echo $(A) $(B) $(C)

-----

# make
a b c

# A=x B=x C=x make
x b c


ferruh

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

* Re: [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files
  2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-11-30 16:20     ` Thomas Monjalon
  2015-11-30 16:26       ` Arevalo, Mario Alfredo C
  0 siblings, 1 reply; 150+ messages in thread
From: Thomas Monjalon @ 2015-11-30 16:20 UTC (permalink / raw)
  To: Mario Carrillo; +Cc: dev, jos.c.venegas.munoz

Hi,

2015-11-10 11:07, Mario Carrillo:
> Add hierarchy-file support to the DPDK makefiles, scripts,
> examples, tools, config files and headers,
> when invoking "make install-sdk" makefiles, scripts,
> examples, tools, config files will be installed in:

The tools are part of the runtime, not the sdk.

> $(DESTDIR)/$(SDK_DIR)
> and headers will be installed in:
> $(DESTDIR)/$(INCLUDE_DIR)
> where SDK_DIR=$(RTE_PREFIX)/share/dpdk,
> INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk
> RTE_PREFIX=/usr/local by default, you can override RTE_PREFIX, SDK_DIR
> and INCLUDE_DIR vars.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

It would be better to follow the GNU standard to name the variables:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

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

I would add:

kerneldir ?= $(exec_prefix)/kmod
sdkdir ?= $(datadir)

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

* Re: [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files
  2015-11-30 16:20     ` Thomas Monjalon
@ 2015-11-30 16:26       ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-11-30 16:26 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Venegas Munoz, Jos C

Thank you for your feedback Thomas, I'm going to take note for a version 6 patches :)

Mario.
________________________________________
From: Thomas Monjalon [thomas.monjalon@6wind.com]
Sent: Monday, November 30, 2015 8:20 AM
To: Arevalo, Mario Alfredo C
Cc: dev@dpdk.org; Venegas Munoz, Jos C
Subject: Re: [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files

Hi,

2015-11-10 11:07, Mario Carrillo:
> Add hierarchy-file support to the DPDK makefiles, scripts,
> examples, tools, config files and headers,
> when invoking "make install-sdk" makefiles, scripts,
> examples, tools, config files will be installed in:

The tools are part of the runtime, not the sdk.

> $(DESTDIR)/$(SDK_DIR)
> and headers will be installed in:
> $(DESTDIR)/$(INCLUDE_DIR)
> where SDK_DIR=$(RTE_PREFIX)/share/dpdk,
> INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk
> RTE_PREFIX=/usr/local by default, you can override RTE_PREFIX, SDK_DIR
> and INCLUDE_DIR vars.
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

It would be better to follow the GNU standard to name the variables:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

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

I would add:

kerneldir ?= $(exec_prefix)/kmod
sdkdir ?= $(datadir)


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

* [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (13 preceding siblings ...)
  2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
@ 2015-12-01  0:53 ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 01/11] mk: Add rule for installing headers Mario Carrillo
                     ` (11 more replies)
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
  16 siblings, 12 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.
This patch set allows to install files based on the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

v7:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).

* make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).

* make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).

* make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples and
                config files) (default path sdkdir=$(datadir)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files (tools) and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule).

where prefix=/usr/local, exec_prefix=$(prefix), datarootdir=$(prefix)/share, and datadir=$(datarootdir)/dpdk by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(bindir, libdir, includedir, docidr, kerneldir, prefix, exec_prefix and data).

Furthermore this information is added to documentation.


v6:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation.


v5:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation (build-sdk-quick.txt file)

v4:

Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
And this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET



Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (11):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files
  app: Change name to test binary
  mk: Rename install rule as mbuild rule
  mk: Add new install rule
  doc: Add information about new installation rules

 app/test/Makefile                     |   2 +-
 doc/build-sdk-quick.txt               |  25 +++++-
 doc/guides/freebsd_gsg/build_dpdk.rst |  40 ++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   |  38 +++++++++
 mk/rte.sdkinstall.mk                  | 146 ++++++++++++++++++++++++++++++++--
 mk/rte.sdkroot.mk                     |   6 +-
 6 files changed, 247 insertions(+), 10 deletions(-)

-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 01/11] mk: Add rule for installing headers
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 02/11] mk: Add rule for installing app files Mario Carrillo
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(includedir)
where includedir=$(prefix)/include/dpdk and prefix=/usr/local by
default, you can override "prefix" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 22 +++++++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..a4a01cf 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,11 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
+prefix ?= /usr/local
+includedir ?= $(prefix)/include/dpdk
+HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+endif
 endif
 
 #
@@ -72,7 +77,22 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/local/include/dpdk by default
+# "prefix" and "includedir" vars can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@if [ ! -z "${HSLINKS}" ]; then \
+	for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	HEADER_DIR=$$(dirname $$HSLINK | sed 's/.*include\/*//'); \
+	[ -d $(DESTDIR)/$(includedir)/$$HEADER_DIR ] || mkdir -p $(DESTDIR)/$(includedir)/$$HEADER_DIR; \
+	cp -rf $$HEADER ${DESTDIR}/${includedir}/$$HEADER_DIR; \
+	echo installing: $$HEADER; \
+	done \
+	fi
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 02/11] mk: Add rule for installing app files
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 01/11] mk: Add rule for installing headers Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 03/11] mk: Add rule for installing libraries Mario Carrillo
                     ` (9 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(bindir)
where bindir=$(exec_prefix)/usr/local/bin
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and bindir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index a4a01cf..93de06b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,8 +43,13 @@ ifndef T
 T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
+exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
+bindir ?= $(exec_prefix)/bin
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -94,6 +99,20 @@ install-headers:
 	done \
 	fi
 #
+# install app files in /usr/local/bin by default
+# "prefix" and "bindir" can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files;
+	@if [ ! -z "${BINARY_FILES}" ]; then \
+	[ -d $(DESTDIR)/$(bindir) ] || mkdir -p $(DESTDIR)/$(bindir); \
+	for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${bindir}; \
+	echo installing: $$BIN_FILE; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 03/11] mk: Add rule for installing libraries
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 01/11] mk: Add rule for installing headers Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 02/11] mk: Add rule for installing app files Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 04/11] mk: Add rule for installing modules Mario Carrillo
                     ` (8 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(libdir)
where libdir=$(exec_prefix)/usr/lib
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and libdir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 93de06b..ff99afe 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,9 +46,11 @@ prefix ?= /usr/local
 exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
+libdir ?= $(exec_prefix)/lib
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 BINARY_FILES += $(NIC_FILES)
 endif
 endif
@@ -113,6 +115,20 @@ install-bin:
 	done \
 	fi
 #
+# install libs in /usr/local/lib by default
+# "prefix" and "libdir" can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@if [ ! -z "${LIBS}" ]; then \
+	[ -d $(DESTDIR)/$(libdir) ] || mkdir -p $(DESTDIR)/$(libdir); \
+	for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${libdir}; \
+	echo installing: $$LIB; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 04/11] mk: Add rule for installing modules
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 03/11] mk: Add rule for installing libraries Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 05/11] mk: Add rule for installing documentation Mario Carrillo
                     ` (7 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(kerneldir)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
by default, you can override "kerneldir" var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 24 ++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ff99afe..1502399 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -51,7 +51,15 @@ HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
+include $(RTE_OUTPUT)/.config
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+kerneldir ?= /boot/modules
+endif
 endif
 endif
 
@@ -129,6 +137,22 @@ install-lib:
 	done \
 	fi
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# "kerneldir" var  can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@if [ ! -z "${MODULES}" ]; then \
+	[ -d $(DESTDIR)/$(kerneldir) ] || mkdir -p $(DESTDIR)/$(kerneldir); \
+	for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${kerneldir}; \
+	echo installing: $$MOD; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 05/11] mk: Add rule for installing documentation
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 04/11] mk: Add rule for installing modules Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 06/11] mk: Add rule for installing sdk files Mario Carrillo
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(docdir) where
docdir=$(datarootdir)/doc/dpdk
datarootdir=$(prefix)/share
prefix=/usr/local by default, you can override "prefix",
"datarootdir" and "docdir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 17 +++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 1502399..c062489 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,11 +47,14 @@ exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc/dpdk
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(RTE_SDK)/doc/*)
 BINARY_FILES += $(NIC_FILES)
 include $(RTE_OUTPUT)/.config
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -153,6 +156,20 @@ install-mod:
 	done \
 	fi
 #
+# install documentation in /usr/local/share/doc/dpdk
+# by default, "docdir", "prefix" and "datarootdir" vars can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@if [ ! -z "${DOCS}" ]; then \
+	[ -d $(DESTDIR)/$(docdir) ] || mkdir -p $(DESTDIR)/$(docdir); \
+	for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${docdir}; \
+	echo installing: $$DOC; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..f56341d 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 06/11] mk: Add rule for installing sdk files
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 05/11] mk: Add rule for installing documentation Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 07/11] mk: Add rule for installing runtime files Mario Carrillo
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples and config files will be installed in:
$(DESTDIR)/$(sdkdir)
and headers will be installed in:
$(DESTDIR)/$(includedir)
where sdkdir=$(datadir)
datadir=$(datarootdir)/dpdk
datarootdir=$(prefix)/share
includedir=$(prefix)/include/dpdk
prefix=/usr/local by default, you can override "prefix", "sdkdir",
"datadir", "datarootdir" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c062489..09950fa 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -49,6 +49,8 @@ bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
 datarootdir ?= $(prefix)/share
 docdir ?= $(datarootdir)/doc/dpdk
+datadir ?= $(datarootdir)/dpdk
+sdkdir ?= $(datadir)
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
@@ -170,6 +172,23 @@ install-doc:
 	done \
 	fi
 #
+# install sdk files in /usr/local/share/dpdk by default
+# where prefix and "sdkdir", "datadir" and "prefix" var can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(sdkdir) ] || mkdir -p $(DESTDIR)/$(sdkdir); \
+	cp -rf $(RTE_SDK)/mk $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/mk; \
+	cp -rf $(RTE_SDK)/scripts $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/scripts; \
+	cp -rf $(RTE_SDK)/examples $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/examples;
+	@[ -d $(DESTDIR)/$(sdkdir)/config ] || mkdir -p $(DESTDIR)/$(sdkdir)/config; \
+	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
+	echo installing: $(RTE_OUTPUT)/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index f56341d..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,8 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
-install install-headers install-bin install-lib install-mod install-doc uninstall:
+install-doc install-sdk uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 07/11] mk: Add rule for installing runtime files
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 06/11] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 08/11] app: Change name to test binary Mario Carrillo
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file (tools) and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(bindir) where bindir=$(exec_prefix)/bin (binary files)
$(DESTDIR)/$(docdir) where docdir=$(datarootdir)/doc/dpdk
(documentation)
$(DESTDIR)/$(libdir) where libdir=$(exec_prefix)/lib (libraries)
$(DESTDIR)/$(kerneldir) (modules)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
exec_prefix=$(prefix)
datarootdir=$(prefix)/share
and prefix=/usr/local
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 9 +++++++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 09950fa..d1ff160 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -189,6 +189,15 @@ install-sdk: install-headers
 	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
 	echo installing: $(RTE_OUTPUT)/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
+	@echo ================== Installing runtime files
+	@[ -d $(DESTDIR)/$(datadir) ] || mkdir -p $(DESTDIR)/$(datadir); \
+	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
+	echo installing: $(RTE_SDK)/tools
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 08/11] app: Change name to test binary
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 07/11] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

This is order to test could be installed in a file herarchy and do not
make a colision with test command from coreutils package.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 app/test/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index ec33e1a..184f91b 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -36,7 +36,7 @@ ifeq ($(CONFIG_RTE_APP_TEST),y)
 #
 # library name
 #
-APP = test
+APP = test-dpdk
 
 #
 # all sources are stored in SRCS-y
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 09/11] mk: Rename install rule as mbuild rule
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 08/11] app: Change name to test binary Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 10/11] mk: Add new install rule Mario Carrillo
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

"install" rule with the current dpdk behaviour change its name by
mbuild.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 8 ++++----
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index d1ff160..df16f5c 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -73,13 +73,13 @@ endif
 #
 INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
+INSTALL_TARGETS := $(addsuffix _mbuild,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
-.PHONY: install
-install: $(INSTALL_TARGETS)
+.PHONY: mbuild
+mbuild: $(INSTALL_TARGETS)
 
-%_install:
+%_mbuild:
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index dd5f399..1b619b7 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-install install-headers install-bin install-lib install-mod install-doc \
+mbuild install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 10/11] mk: Add new install rule
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules Mario Carrillo
  2015-12-01 19:17   ` [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files Thomas Monjalon
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

If "T" variable is defined, the installation process will have the
current behaviour, else install rule will be called.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 12 +++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index df16f5c..5195442 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,6 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
-T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
 exec_prefix ?= $(prefix)
@@ -198,6 +197,17 @@ install-fhs: install-lib install-bin install-doc install-mod
 	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
 	echo installing: $(RTE_SDK)/tools
 #
+# if "T" var is defined, mbuild rule will be called, else
+# install-fhs rule will be called.
+#
+.PHONY: install
+install:
+ifdef T
+install: mbuild
+else
+install: install-fhs
+endif
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 1b619b7..2f8f64a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: mbuild install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-mbuild install-headers install-bin install-lib install-mod install-doc \
+mbuild install install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (9 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 10/11] mk: Add new install rule Mario Carrillo
@ 2015-12-01  0:53   ` Mario Carrillo
  2015-12-01 11:11     ` Mcnamara, John
  2015-12-01 12:08     ` Mcnamara, John
  2015-12-01 19:17   ` [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files Thomas Monjalon
  11 siblings, 2 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01  0:53 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Information about variables and rules behaviour is added to
documentation.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 doc/build-sdk-quick.txt               | 25 +++++++++++++++++++++-
 doc/guides/freebsd_gsg/build_dpdk.rst | 40 +++++++++++++++++++++++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   | 38 +++++++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+), 1 deletion(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..66f0d0e 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,10 +5,21 @@ 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
+	install          if T is defined, build a target and install in DESTDIR
+                         else call install-fhs target
 	uninstall        remove all installed targets
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
+Install commands
+	install          if T is defined, build a target and install in DESTDIR
+                         else call install-fhs  target
+	install-headers  install headers files
+	install-bin      install app files a dpdk tools
+	install-lib      install libraries
+	install-doc      install documentation
+	install-mod      install modules
+	install-sdk      install headers, makefiles, scripts,examples, tools and config files
+	install-fhs      install libraries, modules, app files, nic bind files and documentation
 Build variables
 	EXTRA_CPPFLAGS   preprocessor options
 	EXTRA_CFLAGS     compiler options
@@ -23,3 +34,15 @@ Build variables
 	T         target template (install default: *) - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
+Install variables
+	prefix          /usr/local by default it can be overridden
+	exec_prefix     $(prefix)
+	bindir          $(exec_prefix)/bin by default it can be overridden
+	includedir      $(prefix)/include by default it can be overridden
+	libdir          $(exec_prefix)/lib by default it can be overridden
+	docdir          $(datarootdir)/share/doc/dpdk by default it can be overridden
+	sdkdir          $(datadir)
+	datadir         $(datarootdir)/dpdk
+	datarootdir	$(prefix)/share
+	kerneldir       /lib/modules/$(uname -r)/extra/drivers/dpdk  for linux
+			/boot/modules for BSD by default, they can be overridden
diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst
index 8eff599..72826d0 100644
--- a/doc/guides/freebsd_gsg/build_dpdk.rst
+++ b/doc/guides/freebsd_gsg/build_dpdk.rst
@@ -136,6 +136,46 @@ The DPDK is composed of several directories:
 
 *   config, tools, scripts, mk: Framework-related makefiles, scripts and configuration
 
+
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+Following the next steps is possible configure, build and install  specific files
+according to a file hierarchy and a group of variables.
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
++------------------+--------------------------------------------------------------------------------+
+|  install target  |                                  Description                                   |
++==================+================================================================================+
+|install           |if T is not defined will call install-fhs install                               |
++------------------+--------------------------------------------------------------------------------+
+|install-headers   |install headers files where includedir=$(prefix)/include/dpdk                   |
++------------------+--------------------------------------------------------------------------------+
+|install-bin       |install app files a dpdk tools where bindir=$(exec_prefix)/bin                  |
++------------------+--------------------------------------------------------------------------------+
+|install-lib       |install libraries libdir=$(exec_prefix)/lib                                     |
++------------------+--------------------------------------------------------------------------------+
+|install-doc       |install documentation docdir=$(datarootdir)/doc/dpdk                            |
++------------------+--------------------------------------------------------------------------------+
+|install-mod       |install modules if RTE_EXEC_ENV=linuxapp then                                   |
+|                  |kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else                      |
+|                  |kerneldir=/boot/modules                                                         |
++------------------+--------------------------------------------------------------------------------+
+|install-sdk       |install headers, makefiles, scripts,examples and config files                   |
+|                  |sdkdir=$(datarootdir)/dpdk                                                      |
++------------------+--------------------------------------------------------------------------------+
+|install-fhs       |install libraries, modules, app files, nic bind files (tools) and documentation |
++------------------+--------------------------------------------------------------------------------+
+
+prefix=/usr/local, exec_prefix=$(prefix) and datarootdir=$(prefix)/share by default however prefix, exec_prefix, datarootdir and all path
+variables can be overridden furthermore all targets can use DESTDIR variable.
+
+
 Installation of the DPDK Target Environments
 --------------------------------------------
 
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 2680e66..8566224 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -152,6 +152,44 @@ The user may also make modifications to the compile-time DPDK configuration by e
 
 In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
 
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+Following the next steps is possible configure, build and install  specific files
+according to a file hierarchy and a group of variables.
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
++------------------+--------------------------------------------------------------------------------+
+|  install target  |                                  Description                                   |
++==================+================================================================================+
+|install           |if T is not defined will call install-fhs install                               |
++------------------+--------------------------------------------------------------------------------+
+|install-headers   |install headers files where includedir=$(prefix)/include/dpdk                   |
++------------------+--------------------------------------------------------------------------------+
+|install-bin       |install app files a dpdk tools where bindir=$(exec_prefix)/bin                  |
++------------------+--------------------------------------------------------------------------------+
+|install-lib       |install libraries libdir=$(exec_prefix)/lib                                     |
++------------------+--------------------------------------------------------------------------------+
+|install-doc       |install documentation docdir=$(datarootdir)/doc/dpdk                            |
++------------------+--------------------------------------------------------------------------------+
+|install-mod       |install modules if RTE_EXEC_ENV=linuxapp then                                   |
+|                  |kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else                      |
+|                  |kerneldir=/boot/modules                                                         |
++------------------+--------------------------------------------------------------------------------+
+|install-sdk       |install headers, makefiles, scripts,examples and config files                   |
+|                  |sdkdir=$(datarootdir)/dpdk                                                      |
++------------------+--------------------------------------------------------------------------------+
+|install-fhs       |install libraries, modules, app files, nic bind files (tools) and documentation |
++------------------+--------------------------------------------------------------------------------+
+
+prefix=/usr/local, exec_prefix=$(prefix) and datarootdir=$(prefix)/share by default however prefix, exec_prefix, datarootdir and all path
+variables can be overridden furthermore all targets can use DESTDIR variable.
+
 Browsing the Installed DPDK Environment Target
 ----------------------------------------------
 
-- 
2.6.3

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

* Re: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules Mario Carrillo
@ 2015-12-01 11:11     ` Mcnamara, John
  2015-12-01 12:08     ` Mcnamara, John
  1 sibling, 0 replies; 150+ messages in thread
From: Mcnamara, John @ 2015-12-01 11:11 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C, dev; +Cc: Venegas Munoz, Jos C

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mario Carrillo
> Sent: Tuesday, December 1, 2015 12:53 AM
> To: dev@dpdk.org
> Cc: Venegas Munoz, Jos C
> Subject: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new
> installation rules
> 
> Information about variables and rules behaviour is added to documentation.

Hi,

Thanks for the documentation. Some comments below.



> diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt index
> bf18b48..66f0d0e 100644
> --- a/doc/build-sdk-quick.txt
> +++ b/doc/build-sdk-quick.txt
> @@ -5,10 +5,21 @@ 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
> +	install          if T is defined, build a target and install in
> DESTDIR
> +                         else call install-fhs target

The convention in this file is to use tabs rather than spaces for the first
level indentation. Copy that style at the above and following lines.


>  	uninstall        remove all installed targets
>  	examples         build examples for given targets (T=)
>  	examples_clean   clean examples for given targets (T=)
> +Install commands
> +	install          if T is defined, build a target and install in
> DESTDIR
> +                         else call install-fhs  target

Same as above, 1 tab instead of spaces at the start of the line, spaces
after that for alignment.


> +	install-headers  install headers files
> +	install-bin      install app files a dpdk tools
> +	install-lib      install libraries
> +	install-doc      install documentation
> +	install-mod      install modules
> +	install-sdk      install headers, makefiles, scripts,examples, tools and config files

Typo. Needs space after comma.


> +	install-fhs      install libraries, modules, app files, nic bind files and documentation

Maybe "tools" instead of " nic bind files".

Also, for me, "fhs" isn't clear as an option. Maybe "install-all" instead.



> diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst
> b/doc/guides/freebsd_gsg/build_dpdk.rst
> index 8eff599..72826d0 100644
> --- a/doc/guides/freebsd_gsg/build_dpdk.rst
> +++ b/doc/guides/freebsd_gsg/build_dpdk.rst
> @@ -136,6 +136,46 @@ The DPDK is composed of several directories:
> 
>  *   config, tools, scripts, mk: Framework-related makefiles, scripts and
> configuration
> 
> +
> +Build and install DPDK using a file hierarchy
> +---------------------------------------------
> +
> +Following the next steps is possible configure, build and install
> +specific files according to a file hierarchy and a group of variables.

Probably better as something like:

It is possible to configure, build and install specific groups of DPDK files
into a a file hierarchy using the following install commands and variables:


> +
> +.. code-block:: console
> +
> +	make config T=<config template>
> +	make
> +	make <install target>
> +
> ++------------------+-----------------------------------------------------
> ---------------------------+
> +|  install target  |                                  Description
> |
> ++==================+===================================================
> ++=============================+
> +|install           |if T is not defined will call install-fhs install
> |

In general tables should be avoided in the docs. See the Tables section of the
DPDK Documentation guidelines:

    http://dpdk.org/doc/guides/contributing/documentation.html#tables

A bullet list would be clear here. Something like:



Where the install options are:

* ``install``

  If ``T`` is not defined make will call ``install-fhs``.

* ``install-headers``

  Install headers files into ``includedir`` which is defined as
  ``$(prefix)/include/dpdk``.

* ``install-bin``

  Install app files and dpdk tools into ``bindir`` which is defined as
  ``$(exec_prefix)/bin``.

* ``install-lib``

  Install libraries into ``libdir`` which is defined as
  ``$(exec_prefix)/lib``.

* ``install-doc``

  Install documentation into ``docdir`` which is defined as
  ``$(datarootdir)/doc/dpdk``.

* ``install-mod``

  Install modules into ``kerneldir``. If ``RTE_EXEC_ENV`` is ``linuxapp`` then
  ``kerneldir`` is ``/lib/modules/$(uname -r)/extra/drivers/dpdk`` otherwise
  ``/boot/modules``.

* ``install-sdk``

  Install headers, makefiles, scripts,examples and config files into
  ``sdkdir`` which is defined as ``$(datarootdir)/dpdk``.

* ``install-fhs``

  Install libraries, modules, app files, tools and documentation.

> +prefix=/usr/local, exec_prefix=$(prefix) and
> +datarootdir=$(prefix)/share by default however prefix, exec_prefix,
> datarootdir and all path variables can be overridden furthermore all
> targets can use DESTDIR variable.

This could be reformatted more clearly like the following:


The following defaults apply::

   prefix=/usr/local
   exec_prefix=$(prefix)
   datarootdir=$(prefix)/share

All path variables can be overridden and all targets can use the ``DESTDIR``
variable.


>
>  Installation of the DPDK Target Environments
>  --------------------------------------------
> 
> diff --git a/doc/guides/linux_gsg/build_dpdk.rst

Same comments for the Linux GSG.


John.
-- 

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

* Re: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules Mario Carrillo
  2015-12-01 11:11     ` Mcnamara, John
@ 2015-12-01 12:08     ` Mcnamara, John
  2015-12-01 13:36       ` Arevalo, Mario Alfredo C
  1 sibling, 1 reply; 150+ messages in thread
From: Mcnamara, John @ 2015-12-01 12:08 UTC (permalink / raw)
  To: Arevalo, Mario Alfredo C, dev; +Cc: Venegas Munoz, Jos C

> -----Original Message-----
> From: Mcnamara, John
> Sent: Tuesday, December 1, 2015 11:12 AM
> To: 'Mario Carrillo'; dev@dpdk.org
> Cc: Venegas Munoz, Jos C
> Subject: RE: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new
> installation rules
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mario Carrillo
> > Sent: Tuesday, December 1, 2015 12:53 AM
> > To: dev@dpdk.org
> > Cc: Venegas Munoz, Jos C
> > Subject: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new
> > installation rules
> >
> > Information about variables and rules behaviour is added to
> documentation.
> 
> Hi,
> 
> Thanks for the documentation. Some comments below.

Hi,

You also need to mark the v6 versions as Superseded:

http://dpdk.org/dev/patchwork/project/dpdk/list/?submitter=Mario+Carrillo

John.
-- 

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

* Re: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules
  2015-12-01 12:08     ` Mcnamara, John
@ 2015-12-01 13:36       ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-12-01 13:36 UTC (permalink / raw)
  To: Mcnamara, John, dev; +Cc: Venegas Munoz, Jos C

Hi John,
Thank you so much for your comments about documentation patches, I have taken note for the next version :)

Thanks.
Mario. 
________________________________________
From: Mcnamara, John
Sent: Tuesday, December 01, 2015 4:08 AM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Cc: Venegas Munoz, Jos C
Subject: RE: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules

> -----Original Message-----
> From: Mcnamara, John
> Sent: Tuesday, December 1, 2015 11:12 AM
> To: 'Mario Carrillo'; dev@dpdk.org
> Cc: Venegas Munoz, Jos C
> Subject: RE: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new
> installation rules
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mario Carrillo
> > Sent: Tuesday, December 1, 2015 12:53 AM
> > To: dev@dpdk.org
> > Cc: Venegas Munoz, Jos C
> > Subject: [dpdk-dev] [PATCH v7 11/11] doc: Add information about new
> > installation rules
> >
> > Information about variables and rules behaviour is added to
> documentation.
>
> Hi,
>
> Thanks for the documentation. Some comments below.

Hi,

You also need to mark the v6 versions as Superseded:

http://dpdk.org/dev/patchwork/project/dpdk/list/?submitter=Mario+Carrillo

John.
--



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

* Re: [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files.
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
                     ` (10 preceding siblings ...)
  2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules Mario Carrillo
@ 2015-12-01 19:17   ` Thomas Monjalon
  2015-12-01 19:36     ` Arevalo, Mario Alfredo C
  11 siblings, 1 reply; 150+ messages in thread
From: Thomas Monjalon @ 2015-12-01 19:17 UTC (permalink / raw)
  To: Mario Carrillo; +Cc: dev, jos.c.venegas.munoz

Hi Mario,

Thanks for your work. There are some interesting ideas :)
I'm going to send a patchset to establish the same kind of
rules keeping the old install behaviour and allowing a
standard one with the same name (install).
The result would be closed to what pkg/dpdk.spec provides.
Your review would be appreciated.

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

* Re: [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files.
  2015-12-01 19:17   ` [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files Thomas Monjalon
@ 2015-12-01 19:36     ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-12-01 19:36 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Venegas Munoz, Jos C

Hi Thomas,

Thank you for your answer, John Mcnamara gave feedback about documentation in this version (7) and I'm going to send a version number 8 with new changes 
about documentation, it would be amazing if you could take a look it :)  thank you for your attention. 

Mario. 
 ________________________________________
From: Thomas Monjalon [thomas.monjalon@6wind.com]
Sent: Tuesday, December 01, 2015 11:17 AM
To: Arevalo, Mario Alfredo C
Cc: dev@dpdk.org; olivier.matz@6wind.com; miguel.bernal.marin@linux.intel.com; Venegas Munoz, Jos C; Richardson, Bruce; david.marchand@6wind.com
Subject: Re: [PATCH v7 00/11] Add installation rules for dpdk files.

Hi Mario,

Thanks for your work. There are some interesting ideas :)
I'm going to send a patchset to establish the same kind of
rules keeping the old install behaviour and allowing a
standard one with the same name (install).
The result would be closed to what pkg/dpdk.spec provides.
Your review would be appreciated.

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

* [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (14 preceding siblings ...)
  2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
@ 2015-12-01 19:39 ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 01/11] mk: Add rule for installing headers Mario Carrillo
                     ` (11 more replies)
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
  16 siblings, 12 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.
This patch set allows to install files based on the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

v8:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).

* make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).

* make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).

* make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples and
                config files) (default path sdkdir=$(datadir)/share/dpdk).

* make install-fhs (install  libraries, modules, app files, tools and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule).

The following defaults apply:

   prefix=/usr/local
   exec_prefix=$(prefix)
   datarootdir=$(prefix)/share

All path variables can be overridden and all targets can use the "DESTDIR"
variable.

Furthermore this information is added to documentation.

v7:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).

* make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).

* make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).

* make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples and
                config files) (default path sdkdir=$(datadir)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files (tools) and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule).

where prefix=/usr/local, exec_prefix=$(prefix), datarootdir=$(prefix)/share, and datadir=$(datarootdir)/dpdk by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(bindir, libdir, includedir, docidr, kerneldir, prefix, exec_prefix and data).

Furthermore this information is added to documentation.


v6:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation.


v5:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation (build-sdk-quick.txt file)

v4:

Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
And this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET



Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (11):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files
  app: Change name to test binary
  mk: Rename install rule as mbuild rule
  mk: Add new install rule
  doc: Add information about new installation rules

 app/test/Makefile                     |   2 +-
 doc/build-sdk-quick.txt               |  23 +++++-
 doc/guides/freebsd_gsg/build_dpdk.rst |  62 +++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   |  62 +++++++++++++++
 mk/rte.sdkinstall.mk                  | 146 ++++++++++++++++++++++++++++++++--
 mk/rte.sdkroot.mk                     |   6 +-
 6 files changed, 291 insertions(+), 10 deletions(-)

-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 01/11] mk: Add rule for installing headers
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 02/11] mk: Add rule for installing app files Mario Carrillo
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(includedir)
where includedir=$(prefix)/include/dpdk and prefix=/usr/local by
default, you can override "prefix" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 22 +++++++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..a4a01cf 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,11 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
+prefix ?= /usr/local
+includedir ?= $(prefix)/include/dpdk
+HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+endif
 endif
 
 #
@@ -72,7 +77,22 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/local/include/dpdk by default
+# "prefix" and "includedir" vars can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@if [ ! -z "${HSLINKS}" ]; then \
+	for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	HEADER_DIR=$$(dirname $$HSLINK | sed 's/.*include\/*//'); \
+	[ -d $(DESTDIR)/$(includedir)/$$HEADER_DIR ] || mkdir -p $(DESTDIR)/$(includedir)/$$HEADER_DIR; \
+	cp -rf $$HEADER ${DESTDIR}/${includedir}/$$HEADER_DIR; \
+	echo installing: $$HEADER; \
+	done \
+	fi
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 02/11] mk: Add rule for installing app files
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 01/11] mk: Add rule for installing headers Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 03/11] mk: Add rule for installing libraries Mario Carrillo
                     ` (9 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(bindir)
where bindir=$(exec_prefix)/usr/local/bin
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and bindir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index a4a01cf..93de06b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,8 +43,13 @@ ifndef T
 T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
+exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
+bindir ?= $(exec_prefix)/bin
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -94,6 +99,20 @@ install-headers:
 	done \
 	fi
 #
+# install app files in /usr/local/bin by default
+# "prefix" and "bindir" can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files;
+	@if [ ! -z "${BINARY_FILES}" ]; then \
+	[ -d $(DESTDIR)/$(bindir) ] || mkdir -p $(DESTDIR)/$(bindir); \
+	for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${bindir}; \
+	echo installing: $$BIN_FILE; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 03/11] mk: Add rule for installing libraries
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 01/11] mk: Add rule for installing headers Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 02/11] mk: Add rule for installing app files Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 04/11] mk: Add rule for installing modules Mario Carrillo
                     ` (8 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(libdir)
where libdir=$(exec_prefix)/usr/lib
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and libdir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 93de06b..ff99afe 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,9 +46,11 @@ prefix ?= /usr/local
 exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
+libdir ?= $(exec_prefix)/lib
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 BINARY_FILES += $(NIC_FILES)
 endif
 endif
@@ -113,6 +115,20 @@ install-bin:
 	done \
 	fi
 #
+# install libs in /usr/local/lib by default
+# "prefix" and "libdir" can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@if [ ! -z "${LIBS}" ]; then \
+	[ -d $(DESTDIR)/$(libdir) ] || mkdir -p $(DESTDIR)/$(libdir); \
+	for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${libdir}; \
+	echo installing: $$LIB; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 04/11] mk: Add rule for installing modules
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 03/11] mk: Add rule for installing libraries Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 05/11] mk: Add rule for installing documentation Mario Carrillo
                     ` (7 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(kerneldir)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
by default, you can override "kerneldir" var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 24 ++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ff99afe..1502399 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -51,7 +51,15 @@ HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
+include $(RTE_OUTPUT)/.config
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+kerneldir ?= /boot/modules
+endif
 endif
 endif
 
@@ -129,6 +137,22 @@ install-lib:
 	done \
 	fi
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# "kerneldir" var  can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@if [ ! -z "${MODULES}" ]; then \
+	[ -d $(DESTDIR)/$(kerneldir) ] || mkdir -p $(DESTDIR)/$(kerneldir); \
+	for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${kerneldir}; \
+	echo installing: $$MOD; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 05/11] mk: Add rule for installing documentation
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 04/11] mk: Add rule for installing modules Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 06/11] mk: Add rule for installing sdk files Mario Carrillo
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(docdir) where
docdir=$(datarootdir)/doc/dpdk
datarootdir=$(prefix)/share
prefix=/usr/local by default, you can override "prefix",
"datarootdir" and "docdir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 17 +++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 1502399..c062489 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,11 +47,14 @@ exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc/dpdk
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(RTE_SDK)/doc/*)
 BINARY_FILES += $(NIC_FILES)
 include $(RTE_OUTPUT)/.config
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -153,6 +156,20 @@ install-mod:
 	done \
 	fi
 #
+# install documentation in /usr/local/share/doc/dpdk
+# by default, "docdir", "prefix" and "datarootdir" vars can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@if [ ! -z "${DOCS}" ]; then \
+	[ -d $(DESTDIR)/$(docdir) ] || mkdir -p $(DESTDIR)/$(docdir); \
+	for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${docdir}; \
+	echo installing: $$DOC; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..f56341d 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 06/11] mk: Add rule for installing sdk files
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 05/11] mk: Add rule for installing documentation Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 07/11] mk: Add rule for installing runtime files Mario Carrillo
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples and config files will be installed in:
$(DESTDIR)/$(sdkdir)
and headers will be installed in:
$(DESTDIR)/$(includedir)
where sdkdir=$(datadir)
datadir=$(datarootdir)/dpdk
datarootdir=$(prefix)/share
includedir=$(prefix)/include/dpdk
prefix=/usr/local by default, you can override "prefix", "sdkdir",
"datadir", "datarootdir" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index c062489..09950fa 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -49,6 +49,8 @@ bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
 datarootdir ?= $(prefix)/share
 docdir ?= $(datarootdir)/doc/dpdk
+datadir ?= $(datarootdir)/dpdk
+sdkdir ?= $(datadir)
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
@@ -170,6 +172,23 @@ install-doc:
 	done \
 	fi
 #
+# install sdk files in /usr/local/share/dpdk by default
+# where prefix and "sdkdir", "datadir" and "prefix" var can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(sdkdir) ] || mkdir -p $(DESTDIR)/$(sdkdir); \
+	cp -rf $(RTE_SDK)/mk $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/mk; \
+	cp -rf $(RTE_SDK)/scripts $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/scripts; \
+	cp -rf $(RTE_SDK)/examples $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/examples;
+	@[ -d $(DESTDIR)/$(sdkdir)/config ] || mkdir -p $(DESTDIR)/$(sdkdir)/config; \
+	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
+	echo installing: $(RTE_OUTPUT)/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index f56341d..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,8 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
-install install-headers install-bin install-lib install-mod install-doc uninstall:
+install-doc install-sdk uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 07/11] mk: Add rule for installing runtime files
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 06/11] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 08/11] app: Change name to test binary Mario Carrillo
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file (tools) and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(bindir) where bindir=$(exec_prefix)/bin (binary files)
$(DESTDIR)/$(docdir) where docdir=$(datarootdir)/doc/dpdk
(documentation)
$(DESTDIR)/$(libdir) where libdir=$(exec_prefix)/lib (libraries)
$(DESTDIR)/$(kerneldir) (modules)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
exec_prefix=$(prefix)
datarootdir=$(prefix)/share
and prefix=/usr/local
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 9 +++++++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 09950fa..d1ff160 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -189,6 +189,15 @@ install-sdk: install-headers
 	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
 	echo installing: $(RTE_OUTPUT)/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
+	@echo ================== Installing runtime files
+	@[ -d $(DESTDIR)/$(datadir) ] || mkdir -p $(DESTDIR)/$(datadir); \
+	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
+	echo installing: $(RTE_SDK)/tools
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 08/11] app: Change name to test binary
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 07/11] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

This is order to test could be installed in a file herarchy and do not
make a colision with test command from coreutils package.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 app/test/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index ec33e1a..184f91b 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -36,7 +36,7 @@ ifeq ($(CONFIG_RTE_APP_TEST),y)
 #
 # library name
 #
-APP = test
+APP = test-dpdk
 
 #
 # all sources are stored in SRCS-y
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 09/11] mk: Rename install rule as mbuild rule
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 08/11] app: Change name to test binary Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 10/11] mk: Add new install rule Mario Carrillo
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

"install" rule with the current dpdk behaviour change its name by
mbuild.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 8 ++++----
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index d1ff160..df16f5c 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -73,13 +73,13 @@ endif
 #
 INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
+INSTALL_TARGETS := $(addsuffix _mbuild,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
-.PHONY: install
-install: $(INSTALL_TARGETS)
+.PHONY: mbuild
+mbuild: $(INSTALL_TARGETS)
 
-%_install:
+%_mbuild:
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index dd5f399..1b619b7 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-install install-headers install-bin install-lib install-mod install-doc \
+mbuild install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 10/11] mk: Add new install rule
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 11/11] doc: Add information about new installation rules Mario Carrillo
  2015-12-02  9:33   ` [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files Panu Matilainen
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

If "T" variable is defined, the installation process will have the
current behaviour, else install rule will be called.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 12 +++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index df16f5c..5195442 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,6 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
-T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
 exec_prefix ?= $(prefix)
@@ -198,6 +197,17 @@ install-fhs: install-lib install-bin install-doc install-mod
 	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
 	echo installing: $(RTE_SDK)/tools
 #
+# if "T" var is defined, mbuild rule will be called, else
+# install-fhs rule will be called.
+#
+.PHONY: install
+install:
+ifdef T
+install: mbuild
+else
+install: install-fhs
+endif
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 1b619b7..2f8f64a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: mbuild install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-mbuild install-headers install-bin install-lib install-mod install-doc \
+mbuild install install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v8 11/11] doc: Add information about new installation rules
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (9 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 10/11] mk: Add new install rule Mario Carrillo
@ 2015-12-01 19:39   ` Mario Carrillo
  2015-12-02  9:33   ` [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files Panu Matilainen
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-01 19:39 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Information about variables and rules behaviour is added to
documentation.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 doc/build-sdk-quick.txt               | 23 ++++++++++++-
 doc/guides/freebsd_gsg/build_dpdk.rst | 62 +++++++++++++++++++++++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   | 62 +++++++++++++++++++++++++++++++++++
 3 files changed, 146 insertions(+), 1 deletion(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..89ddcac 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,10 +5,19 @@ 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
+	install          if T is defined, build a target and install in DESTDIR else call install-fhs target
 	uninstall        remove all installed targets
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
+Install commands
+	install          if T is defined, build a target and install in DESTDIR else call install-fhs target
+	install-headers  install headers files
+	install-bin      install app files a dpdk tools
+	install-lib      install libraries
+	install-doc      install documentation
+	install-mod      install modules
+	install-sdk      install headers, makefiles, scripts, examples, tools and config files
+	install-fhs      install libraries, modules, app files, tools and documentation
 Build variables
 	EXTRA_CPPFLAGS   preprocessor options
 	EXTRA_CFLAGS     compiler options
@@ -23,3 +32,15 @@ Build variables
 	T         target template (install default: *) - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
+Install variables
+	prefix          /usr/local by default it can be overridden
+	exec_prefix     $(prefix)
+	bindir          $(exec_prefix)/bin by default it can be overridden
+	includedir      $(prefix)/include by default it can be overridden
+	libdir          $(exec_prefix)/lib by default it can be overridden
+	docdir          $(datarootdir)/share/doc/dpdk by default it can be overridden
+	sdkdir          $(datadir)
+	datadir         $(datarootdir)/dpdk
+	datarootdir	$(prefix)/share
+	kerneldir       /lib/modules/$(uname -r)/extra/drivers/dpdk is for linux and
+			/boot/modules for BSD by default, they can be overridden
diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst
index 8eff599..e5162fc 100644
--- a/doc/guides/freebsd_gsg/build_dpdk.rst
+++ b/doc/guides/freebsd_gsg/build_dpdk.rst
@@ -136,6 +136,68 @@ The DPDK is composed of several directories:
 
 *   config, tools, scripts, mk: Framework-related makefiles, scripts and configuration
 
+
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+It is possible to configure, build and install specific groups of DPDK files
+into a file hierarchy using the following install commands and variables:
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
+* ``install``
+
+  If ``T`` is not defined make will call ``install-fhs``.
+
+* ``install-headers``
+
+  Install headers files into ``includedir`` which is defined as
+  ``$(prefix)/include/dpdk``.
+
+* ``install-bin``
+
+  Install app files and dpdk tools into ``bindir`` which is defined as
+  ``$(exec_prefix)/bin``.
+
+* ``install-lib``
+
+  Install libraries into ``libdir`` which is defined as
+  ``$(exec_prefix)/lib``.
+
+* ``install-doc``
+
+  Install documentation into ``docdir`` which is defined as
+  ``$(datarootdir)/doc/dpdk``.
+
+* ``install-mod``
+
+  Install modules into ``kerneldir``. If ``RTE_EXEC_ENV`` is ``linuxapp`` then
+  ``kerneldir`` is ``/lib/modules/$(uname -r)/extra/drivers/dpdk`` otherwise
+  ``/boot/modules``.
+
+* ``install-sdk``
+
+  Install headers, makefiles, scripts, examples and config files into
+  ``sdkdir`` which is defined as ``$(datarootdir)/dpdk``.
+
+* ``install-fhs``
+
+  Install libraries, modules, app files, tools and documentation.
+
+The following defaults apply::
+
+   prefix=/usr/local
+   exec_prefix=$(prefix)
+   datarootdir=$(prefix)/share
+
+All path variables can be overridden and all targets can use the ``DESTDIR``
+variable.
+
+
 Installation of the DPDK Target Environments
 --------------------------------------------
 
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 2680e66..7f3ab9d 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -152,6 +152,68 @@ The user may also make modifications to the compile-time DPDK configuration by e
 
 In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
 
+
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+It is possible to configure, build and install specific groups of DPDK files
+into a file hierarchy using the following install commands and variables:
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
+* ``install``
+
+  If ``T`` is not defined make will call ``install-fhs``.
+
+* ``install-headers``
+
+  Install headers files into ``includedir`` which is defined as
+  ``$(prefix)/include/dpdk``.
+
+* ``install-bin``
+
+  Install app files and dpdk tools into ``bindir`` which is defined as
+  ``$(exec_prefix)/bin``.
+
+* ``install-lib``
+
+  Install libraries into ``libdir`` which is defined as
+  ``$(exec_prefix)/lib``.
+
+* ``install-doc``
+
+  Install documentation into ``docdir`` which is defined as
+  ``$(datarootdir)/doc/dpdk``.
+
+* ``install-mod``
+
+  Install modules into ``kerneldir``. If ``RTE_EXEC_ENV`` is ``linuxapp`` then
+  ``kerneldir`` is ``/lib/modules/$(uname -r)/extra/drivers/dpdk`` otherwise
+  ``/boot/modules``.
+
+* ``install-sdk``
+
+  Install headers, makefiles, scripts, examples and config files into
+  ``sdkdir`` which is defined as ``$(datarootdir)/dpdk``.
+
+* ``install-fhs``
+
+  Install libraries, modules, app files, tools and documentation.
+
+The following defaults apply::
+
+   prefix=/usr/local
+   exec_prefix=$(prefix)
+   datarootdir=$(prefix)/share
+
+All path variables can be overridden and all targets can use the ``DESTDIR``
+variable.
+
+
 Browsing the Installed DPDK Environment Target
 ----------------------------------------------
 
-- 
2.6.3

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

* Re: [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files.
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
                     ` (10 preceding siblings ...)
  2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 11/11] doc: Add information about new installation rules Mario Carrillo
@ 2015-12-02  9:33   ` Panu Matilainen
  2015-12-02 23:04     ` Arevalo, Mario Alfredo C
  11 siblings, 1 reply; 150+ messages in thread
From: Panu Matilainen @ 2015-12-02  9:33 UTC (permalink / raw)
  To: Mario Carrillo, dev; +Cc: jos.c.venegas.munoz

On 12/01/2015 09:39 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> This patch set allows to install files based on the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> v8:
>
> When "make install" is invoked if "T" variable is defined,
> the installation process will have the current
> behaviour, else "install-fhs" rule will be called.
>
> Using rules support is possible to do the next steps:
>
> make config T=<config template>
> make
> make <install target>
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> * make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).
>
> * make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).
>
> * make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).
>
> * make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).
>
> * make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
>                  kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).
>
> * make install-sdk (install headers, makefiles, scripts,examples and
>                  config files) (default path sdkdir=$(datadir)/share/dpdk).
>
> * make install-fhs (install  libraries, modules, app files, tools and documentation).
>
> * make install (if T is defined current behaviour, else it will call install-fhs rule).
>
> The following defaults apply:
>
>     prefix=/usr/local
>     exec_prefix=$(prefix)
>     datarootdir=$(prefix)/share
>
> All path variables can be overridden and all targets can use the "DESTDIR"
> variable.
>
> Furthermore this information is added to documentation.

Overall, does what it promises.

One point I just realized from comparing with Thomas' variant is that 
this by default installs documentation sources, ie the raw .rst files 
and does not include any "compiled" formats even if they exist.

It might be better to leave docs out by default as Thomas' version does. 
One way of achieving that is only install docs if $(RTE_OUTPUT)/doc, and 
only install anything in that directory. That way you have to request 
doc generation specifically with "make doc" first (which has quite some 
build-dependencies so you might not always wnat it), and only the 
compiled docs get installed. Or something like that.

	- Panu -

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

* Re: [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files.
  2015-12-02  9:33   ` [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files Panu Matilainen
@ 2015-12-02 23:04     ` Arevalo, Mario Alfredo C
  0 siblings, 0 replies; 150+ messages in thread
From: Arevalo, Mario Alfredo C @ 2015-12-02 23:04 UTC (permalink / raw)
  To: Panu Matilainen, dev; +Cc: Venegas Munoz, Jos C

Thank you, I'm going to take note about it for a version number 9 :)

Thanks.
Mario.
________________________________________
From: Panu Matilainen [pmatilai@redhat.com]
Sent: Wednesday, December 02, 2015 1:33 AM
To: Arevalo, Mario Alfredo C; dev@dpdk.org
Cc: Venegas Munoz, Jos C
Subject: Re: [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files.

On 12/01/2015 09:39 PM, Mario Carrillo wrote:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> This patch set allows to install files based on the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> v8:
>
> When "make install" is invoked if "T" variable is defined,
> the installation process will have the current
> behaviour, else "install-fhs" rule will be called.
>
> Using rules support is possible to do the next steps:
>
> make config T=<config template>
> make
> make <install target>
>
> Modify the makefile target to specify the files
> that will be installed using a rule:
>
> * make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).
>
> * make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).
>
> * make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).
>
> * make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).
>
> * make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
>                  kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).
>
> * make install-sdk (install headers, makefiles, scripts,examples and
>                  config files) (default path sdkdir=$(datadir)/share/dpdk).
>
> * make install-fhs (install  libraries, modules, app files, tools and documentation).
>
> * make install (if T is defined current behaviour, else it will call install-fhs rule).
>
> The following defaults apply:
>
>     prefix=/usr/local
>     exec_prefix=$(prefix)
>     datarootdir=$(prefix)/share
>
> All path variables can be overridden and all targets can use the "DESTDIR"
> variable.
>
> Furthermore this information is added to documentation.

Overall, does what it promises.

One point I just realized from comparing with Thomas' variant is that
this by default installs documentation sources, ie the raw .rst files
and does not include any "compiled" formats even if they exist.

It might be better to leave docs out by default as Thomas' version does.
One way of achieving that is only install docs if $(RTE_OUTPUT)/doc, and
only install anything in that directory. That way you have to request
doc generation specifically with "make doc" first (which has quite some
build-dependencies so you might not always wnat it), and only the
compiled docs get installed. Or something like that.

        - Panu -

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

* [dpdk-dev] [PATCH v9 00/11] Add installation rules for dpdk files.
  2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
                   ` (15 preceding siblings ...)
  2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
@ 2015-12-03 21:37 ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 01/11] mk: Add rule for installing headers Mario Carrillo
                     ` (11 more replies)
  16 siblings, 12 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.
This patch set allows to install files based on the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

v9:

When "make install-doc" is invoked, if "make doc" was invoked
previously, it will install html and pdf files too, everything else
is the same.

v8:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).

* make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).

* make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).

* make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples and
                config files) (default path sdkdir=$(datadir)/share/dpdk).

* make install-fhs (install  libraries, modules, app files, tools and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule).

The following defaults apply:

   prefix=/usr/local
   exec_prefix=$(prefix)
   datarootdir=$(prefix)/share

All path variables can be overridden and all targets can use the "DESTDIR"
variable.

Furthermore this information is added to documentation.

v7:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path bindir=$(exec_prefix)/bin).

* make install-headers (install headers)(dafault path includedir=$(prefix)/include/dpdk).

* make install-lib (install libraries)(dafault path libdir=$(exec_prefix)/lib).

* make install-doc (install documentation)(dafault path docdir=$(datarootdir)/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk else kerneldir=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples and
                config files) (default path sdkdir=$(datadir)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files (tools) and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule).

where prefix=/usr/local, exec_prefix=$(prefix), datarootdir=$(prefix)/share, and datadir=$(datarootdir)/dpdk by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(bindir, libdir, includedir, docidr, kerneldir, prefix, exec_prefix and data).

Furthermore this information is added to documentation.


v6:
When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation.


v5:

When "make install" is invoked if "T" variable is defined,
the installation process will have the current
behaviour, else "install-fhs" rule will be called.

Using rules support is possible to do the next steps:

make config T=<config template>
make
make <install target>

Modify the makefile target to specify the files
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=$(RTE_PREFIX)/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=$(RTE_PREFIX)/include/dpdk).

* make install-lib (install libraries)(dafault path LIB_DIR=$(RTE_PREFIX)/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=$(RTE_PREFIX)/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then
                KMOD_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KMOD_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and
                config files) (default path DATA_DIR=$(RTE_PREFIX)/share/dpdk).

* make install-fhs (install  libraries, modules, app files,
                nic bind files and documentation).

* make install (if T is defined current behaviour, else it will call install-fhs rule )

where RTE_PREFIX=/usr/local by default.

Also you can use the DESTDIR var.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KMOD_DIR, RTE_PREFIX and DATA_DIR).

Furthermore this information is added to documentation (build-sdk-quick.txt file)

v4:

Add instalation rules for dpdk files.

DPDK package lacks of a mechanism to install libraries, headers
applications, kernel modules and sdk files to a file system tree.

This patch set allows to install files according to the next
proposal:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
And this patch set does not affect the current dpdk behavior.

Using rules support is possible to do the next steps:
make config T=TARGET
make
make INSTALL-TARGET



Modify the makefile target to specify the files 
that will be installed using a rule:

* make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).

* make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).

* make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).

* make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).

* make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/extra/drivers/dpdk else KERNEL_DIR=/boot/modules).

* make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 

* make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).

v3:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files)(dafault path BIN_DIR=/usr/bin).
make install-headers (install headers)(dafault path INCLUDE_DIR=/usr/include/dpdk).
make install-lib (install libraries)(dafault path if the architecture is 64 bits
		is LIB_DIR=/usr/lib64 else LIB_DIR=/usr/lib).
make install-sbin (install nic bind files)(dafault path SBIN_DIR=/usr/sbin).
make install-doc (install documentation)(dafault path DOC_DIR=/usr/share/doc/dpdk).
make install-mod (install modules)(dafault path if RTE_EXEC_ENV=linuxapp then 
		KERNEL_DIR=/lib/modules/$(uname -r)/build else KERNEL_DIR=/boot/modules).
make install-sdk (install headers, makefiles, scripts,examples, tools and 
		config files) (default path DATA_DIR=/usr/share/dpdk). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.
All directory variables mentioned above can be overridden
(BIN_DIR, LIB_DIR, INCLUDE_DIR, SBIN_DIR, DOC_DIR, KERNEL_DIR and DATA_DIR).


v2:

Modify the makefile target to specify the files 
that will be installed using a rule:

make install-bin (install app files).
make install-headers (install headers).
make install-lib (install libraries).
make install-sbin (install nic bind files).
make install-doc (install documentation).
make install-mod (install modules).
make install-sdk (install headers, makefiles, scripts,
		examples, tools and config files). 
make install-fhs (install  libraries, modules, app files, 
		nic bind files and documentation).

Also you can use the DESTDIR variable.


v1:

By adding a parameter H=1 (hierarchy-file) to makefile system, it is
possible to do the next steps

make config T=TARGET
make
make install H=1

and files will be installed on the proper directory. Also you can use
the DESTDIR variable.

Mario Carrillo (11):
  mk: Add rule for installing headers
  mk: Add rule for installing app files
  mk: Add rule for installing libraries
  mk: Add rule for installing modules
  mk: Add rule for installing documentation
  mk: Add rule for installing sdk files
  mk: Add rule for installing runtime files
  app: Change name to test binary
  mk: Rename install rule as mbuild rule
  mk: Add new install rule
  doc: Add information about new installation rules

 app/test/Makefile                     |   2 +-
 doc/build-sdk-quick.txt               |  23 +++++-
 doc/guides/freebsd_gsg/build_dpdk.rst |  60 ++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   |  60 ++++++++++++++
 mk/rte.sdkinstall.mk                  | 146 ++++++++++++++++++++++++++++++++--
 mk/rte.sdkroot.mk                     |   6 +-
 6 files changed, 287 insertions(+), 10 deletions(-)

-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 01/11] mk: Add rule for installing headers
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 02/11] mk: Add rule for installing app files Mario Carrillo
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK headers,
when invoking "make install-headers" headers will
be installed in: $(DESTDIR)/$(includedir)
where includedir=$(prefix)/include/dpdk and prefix=/usr/local by
default,
you can override "prefix" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 22 +++++++++++++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 86c98a5..a4a01cf 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -41,6 +41,11 @@ endif
 # x86_64-native-*-gcc
 ifndef T
 T=*
+ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
+prefix ?= /usr/local
+includedir ?= $(prefix)/include/dpdk
+HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+endif
 endif
 
 #
@@ -72,7 +77,22 @@ install: $(INSTALL_TARGETS)
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
-
+#
+# install headers in /usr/local/include/dpdk by default
+# "prefix" and "includedir" vars can be overridden.
+#
+.PHONY: install-headers
+install-headers:
+	@echo ================== Installing headers;
+	@if [ ! -z "${HSLINKS}" ]; then \
+	for HSLINK in ${HSLINKS}; do \
+	HEADER=$$(readlink -f $$HSLINK); \
+	HEADER_DIR=$$(dirname $$HSLINK | sed 's/.*include\/*//'); \
+	[ -d $(DESTDIR)/$(includedir)/$$HEADER_DIR ] || mkdir -p $(DESTDIR)/$(includedir)/$$HEADER_DIR; \
+	cp -rf $$HEADER ${DESTDIR}/${includedir}/$$HEADER_DIR; \
+	echo installing: $$HEADER; \
+	done \
+	fi
 #
 # uninstall: remove all built sdk
 #
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e8423b0..8477a2b 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-headers uninstall
+install install-headers uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 02/11] mk: Add rule for installing app files
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 01/11] mk: Add rule for installing headers Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 03/11] mk: Add rule for installing libraries Mario Carrillo
                     ` (9 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK app files,
nic bind file and cpu layout file
when invoking "make install-bin" app files will
be installed in: $(DESTDIR)/$(bindir)
where bindir=$(exec_prefix)/usr/local/bin
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and bindir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index a4a01cf..93de06b 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -43,8 +43,13 @@ ifndef T
 T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
+exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
+bindir ?= $(exec_prefix)/bin
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
+BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
+NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+BINARY_FILES += $(NIC_FILES)
 endif
 endif
 
@@ -94,6 +99,20 @@ install-headers:
 	done \
 	fi
 #
+# install app files in /usr/local/bin by default
+# "prefix" and "bindir" can be overridden.
+#
+.PHONY: install-bin
+install-bin:
+	@echo ================== Installing app files;
+	@if [ ! -z "${BINARY_FILES}" ]; then \
+	[ -d $(DESTDIR)/$(bindir) ] || mkdir -p $(DESTDIR)/$(bindir); \
+	for BIN_FILE in ${BINARY_FILES}; do \
+	cp -rf $$BIN_FILE ${DESTDIR}/${bindir}; \
+	echo installing: $$BIN_FILE; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 8477a2b..24eaa60 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 install-headers uninstall
-install install-headers uninstall:
+.PHONY: install install-headers install-bin uninstall
+install install-headers install-bin uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 03/11] mk: Add rule for installing libraries
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 01/11] mk: Add rule for installing headers Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 02/11] mk: Add rule for installing app files Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 04/11] mk: Add rule for installing modules Mario Carrillo
                     ` (8 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries,
when invoking "make install-lib" libraries will
be installed in: $(DESTDIR)/$(libdir)
where libdir=$(exec_prefix)/usr/lib
prefix=/usr/local
and exec_prefix=$(prefix) by default,
you can override prefix, exec_prefix and libdir vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 16 ++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 93de06b..ff99afe 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -46,9 +46,11 @@ prefix ?= /usr/local
 exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
+libdir ?= $(exec_prefix)/lib
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
+LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 BINARY_FILES += $(NIC_FILES)
 endif
 endif
@@ -113,6 +115,20 @@ install-bin:
 	done \
 	fi
 #
+# install libs in /usr/local/lib by default
+# "prefix" and "libdir" can be overridden.
+#
+.PHONY: install-lib
+install-lib:
+	@echo ================== Installing libraries
+	@if [ ! -z "${LIBS}" ]; then \
+	[ -d $(DESTDIR)/$(libdir) ] || mkdir -p $(DESTDIR)/$(libdir); \
+	for LIB in ${LIBS}; do \
+	cp -rf $$LIB ${DESTDIR}/${libdir}; \
+	echo installing: $$LIB; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 24eaa60..7a72c9b 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 install-headers install-bin uninstall
-install install-headers install-bin uninstall:
+.PHONY: install install-headers install-bin install-lib uninstall
+install install-headers install-bin install-lib uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 04/11] mk: Add rule for installing modules
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (2 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 03/11] mk: Add rule for installing libraries Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 05/11] mk: Add rule for installing documentation Mario Carrillo
                     ` (7 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK modules,
when invoking "make install-mod" modules will be
installed in: $(DESTDIR)/$(kerneldir)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
by default, you can override "kerneldir" var.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 24 ++++++++++++++++++++++++
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index ff99afe..1502399 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -51,7 +51,15 @@ HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
+MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
 BINARY_FILES += $(NIC_FILES)
+include $(RTE_OUTPUT)/.config
+RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir ?= /lib/modules/$(shell uname -r)/extra/drivers/dpdk
+else
+kerneldir ?= /boot/modules
+endif
 endif
 endif
 
@@ -129,6 +137,22 @@ install-lib:
 	done \
 	fi
 #
+# if RTE_EXEC_ENV=linuxapp modules install in:
+# /lib/modules/$(uname -r)/extra/drivers/dpdk
+# else /boot/modules/ by default
+# "kerneldir" var  can be overridden.
+#
+.PHONY: install-mod
+install-mod:
+	@echo ================== Installing modules
+	@if [ ! -z "${MODULES}" ]; then \
+	[ -d $(DESTDIR)/$(kerneldir) ] || mkdir -p $(DESTDIR)/$(kerneldir); \
+	for MOD in ${MODULES}; do \
+	cp -rf $$MOD ${DESTDIR}/${kerneldir}; \
+	echo installing: $$MOD; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 7a72c9b..e652218 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 install-headers install-bin install-lib uninstall
-install install-headers install-bin install-lib uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod uninstall
+install install-headers install-bin install-lib install-mod uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 05/11] mk: Add rule for installing documentation
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (3 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 04/11] mk: Add rule for installing modules Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 06/11] mk: Add rule for installing sdk files Mario Carrillo
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK documentation,
when invoking "make install-doc" documentation files will
be installed in: $(DESTDIR)/$(docdir) where
docdir=$(datarootdir)/doc/dpdk
datarootdir=$(prefix)/share
prefix=/usr/local by default, you can override "prefix",
"datarootdir" and "docdir" vars.
also if "make doc" was invoked previously, html and pdf documentation
will be included in this path
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

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

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 1502399..e5e319d 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -47,11 +47,14 @@ exec_prefix ?= $(prefix)
 includedir ?= $(prefix)/include/dpdk
 bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc/dpdk
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
 LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
 MODULES := $(wildcard $(RTE_OUTPUT)/kmod/*)
+DOCS := $(wildcard $(RTE_SDK)/doc/* $(RTE_OUTPUT)/doc/*)
 BINARY_FILES += $(NIC_FILES)
 include $(RTE_OUTPUT)/.config
 RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
@@ -153,6 +156,20 @@ install-mod:
 	done \
 	fi
 #
+# install documentation in /usr/local/share/doc/dpdk
+# by default, "docdir", "prefix" and "datarootdir" vars can be overriden.
+#
+.PHONY: install-doc
+install-doc:
+	@echo ================== Installing documentation
+	@if [ ! -z "${DOCS}" ]; then \
+	[ -d $(DESTDIR)/$(docdir) ] || mkdir -p $(DESTDIR)/$(docdir); \
+	for DOC in ${DOCS}; do \
+	cp -rf $$DOC ${DESTDIR}/${docdir}; \
+	echo installing: $$DOC; \
+	done \
+	fi
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index e652218..f56341d 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,8 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod uninstall
-install install-headers install-bin install-lib install-mod uninstall:
+.PHONY: install install-headers install-bin install-lib install-mod \
+install-doc uninstall
+install install-headers install-bin install-lib install-mod install-doc uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 06/11] mk: Add rule for installing sdk files
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (4 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 05/11] mk: Add rule for installing documentation Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 07/11] mk: Add rule for installing runtime files Mario Carrillo
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK makefiles, scripts,
examples, tools, config files and headers,
when invoking "make install-sdk" makefiles, scripts,
examples and config files will be installed in:
$(DESTDIR)/$(sdkdir)
and headers will be installed in:
$(DESTDIR)/$(includedir)
where sdkdir=$(datadir)
datadir=$(datarootdir)/dpdk
datarootdir=$(prefix)/share
includedir=$(prefix)/include/dpdk
prefix=/usr/local by default, you can override "prefix", "sdkdir",
"datadir",
"datarootdir" and "includedir" vars.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 19 +++++++++++++++++++
 mk/rte.sdkroot.mk    |  5 +++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index e5e319d..6ed5e34 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -49,6 +49,8 @@ bindir ?= $(exec_prefix)/bin
 libdir ?= $(exec_prefix)/lib
 datarootdir ?= $(prefix)/share
 docdir ?= $(datarootdir)/doc/dpdk
+datadir ?= $(datarootdir)/dpdk
+sdkdir ?= $(datadir)
 HSLINKS := $(shell find  $(RTE_OUTPUT)/include/ -name *.h)
 BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
 NIC_FILES := $(wildcard $(RTE_SDK)/tools/*.py)
@@ -170,6 +172,23 @@ install-doc:
 	done \
 	fi
 #
+# install sdk files in /usr/local/share/dpdk by default
+# where prefix and "sdkdir", "datadir" and "prefix" var can be overridden.
+#
+.PHONY: install-sdk
+install-sdk: install-headers
+	@echo ================== Installing sdk files
+	@[ -d $(DESTDIR)/$(sdkdir) ] || mkdir -p $(DESTDIR)/$(sdkdir); \
+	cp -rf $(RTE_SDK)/mk $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/mk; \
+	cp -rf $(RTE_SDK)/scripts $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/scripts; \
+	cp -rf $(RTE_SDK)/examples $(DESTDIR)/$(sdkdir); \
+	echo installing: $(RTE_SDK)/examples;
+	@[ -d $(DESTDIR)/$(sdkdir)/config ] || mkdir -p $(DESTDIR)/$(sdkdir)/config; \
+	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
+	echo installing: $(RTE_OUTPUT)/.config
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index f56341d..6fac88a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,8 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc uninstall
-install install-headers install-bin install-lib install-mod install-doc uninstall:
+install-doc install-sdk uninstall
+install install-headers install-bin install-lib install-mod install-doc \
+install-sdk uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 07/11] mk: Add rule for installing runtime files
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (5 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 06/11] mk: Add rule for installing sdk files Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 08/11] app: Change name to test binary Mario Carrillo
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Add hierarchy-file support to the DPDK libraries, modules,
binary files, nic bind file, cpu layout file (tools) and documentation,
when invoking "make install-fhs" (filesystem hierarchy standard)
runtime files will be by default installed in:
$(DESTDIR)/$(bindir) where bindir=$(exec_prefix)/bin (binary files)
$(DESTDIR)/$(docdir) where docdir=$(datarootdir)/doc/dpdk
(documentation)
$(DESTDIR)/$(libdir) where libdir=$(exec_prefix)/lib (libraries)
$(DESTDIR)/$(kerneldir) (modules)
if RTE_EXEC_ENV=linuxapp then
kerneldir=/lib/modules/$(uname -r)/extra/drivers/dpdk
else kerneldir=/boot/modules
exec_prefix=$(prefix)
datarootdir=$(prefix)/share
and prefix=/usr/local
All directory variables mentioned above can be overridden.
This hierarchy is based on:
http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
and variables are based on:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 9 +++++++++
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 6ed5e34..a67eba6 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -189,6 +189,15 @@ install-sdk: install-headers
 	cp -f $(RTE_SDK)/build/.config $(DESTDIR)/$(sdkdir)/config; \
 	echo installing: $(RTE_OUTPUT)/.config
 #
+# install runtime files
+#
+.PHONY: install-fhs
+install-fhs: install-lib install-bin install-doc install-mod
+	@echo ================== Installing runtime files
+	@[ -d $(DESTDIR)/$(datadir) ] || mkdir -p $(DESTDIR)/$(datadir); \
+	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
+	echo installing: $(RTE_SDK)/tools
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 6fac88a..dd5f399 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -98,9 +98,9 @@ testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
 .PHONY: install install-headers install-bin install-lib install-mod \
-install-doc install-sdk uninstall
+install-doc install-sdk install-fhs uninstall
 install install-headers install-bin install-lib install-mod install-doc \
-install-sdk uninstall:
+install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 08/11] app: Change name to test binary
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (6 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 07/11] mk: Add rule for installing runtime files Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

This is order to test could be installed in a file herarchy and do not
make a colision with test command in coreutils.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 app/test/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index ec33e1a..184f91b 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -36,7 +36,7 @@ ifeq ($(CONFIG_RTE_APP_TEST),y)
 #
 # library name
 #
-APP = test
+APP = test-dpdk
 
 #
 # all sources are stored in SRCS-y
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 09/11] mk: Rename install rule as mbuild rule
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (7 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 08/11] app: Change name to test binary Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 10/11] mk: Add new install rule Mario Carrillo
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

"install" rule with the current dpdk behaviour change its name by
mbuild.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 8 ++++----
 mk/rte.sdkroot.mk    | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index a67eba6..1ba7bc0 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -73,13 +73,13 @@ endif
 #
 INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
 	$(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
+INSTALL_TARGETS := $(addsuffix _mbuild,\
 	$(filter-out %~,$(INSTALL_CONFIGS)))
 
-.PHONY: install
-install: $(INSTALL_TARGETS)
+.PHONY: mbuild
+mbuild: $(INSTALL_TARGETS)
 
-%_install:
+%_mbuild:
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index dd5f399..1b619b7 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-install install-headers install-bin install-lib install-mod install-doc \
+mbuild install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 10/11] mk: Add new install rule
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (8 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 11/11] doc: Add information about new installation rules Mario Carrillo
  2015-12-04 15:38   ` [dpdk-dev] [PATCH v9 00/11] Add installation rules for dpdk files Thomas Monjalon
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

If "T" variable is defined, the installation process will have the
current behaviour, else install rule will be called.

Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 mk/rte.sdkinstall.mk | 12 +++++++++++-
 mk/rte.sdkroot.mk    |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 1ba7bc0..2989528 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -40,7 +40,6 @@ endif
 # target name or a name containing jokers "*". Example:
 # x86_64-native-*-gcc
 ifndef T
-T=*
 ifneq (,$(wildcard $(RTE_OUTPUT)/.config))
 prefix ?= /usr/local
 exec_prefix ?= $(prefix)
@@ -198,6 +197,17 @@ install-fhs: install-lib install-bin install-doc install-mod
 	cp -rf $(RTE_SDK)/tools $(DESTDIR)/$(datadir); \
 	echo installing: $(RTE_SDK)/tools
 #
+# if "T" var is defined, mbuild rule will be called, else
+# install-fhs rule will be called.
+#
+.PHONY: install
+install:
+ifdef T
+install: mbuild
+else
+install: install-fhs
+endif
+#
 # uninstall: remove all built sdk
 #
 UNINSTALL_TARGETS := $(addsuffix _uninstall,\
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 1b619b7..2f8f64a 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -97,9 +97,9 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: mbuild install-headers install-bin install-lib install-mod \
+.PHONY: mbuild install install-headers install-bin install-lib install-mod \
 install-doc install-sdk install-fhs uninstall
-mbuild install-headers install-bin install-lib install-mod install-doc \
+mbuild install install-headers install-bin install-lib install-mod install-doc \
 install-sdk install-fhs uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
-- 
2.6.3

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

* [dpdk-dev] [PATCH v9 11/11] doc: Add information about new installation rules
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (9 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 10/11] mk: Add new install rule Mario Carrillo
@ 2015-12-03 21:37   ` Mario Carrillo
  2015-12-04 15:38   ` [dpdk-dev] [PATCH v9 00/11] Add installation rules for dpdk files Thomas Monjalon
  11 siblings, 0 replies; 150+ messages in thread
From: Mario Carrillo @ 2015-12-03 21:37 UTC (permalink / raw)
  To: dev; +Cc: jos.c.venegas.munoz

Information about variables and rules behaviour is added to
documentation.

Suggested-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
---
 doc/build-sdk-quick.txt               | 23 +++++++++++++-
 doc/guides/freebsd_gsg/build_dpdk.rst | 60 +++++++++++++++++++++++++++++++++++
 doc/guides/linux_gsg/build_dpdk.rst   | 60 +++++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+), 1 deletion(-)

diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index bf18b48..228b938 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -5,10 +5,19 @@ 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
+	install          if T is defined, build a target and install in DESTDIR else call install-fhs target
 	uninstall        remove all installed targets
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
+Install commands
+	install          if T is defined, build a target and install in DESTDIR else call install-fhs target
+	install-headers  install headers files
+	install-bin      install app files a dpdk tools
+	install-lib      install libraries
+	install-doc      install documentation
+	install-mod      install modules
+	install-sdk      install headers, makefiles, scripts, examples, tools and config files
+	install-fhs      install libraries, modules, app files, tools and documentation
 Build variables
 	EXTRA_CPPFLAGS   preprocessor options
 	EXTRA_CFLAGS     compiler options
@@ -23,3 +32,15 @@ Build variables
 	T         target template (install default: *) - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
+Install variables
+	prefix          /usr/local by default it can be overridden
+	exec_prefix     $(prefix)
+	bindir          $(exec_prefix)/bin by default it can be overridden
+	includedir      $(prefix)/include by default it can be overridden
+	libdir          $(exec_prefix)/lib by default it can be overridden
+	docdir          $(datarootdir)/share/doc/dpdk by default it can be overridden
+	sdkdir          $(datadir)
+	datadir         $(datarootdir)/dpdk
+	datarootdir     $(prefix)/share
+	kerneldir       /lib/modules/$(uname -r)/extra/drivers/dpdk is for linux and
+			/boot/modules for BSD by default, they can be overridden
diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst
index 8eff599..84c495a 100644
--- a/doc/guides/freebsd_gsg/build_dpdk.rst
+++ b/doc/guides/freebsd_gsg/build_dpdk.rst
@@ -136,6 +136,66 @@ The DPDK is composed of several directories:
 
 *   config, tools, scripts, mk: Framework-related makefiles, scripts and configuration
 
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+It is possible to configure, build and install specific groups of DPDK files
+into a file hierarchy using the following install commands and variables:
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
+* ``install``
+
+  If ``T`` is not defined make will call ``install-fhs``.
+
+* ``install-headers``
+
+  Install headers files into ``includedir`` which is defined as
+  ``$(prefix)/include/dpdk``.
+
+* ``install-bin``
+
+  Install app files and dpdk tools into ``bindir`` which is defined as
+  ``$(exec_prefix)/bin``.
+
+* ``install-lib``
+
+  Install libraries into ``libdir`` which is defined as
+  ``$(exec_prefix)/lib``.
+
+* ``install-doc``
+
+  Install documentation into ``docdir`` which is defined as
+  ``$(datarootdir)/doc/dpdk``.
+
+* ``install-mod``
+
+  Install modules into ``kerneldir``. If ``RTE_EXEC_ENV`` is ``linuxapp`` then
+  ``kerneldir`` is ``/lib/modules/$(uname -r)/extra/drivers/dpdk`` otherwise
+  ``/boot/modules``.
+
+* ``install-sdk``
+
+  Install headers, makefiles, scripts, examples and config files into
+  ``sdkdir`` which is defined as ``$(datarootdir)/dpdk``.
+
+* ``install-fhs``
+
+  Install libraries, modules, app files, tools and documentation.
+
+The following defaults apply::
+
+   prefix=/usr/local
+   exec_prefix=$(prefix)
+   datarootdir=$(prefix)/share
+
+All path variables can be overridden and all targets can use the ``DESTDIR``
+variable.
+
 Installation of the DPDK Target Environments
 --------------------------------------------
 
diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst
index 2680e66..34a49b9 100644
--- a/doc/guides/linux_gsg/build_dpdk.rst
+++ b/doc/guides/linux_gsg/build_dpdk.rst
@@ -152,6 +152,66 @@ The user may also make modifications to the compile-time DPDK configuration by e
 
 In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
 
+Build and install DPDK using a file hierarchy
+---------------------------------------------
+
+It is possible to configure, build and install specific groups of DPDK files
+into a file hierarchy using the following install commands and variables:
+
+.. code-block:: console
+
+	make config T=<config template>
+	make
+	make <install target>
+
+* ``install``
+
+  If ``T`` is not defined make will call ``install-fhs``.
+
+* ``install-headers``
+
+  Install headers files into ``includedir`` which is defined as
+  ``$(prefix)/include/dpdk``.
+
+* ``install-bin``
+
+  Install app files and dpdk tools into ``bindir`` which is defined as
+  ``$(exec_prefix)/bin``.
+
+* ``install-lib``
+
+  Install libraries into ``libdir`` which is defined as
+  ``$(exec_prefix)/lib``.
+
+* ``install-doc``
+
+  Install documentation into ``docdir`` which is defined as
+  ``$(datarootdir)/doc/dpdk``.
+
+* ``install-mod``
+
+  Install modules into ``kerneldir``. If ``RTE_EXEC_ENV`` is ``linuxapp`` then
+  ``kerneldir`` is ``/lib/modules/$(uname -r)/extra/drivers/dpdk`` otherwise
+  ``/boot/modules``.
+
+* ``install-sdk``
+
+  Install headers, makefiles, scripts, examples and config files into
+  ``sdkdir`` which is defined as ``$(datarootdir)/dpdk``.
+
+* ``install-fhs``
+
+  Install libraries, modules, app files, tools and documentation.
+
+The following defaults apply::
+
+   prefix=/usr/local
+   exec_prefix=$(prefix)
+   datarootdir=$(prefix)/share
+
+All path variables can be overridden and all targets can use the ``DESTDIR``
+variable.
+
 Browsing the Installed DPDK Environment Target
 ----------------------------------------------
 
-- 
2.6.3

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

* Re: [dpdk-dev] [PATCH v9 00/11] Add installation rules for dpdk files.
  2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
                     ` (10 preceding siblings ...)
  2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 11/11] doc: Add information about new installation rules Mario Carrillo
@ 2015-12-04 15:38   ` Thomas Monjalon
  11 siblings, 0 replies; 150+ messages in thread
From: Thomas Monjalon @ 2015-12-04 15:38 UTC (permalink / raw)
  To: Mario Carrillo; +Cc: dev, jos.c.venegas.munoz

Hi Mario,

2015-12-03 15:37, Mario Carrillo:
> DPDK package lacks of a mechanism to install libraries, headers
> applications, kernel modules and sdk files to a file system tree.
> This patch set allows to install files based on the next
> proposal:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html

I think we should change the patchwork status of this series
because I do not see the benefit compared to my newer series:
http://dpdk.org/ml/archives/dev/2015-December/029416.html

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

end of thread, other threads:[~2015-12-04 15:40 UTC | newest]

Thread overview: 150+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 20:33 [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Mario Carrillo
2015-09-18 20:33 ` [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support Mario Carrillo
2015-09-18 20:33 ` [dpdk-dev] [PATCH 2/7] mk: Add hierarchy-file support (sbin) Mario Carrillo
2015-09-18 20:33 ` [dpdk-dev] [PATCH 3/7] mk: Add hierarchy-file support (doc) Mario Carrillo
2015-09-18 20:33 ` [dpdk-dev] [PATCH 4/7] mk: Add hierarchy-file support (app) Mario Carrillo
2015-09-18 20:33 ` [dpdk-dev] [PATCH 5/7] mk: Add hierarchy-file support (include) Mario Carrillo
2015-09-22  8:03   ` Panu Matilainen
2015-09-18 20:33 ` [dpdk-dev] [PATCH 6/7] mk: Add hierarchy-file support (lib) Mario Carrillo
2015-09-22  7:46   ` Panu Matilainen
2015-09-18 20:33 ` [dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod) Mario Carrillo
2015-09-22  6:56   ` Panu Matilainen
2015-11-27 15:40     ` Thomas Monjalon
2015-11-27 16:01       ` Ferruh Yigit
2015-11-27 16:20         ` David Marchand
2015-11-27 16:23           ` Bruce Richardson
2015-11-27 16:48             ` Ferruh Yigit
2015-11-27 21:05         ` Arevalo, Mario Alfredo C
2015-09-22  6:29 ` [dpdk-dev] [PATCH 0/7] Add hierarchical support to make install Panu Matilainen
2015-09-22  8:00   ` Olivier MATZ
2015-09-22  8:34     ` Panu Matilainen
2015-09-22  9:00       ` Olivier MATZ
2015-09-22 10:14         ` Panu Matilainen
2015-09-22 10:36           ` Panu Matilainen
2015-09-22 14:40           ` Olivier MATZ
2015-09-23 14:54             ` Arevalo, Mario Alfredo C
2015-09-22 10:39         ` Neil Horman
2015-09-22  8:16 ` Olivier MATZ
2015-09-29  0:00 ` [dpdk-dev] [PATCH v2 0/8] Add instalation rules for dpdk files Mario Carrillo
2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 1/8] mk: Add rule for installing headers Mario Carrillo
2015-09-29  8:49     ` Panu Matilainen
2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 2/8] mk: Add rule for installing app files Mario Carrillo
2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries Mario Carrillo
2015-09-29  9:28     ` Panu Matilainen
2015-09-29  0:00   ` [dpdk-dev] [PATCH v2 4/8] mk: Add rule for installing modules Mario Carrillo
2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 5/8] mk: Add rule for installing documentation Mario Carrillo
2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 6/8] mk: Add rule for installing nic bind files Mario Carrillo
2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 7/8] mk: Add rule for installing sdk files Mario Carrillo
2015-09-29  0:01   ` [dpdk-dev] [PATCH v2 8/8] mk: Add rule for installing runtime files Mario Carrillo
2015-10-01  0:11 ` [dpdk-dev] [PATCH v3 0/8] Add instalation rules for dpdk files Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 1/8] mk: Add rule for installing headers Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 2/8] mk: Add rule for installing app files Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 3/8] mk: Add rule for installing libraries Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 4/8] mk: Add rule for installing modules Mario Carrillo
2015-10-02 10:38     ` Panu Matilainen
2015-10-02 16:26       ` Arevalo, Mario Alfredo C
2015-10-05  7:13         ` Panu Matilainen
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 5/8] mk: Add rule for installing documentation Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 6/8] mk: Add rule for installing nic bind files Mario Carrillo
2015-10-02 10:49     ` Panu Matilainen
2015-10-02 10:54       ` Richardson, Bruce
2015-10-02 16:27         ` Arevalo, Mario Alfredo C
2015-11-27 15:52         ` Thomas Monjalon
2015-11-27 16:10           ` Bruce Richardson
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 7/8] mk: Add rule for installing sdk files Mario Carrillo
2015-10-01  0:11   ` [dpdk-dev] [PATCH v3 8/8] mk: Add rule for installing runtime files Mario Carrillo
2015-10-02 11:15     ` Panu Matilainen
2015-10-02 11:25       ` Bruce Richardson
2015-10-02 16:29       ` Arevalo, Mario Alfredo C
2015-10-12  9:28       ` Jan Blunck
2015-10-05 20:19 ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Mario Carrillo
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 1/7] mk: Add rule for installing headers Mario Carrillo
2015-10-16 19:29     ` Olivier MATZ
2015-10-19 23:35       ` Arevalo, Mario Alfredo C
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 2/7] mk: Add rule for installing app files Mario Carrillo
2015-10-16 19:30     ` Olivier MATZ
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 3/7] mk: Add rule for installing libraries Mario Carrillo
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 4/7] mk: Add rule for installing modules Mario Carrillo
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 5/7] mk: Add rule for installing documentation Mario Carrillo
2015-10-16 19:30     ` Olivier MATZ
2015-10-19 23:36       ` Arevalo, Mario Alfredo C
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 6/7] mk: Add rule for installing sdk files Mario Carrillo
2015-10-16 19:31     ` Olivier MATZ
2015-10-19 14:00       ` Panu Matilainen
2015-10-05 20:20   ` [dpdk-dev] [PATCH v4 7/7] mk: Add rule for installing runtime files Mario Carrillo
2015-10-10 17:45   ` [dpdk-dev] [PATCH v4 0/7] Add instalation rules for dpdk files Arevalo, Mario Alfredo C
2015-10-15 12:32     ` Panu Matilainen
2015-10-14 15:58   ` Miguel Bernal Marin
2015-10-16 19:32   ` Olivier MATZ
2015-10-30  1:47 ` [dpdk-dev] [PATCH v5 00/10] " Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 01/10] mk: Add rule for installing headers Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 02/10] mk: Add rule for installing app files Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 03/10] mk: Add rule for installing libraries Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 04/10] mk: Add rule for installing modules Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 05/10] mk: Add rule for installing documentation Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 06/10] mk: Add rule for installing sdk files Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 07/10] mk: Add rule for installing runtime files Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 09/10] mk: Add new install rule Mario Carrillo
2015-10-30  1:47   ` [dpdk-dev] [PATCH v5 10/10] doc: Add information about new installation rules Mario Carrillo
2015-11-10 17:07 ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 01/10] mk: Add rule for installing headers Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 02/10] mk: Add rule for installing app files Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 03/10] mk: Add rule for installing libraries Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 04/10] mk: Add rule for installing modules Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 05/10] mk: Add rule for installing documentation Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 06/10] mk: Add rule for installing sdk files Mario Carrillo
2015-11-30 16:20     ` Thomas Monjalon
2015-11-30 16:26       ` Arevalo, Mario Alfredo C
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 07/10] mk: Add rule for installing runtime files Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 08/10] mk: Rename install rule as mbuild rule Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 09/10] mk: Add new install rule Mario Carrillo
2015-11-10 17:07   ` [dpdk-dev] [PATCH v6 10/10] doc: Add information about new installation rules Mario Carrillo
2015-11-10 17:18   ` [dpdk-dev] [PATCH v6 00/10] Add installation rules for dpdk files Aaron Conole
2015-11-10 23:25     ` Arevalo, Mario Alfredo C
2015-11-11 10:48       ` Bruce Richardson
2015-11-11 17:43         ` Arevalo, Mario Alfredo C
2015-12-01  0:53 ` [dpdk-dev] [PATCH v7 00/11] " Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 01/11] mk: Add rule for installing headers Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 02/11] mk: Add rule for installing app files Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 03/11] mk: Add rule for installing libraries Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 04/11] mk: Add rule for installing modules Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 05/11] mk: Add rule for installing documentation Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 06/11] mk: Add rule for installing sdk files Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 07/11] mk: Add rule for installing runtime files Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 08/11] app: Change name to test binary Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 10/11] mk: Add new install rule Mario Carrillo
2015-12-01  0:53   ` [dpdk-dev] [PATCH v7 11/11] doc: Add information about new installation rules Mario Carrillo
2015-12-01 11:11     ` Mcnamara, John
2015-12-01 12:08     ` Mcnamara, John
2015-12-01 13:36       ` Arevalo, Mario Alfredo C
2015-12-01 19:17   ` [dpdk-dev] [PATCH v7 00/11] Add installation rules for dpdk files Thomas Monjalon
2015-12-01 19:36     ` Arevalo, Mario Alfredo C
2015-12-01 19:39 ` [dpdk-dev] [PATCH v8 " Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 01/11] mk: Add rule for installing headers Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 02/11] mk: Add rule for installing app files Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 03/11] mk: Add rule for installing libraries Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 04/11] mk: Add rule for installing modules Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 05/11] mk: Add rule for installing documentation Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 06/11] mk: Add rule for installing sdk files Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 07/11] mk: Add rule for installing runtime files Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 08/11] app: Change name to test binary Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 10/11] mk: Add new install rule Mario Carrillo
2015-12-01 19:39   ` [dpdk-dev] [PATCH v8 11/11] doc: Add information about new installation rules Mario Carrillo
2015-12-02  9:33   ` [dpdk-dev] [PATCH v8 00/11] Add installation rules for dpdk files Panu Matilainen
2015-12-02 23:04     ` Arevalo, Mario Alfredo C
2015-12-03 21:37 ` [dpdk-dev] [PATCH v9 " Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 01/11] mk: Add rule for installing headers Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 02/11] mk: Add rule for installing app files Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 03/11] mk: Add rule for installing libraries Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 04/11] mk: Add rule for installing modules Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 05/11] mk: Add rule for installing documentation Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 06/11] mk: Add rule for installing sdk files Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 07/11] mk: Add rule for installing runtime files Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 08/11] app: Change name to test binary Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 09/11] mk: Rename install rule as mbuild rule Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 10/11] mk: Add new install rule Mario Carrillo
2015-12-03 21:37   ` [dpdk-dev] [PATCH v9 11/11] doc: Add information about new installation rules Mario Carrillo
2015-12-04 15:38   ` [dpdk-dev] [PATCH v9 00/11] Add installation rules for dpdk files 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).