From patchwork Mon Sep 17 21:40:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1469881 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 71C803FCFC for ; Mon, 17 Sep 2012 21:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593Ab2IQVkJ (ORCPT ); Mon, 17 Sep 2012 17:40:09 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:64811 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755343Ab2IQVkI (ORCPT ); Mon, 17 Sep 2012 17:40:08 -0400 Received: by wgbdr13 with SMTP id dr13so6203909wgb.1 for ; Mon, 17 Sep 2012 14:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=etOnJukupF9YHvktcXCn1i/2gznDmqhGDc7AvDXu1SY=; b=WZctQ2PqgWonSzygT+mVoa35eHutm/e8bBi/xwUC+MugL5HublsiqUa2UkeoSmItR3 rIPk+UOI1UGYOXz3SVSYpKSHEbaqgQyAAJL8xTNijcL+HRiBVx7IrIRi9YPOQzHnTYdC CDQ5vTQNGGiN9hMI1jucJwukuACzPdVK7+11GVEAxA2CAd21Oi13ghWtjLfEzodqQaI8 ZP+ZM7/DQseWAFupYI7EdBLyiVVPcSg0oVdfWczbiWxPi7omGFnNmOdCo4HAATZfaEtK AbTn1Ki/z3g7me9RZ8rqdQKpM5mftTG0F07naYnRz4tfyAxpCFQQ8LKwuw5F3UwRGqWP WlBg== Received: by 10.180.93.8 with SMTP id cq8mr18629701wib.16.1347918006631; Mon, 17 Sep 2012 14:40:06 -0700 (PDT) Received: from localhost.localdomain ([37.46.33.122]) by mx.google.com with ESMTPS id fr4sm28234735wib.8.2012.09.17.14.40.03 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 14:40:04 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH] kvm tools: support build-time checks Date: Mon, 17 Sep 2012 23:40:23 +0200 Message-Id: <1347918023-31683-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Support using build-time check tools when building lkvm. This allows using tools such as smatch with the same syntax used with kernel code. For example, to build with smatch checks, first make sure you have smatch installed, then run: make CHECK="smatch -p=kernel" C=1 Signed-off-by: Sasha Levin --- tools/kvm/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index d4b5eb3..e0d07dc 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -322,18 +322,34 @@ $(OBJS): # This rule relaxes the -Werror on libfdt, since for now it still has # a bunch of warnings. :( ../../scripts/dtc/libfdt/%.o: ../../scripts/dtc/libfdt/%.c +ifeq ($(C),1) + $(E) " CHECK " $@ + $(Q) $(CHECK) -c $(CFLAGS_EASYGOING) $< -o $@ +endif $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS_EASYGOING) $< -o $@ util/rbtree.static.o util/rbtree.o: ../../lib/rbtree.c +ifeq ($(C),1) + $(E) " CHECK " $@ + $(Q) $(CHECK) -c $(CFLAGS) $< -o $@ +endif $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) $< -o $@ %.static.o: %.c +ifeq ($(C),1) + $(E) " CHECK " $@ + $(Q) $(CHECK) -c $(CFLAGS) $(CFLAGS_STATOPT) $< -o $@ +endif $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) $(CFLAGS_STATOPT) $< -o $@ %.o: %.c +ifeq ($(C),1) + $(E) " CHECK " $@ + $(Q) $(CHECK) -c $(CFLAGS) $(CFLAGS_DYNOPT) $< -o $@ +endif $(E) " CC " $@ $(Q) $(CC) -c $(CFLAGS) $(CFLAGS_DYNOPT) $< -o $@