From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] kni: fixed compilation error on Ubuntu 14.04 LTS (kernel 3.13.0-30.54) Date: Fri, 01 Aug 2014 15:15:54 +0200 Message-ID: <2889487.riKpfTWg1F@xps13> References: <1406212131-22314-1-git-send-email-pablo.de.lara.guarch@intel.com> <2585103.SGNXcBzLTL@xps13> <8BBE948C60307D47AD16B5B5B92A387E32E1A2B4@IRSMSX106.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Buriez, Patrice" Return-path: In-Reply-To: <8BBE948C60307D47AD16B5B5B92A387E32E1A2B4-kPTMFJFq+rFT4JjzTwqWc7fspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-07-24 16:31, Buriez, Patrice: > > Why not this simpler form? > > $(shell lsb_release -si 2>/dev/null) > > I didn't want "make" to stop on error or to display a warning if lsb_release is not available on other distributions. > I must admit that I focused on identifying the exact 5-tuple UBUNTU_KERNEL_CODE that was triggering the compilation error. > Then I tried to keep the Makefile as simple and readable as possible, and took no shortcut. > If your simpler form works the same, then indeed it's nicer than mine. ;-) > > > > +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(shell lsb_release -sr)) > > > > Or you can use | tr -d . instead of subst and keep the flow from left to right. > > Agreed. I seldom use tr and didn't figure out that it would perfectly fit here. Thanks! > > > > +UBUNTU_KERNEL_CODE := $(shell cut -d' ' -f2 /proc/version_signature |cut -d- -f1,2) > > ^ > > space missing here > > I usually pipe into the next command with no space in between. So that's somewhat on purpose. > Is your comment cosmetic or about readability? > Or are there situations that would fail, unless the space is provided between the pipe and the command? Yes, only cosmetic. > > > +UBUNTU_KERNEL_CODE := $(subst -,$(comma),$(UBUNTU_KERNEL_CODE)) > > > +UBUNTU_KERNEL_CODE := $(subst .,$(comma),$(UBUNTU_KERNEL_CODE)) > > > > Would be simpler with | tr -d .- > > Agreed again (with the $(comma) from your next email, and without the -d in order to actually translate, not delete. ;-) Yes "tr .- $(comma)" :) > Again, I mainly focused on extracting and transmitting the 5-tuple UBUNTU_KERNEL_CODE from shell to compiler. > I agree this can be rewritten in nicer ways, but it works, and hopefully does not break compilation on other distributions. Acked and applied with above modifications. Thanks -- Thomas