From patchwork Mon Jul 17 14:41:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 9845347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30B536037F for ; Mon, 17 Jul 2017 14:41:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 232FE27FB3 for ; Mon, 17 Jul 2017 14:41:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17EFE2853A; Mon, 17 Jul 2017 14:41:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 370F527FB3 for ; Mon, 17 Jul 2017 14:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbdGQOlr (ORCPT ); Mon, 17 Jul 2017 10:41:47 -0400 Received: from avasout06.plus.net ([212.159.14.18]:56491 "EHLO avasout06.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdGQOlr (ORCPT ); Mon, 17 Jul 2017 10:41:47 -0400 Received: from [10.0.2.15] ([143.159.212.52]) by avasout06 with smtp id lqhk1v00918PUFB01qhlRY; Mon, 17 Jul 2017 15:41:45 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=GetnpUfL c=1 sm=1 tr=0 a=CKmocqUIrzA4K3l9YJ19NQ==:117 a=CKmocqUIrzA4K3l9YJ19NQ==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=yy1Zq78Sl084cVRyvugA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 To: Christopher Li Cc: Sparse Mailing-list From: Ramsay Jones Subject: [PATCH] Makefile: suppress pkg-config output from make Message-ID: <8a9ee6b0-93e6-86fa-c572-8c74cc4be597@ramsayjones.plus.com> Date: Mon, 17 Jul 2017 15:41:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-GB Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 2a4b245052 ("Makefile: clean up and simplify", 15-07-2017), moved a PKG_CONFIG invocation from command scope to a top-level make variable setting. For users who don't have libxml installed, this results in pkg-config issuing warning messages on _each_ invocation of make: $ make ... Package libxml-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found ... $ In order to suppress the message, move the LIBXML_CFLAGS make variable setting into the $(HAVE_LIBXML) conditional. Signed-off-by: Ramsay Jones --- Hi Christopher, I like the 'selfcheck' (dog-fooding) target - many years ago I had patches to make sparse run clean on itself (both Linux and Cygwin). I didn't get around to getting all of them upstream. I just tried a selfcheck on cygwin and Linux and neither were clean. ;-) ATB, Ramsay Jones Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ae81586..4214e17 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,7 @@ ifeq ($(HAVE_LIBXML),yes) PROGRAMS+=c2xml INST_PROGRAMS+=c2xml c2xml_EXTRA_OBJS = `$(PKG_CONFIG) --libs libxml-2.0` +LIBXML_CFLAGS := $(shell $(PKG_CONFIG) --cflags libxml-2.0) else $(warning Your system does not have libxml, disabling c2xml) endif @@ -194,7 +195,6 @@ ifneq ($(DEP_FILES),) include $(DEP_FILES) endif -LIBXML_CFLAGS := $(shell $(PKG_CONFIG) --cflags libxml-2.0) c2xml.o c2xml.sc: CFLAGS += $(LIBXML_CFLAGS) %.o: %.c $(LIB_H)