From patchwork Wed Oct 4 13:26:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 9984727 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 7AD4060393 for ; Wed, 4 Oct 2017 13:26:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CB1E28405 for ; Wed, 4 Oct 2017 13:26:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61AE528961; Wed, 4 Oct 2017 13:26:21 +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 964D328958 for ; Wed, 4 Oct 2017 13:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473AbdJDN0S (ORCPT ); Wed, 4 Oct 2017 09:26:18 -0400 Received: from arcturus.kleine-koenig.org ([78.47.169.190]:54542 "EHLO arcturus.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997AbdJDN0R (ORCPT ); Wed, 4 Oct 2017 09:26:17 -0400 Received: by arcturus.kleine-koenig.org (Postfix, from userid 1000) id 4CA131C26A9; Wed, 4 Oct 2017 15:26:16 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-sparse@vger.kernel.org Subject: [PATCH 6/6] build: replace *_EXTRA_OBJS by local assignments to LDFLAGS and LOADLIBES Date: Wed, 4 Oct 2017 15:26:05 +0200 Message-Id: <20171004132605.24734-7-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171004132605.24734-1-uwe@kleine-koenig.org> References: <20171004132605.24734-1-uwe@kleine-koenig.org> MIME-Version: 1.0 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 This allows to drop the magic to handle *_EXTRA_OBJS. Signed-off-by: Uwe Kleine-König --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f6c577c02143..50e7b99b6107 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,8 @@ INST_MAN1=sparse.1 cgcc.1 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) +c2xml: LOADLIBES += $(shell $(PKG_CONFIG) --libs libxml-2.0) +c2xml: CFLAGS += $(shell $(PKG_CONFIG) --cflags libxml-2.0) else $(warning Your system does not have libxml, disabling c2xml) endif @@ -76,7 +76,7 @@ INST_PROGRAMS += test-inspect test-inspect_EXTRA_DEPS := ast-model.o ast-view.o ast-inspect.o test-inspect_OBJS := test-inspect.o $(test-inspect_EXTRA_DEPS) $(test-inspect_OBJS) $(test-inspect_OBJS:.o=.sc): CFLAGS += $(GTK_CFLAGS) -test-inspect_EXTRA_OBJS := $(GTK_LIBS) +test-inspect: LOADLIBES += $(GTK_LIBS) else $(warning Your system does not have gtk3/gtk2, disabling test-inspect) endif @@ -94,7 +94,8 @@ LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) PROGRAMS += $(LLVM_PROGS) INST_PROGRAMS += sparse-llvm sparsec sparse-llvm.o: CFLAGS += $(LLVM_CFLAGS) -sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS) +sparse-llvm: LDFLAGS += $(LLVM_LDFLAGS) +sparse-llvm: LOADLIBES += $(LLVM_LIBS) else $(warning LLVM 3.0 or later required. Your system has version $(LLVM_VERSION) installed.) endif @@ -190,7 +191,7 @@ compile_EXTRA_DEPS = compile-i386.o $(foreach p,$(PROGRAMS),$(eval $(p): $($(p)_EXTRA_DEPS) $(LIBS))) $(PROGRAMS): % : %.o - $(QUIET_LINK)$(LD) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@ $($@_EXTRA_OBJS) + $(QUIET_LINK)$(LD) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIB_FILE): $(LIB_OBJS) $(QUIET_AR)$(AR) rcs $@ $(LIB_OBJS)