From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753501AbbCJWlo (ORCPT ); Tue, 10 Mar 2015 18:41:44 -0400 Received: from lists.s-osg.org ([54.187.51.154]:54689 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753062AbbCJWll (ORCPT ); Tue, 10 Mar 2015 18:41:41 -0400 Message-ID: <54FF7323.2080603@osg.samsung.com> Date: Tue, 10 Mar 2015 16:41:39 -0600 From: Shuah Khan Organization: Samsung Open Source Group User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Cyrill Gorcunov CC: akpm@linux-foundation.org, tranmanphong@gmail.com, mpe@ellerman.id.au, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH 3/3] selftests: kcmp build fails when invoked from kselftest target References: <80f321919d8d1f804c4933acac9b044d4c6626eb.1426022048.git.shuahkh@osg.samsung.com> <20150310220954.GL30296@moon> In-Reply-To: <20150310220954.GL30296@moon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10/2015 04:09 PM, Cyrill Gorcunov wrote: > On Tue, Mar 10, 2015 at 04:00:59PM -0600, Shuah Khan wrote: >> kcmp Makefile doesn't have an explicit build rule. As a result, >> kcmp build fails, when it is run from top level Makefile target >> kselftest. Without the explicit rule, make works only when it is >> run in the current directory or from selftests directory. Add an >> explicit build rule to fix the problem. In addition, build fails >> as it can't find kcmp.h. Fix it by passing CFLAGS. >> >> Signed-off-by: Shuah Khan >> --- >> tools/testing/selftests/kcmp/Makefile | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile >> index ff0eefd..83383eb 100644 >> --- a/tools/testing/selftests/kcmp/Makefile >> +++ b/tools/testing/selftests/kcmp/Makefile >> @@ -1,7 +1,8 @@ >> CC := $(CROSS_COMPILE)$(CC) >> -CFLAGS += -I../../../../usr/include/ >> +CFLAGS += -I../../../../include/uapi -I../../../../usr/include/ >> >> -all: kcmp_test >> +all: >> + $(CC) $(CFLAGS) kcmp_test.c -o kcmp_test >> >> run_tests: all >> @./kcmp_test || echo "kcmp_test: [FAIL]" > > Ho Shuah! Thanks for looking into it. I've a small question -- > why kcmp_test prerequsite is dropped? As to me it should remain > here, except explicit build rule added. > Are you looking for something like this: all: kcmp_test kcmp_test: $(CC) $(CFLAGS) kcmp_test.c -o kcmp_test I just simplified it and removed the prerequsite. If you prefer, I can make the change to keep the prereq. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978