[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
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 at dpdk.org] on behalf of Ferruh Yigit [ferruh.yi...@intel.com] Sent: Friday, November 27, 2015 8:01 AM To: Thomas Monjalon Cc: dev at 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
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
On Fri, Nov 27, 2015 at 5:01 PM, Ferruh Yigit 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
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
On Fri, Nov 27, 2015 at 04:23:07PM +, 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 > > 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
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
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.
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
On Fri, Nov 27, 2015 at 05:20:43PM +0100, David Marchand wrote: > On Fri, Nov 27, 2015 at 5:01 PM, Ferruh Yigit > 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
[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
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
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 > --- > 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 -
[dpdk-dev] [PATCH 7/7] mk: Add hierarchy-file support (linux mod)
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 --- 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