From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbbCKAIi (ORCPT ); Tue, 10 Mar 2015 20:08:38 -0400 Received: from resqmta-po-08v.sys.comcast.net ([96.114.154.167]:57243 "EHLO resqmta-po-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbbCKAIg (ORCPT ); Tue, 10 Mar 2015 20:08:36 -0400 From: Shuah Khan To: gorcunov@openvz.org, akpm@linux-foundation.org, tranmanphong@gmail.com, mpe@ellerman.id.au Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH v2] selftests: kcmp build fails when invoked from kselftest target Date: Tue, 10 Mar 2015 18:08:32 -0600 Message-Id: <1426032512-10353-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v2: Added deleted pre-requisite back in to address review comments. tools/testing/selftests/kcmp/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index ff0eefd..d615e9c 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile @@ -1,8 +1,11 @@ CC := $(CROSS_COMPILE)$(CC) -CFLAGS += -I../../../../usr/include/ +CFLAGS += -I../../../../include/uapi -I../../../../usr/include/ all: kcmp_test +kcmp_test: + $(CC) $(CFLAGS) kcmp_test.c -o kcmp_test + run_tests: all @./kcmp_test || echo "kcmp_test: [FAIL]" -- 2.1.0