From patchwork Wed Oct 4 13:26:02 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: 9984721 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 6C40660365 for ; Wed, 4 Oct 2017 13:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D13228405 for ; Wed, 4 Oct 2017 13:26:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 521D928AF9; Wed, 4 Oct 2017 13:26:20 +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 DD68128961 for ; Wed, 4 Oct 2017 13:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbdJDN0T (ORCPT ); Wed, 4 Oct 2017 09:26:19 -0400 Received: from arcturus.kleine-koenig.org ([78.47.169.190]:54539 "EHLO arcturus.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbdJDN0O (ORCPT ); Wed, 4 Oct 2017 09:26:14 -0400 Received: by arcturus.kleine-koenig.org (Postfix, from userid 1000) id D740B1C26A3; Wed, 4 Oct 2017 15:26:12 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-sparse@vger.kernel.org Subject: [PATCH 3/6] build: drop BASIC_CFLAGS and ALL_CFLAGS Date: Wed, 4 Oct 2017 15:26:02 +0200 Message-Id: <20171004132605.24734-4-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 There is no good reason to not use plain CFLAGS for all usages. This simplifies understanding the Makefile for the casual reader. Signed-off-by: Uwe Kleine-König --- Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ddb4c5e3de02..069dae6c8fdb 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,6 @@ PKG_CONFIG = pkg-config CHECKER = ./cgcc -no-compile CHECKER_FLAGS = -ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS) - HAVE_LIBXML:=$(shell $(PKG_CONFIG) --exists libxml-2.0 2>/dev/null && echo 'yes') HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \ $(CC) -c -Wp,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \ @@ -39,13 +37,13 @@ LLVM_CONFIG:=llvm-config HAVE_LLVM:=$(shell $(LLVM_CONFIG) --version >/dev/null 2>&1 && echo 'yes') GCC_BASE := $(shell $(CC) --print-file-name=) -BASIC_CFLAGS = -DGCC_BASE=\"$(GCC_BASE)\" +CFLAGS += -DGCC_BASE=\"$(GCC_BASE)\" MULTIARCH_TRIPLET := $(shell $(CC) -print-multiarch 2>/dev/null) -BASIC_CFLAGS += -DMULTIARCH_TRIPLET=\"$(MULTIARCH_TRIPLET)\" +CFLAGS += -DMULTIARCH_TRIPLET=\"$(MULTIARCH_TRIPLET)\" ifeq ($(HAVE_GCC_DEP),yes) -BASIC_CFLAGS += -Wp,-MD,$(@D)/.$(@F).d +CFLAGS += -Wp,-MD,$(@D)/.$(@F).d endif DESTDIR= @@ -96,7 +94,7 @@ LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) PROGRAMS += $(LLVM_PROGS) INST_PROGRAMS += sparse-llvm sparsec -sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS) +sparse-llvm.o: CFLAGS += $(LLVM_CFLAGS) sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS) else $(warning LLVM 3.0 or later required. Your system has version $(LLVM_VERSION) installed.) @@ -122,7 +120,7 @@ LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \ LIB_FILE= libsparse.a SLIB_FILE= libsparse.so -# If you add $(SLIB_FILE) to this, you also need to add -fpic to BASIC_CFLAGS above. +# If you add $(SLIB_FILE) to this, you also need to add -fpic to CFLAGS above. # Doing so incurs a noticeable performance hit, and Sparse does not have a # stable shared library interface, so this does not occur by default. If you # really want a shared library, you may want to build Sparse twice: once @@ -212,10 +210,10 @@ c2xml.o c2xml.sc: CFLAGS += $(LIBXML_CFLAGS) pre-process.sc: CHECKER_FLAGS += -Wno-vla %.o: %.c $(LIB_H) - $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< + $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $< %.sc: %.c sparse - $(QUIET_CHECK) $(CHECKER) $(CHECKER_FLAGS) -c $(ALL_CFLAGS) $< + $(QUIET_CHECK) $(CHECKER) $(CHECKER_FLAGS) -c $(CFLAGS) $< ALL_OBJS := $(LIB_OBJS) $(foreach p,$(PROGRAMS),$(p).o $($(p)_EXTRA_DEPS)) selfcheck: $(ALL_OBJS:.o=.sc)