From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 52256B370 for ; Fri, 1 Aug 2014 15:14:01 +0200 (CEST) Received: by mail-wg0-f49.google.com with SMTP id k14so4294639wgh.8 for ; Fri, 01 Aug 2014 06:16:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=96OvHT9v9KKzUuSEZi1ywhwzY1ySJRszJTHTxSBQFSk=; b=Fiw2uECAthzyB5ZS6KWqcDaVHJ4g6NJIu2fYnlNErX1RIVj1tZaDKL46CidZbnODxK 48EBg4mAhvURe4VpkhhOxgGpe1q3KBdN2AtdiQhEHJzGNInl4A6MR21dwfBaRQqAX8rq W92ezzp22GObt6H6QZErRhnUuh28US7IdtnSaLnPhQ4xTc2sNjNSMK823DDyY2Cxz5/Y OogPnHnGul3cbqATRMjryfyZAlvET/BGMkqA363EJsL9DCPmMoKYMQ71ZAu07S3au1Fz hj8QFW5lsOAba2I3beO99oVXL00B3fup3W5lVIFFuGZPo+1xMwrmoErv5ntGMsk4KjxR pbWw== X-Gm-Message-State: ALoCoQlL4BWg3wGbP8UnE+qFZFwQ1GYrPVMXYERWNRSbuDMtEQDjE8ybxkm0Ari5VMLy7BW+3TW8 X-Received: by 10.194.23.135 with SMTP id m7mr7934575wjf.2.1406898966210; Fri, 01 Aug 2014 06:16:06 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id w7sm8683669wiy.6.2014.08.01.06.16.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Aug 2014 06:16:05 -0700 (PDT) From: Thomas Monjalon To: "Buriez, Patrice" Date: Fri, 01 Aug 2014 15:15:54 +0200 Message-ID: <2889487.riKpfTWg1F@xps13> Organization: 6WIND User-Agent: KMail/4.13.3 (Linux/3.15.7-1-ARCH; KDE/4.13.3; x86_64; ; ) In-Reply-To: <8BBE948C60307D47AD16B5B5B92A387E32E1A2B4@IRSMSX106.ger.corp.intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] kni: fixed compilation error on Ubuntu 14.04 LTS (kernel 3.13.0-30.54) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 13:14:01 -0000 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