From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: "Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Josh Triplett" <josh@joshtriplett.org>,
"Jeff Layton" <jlayton@redhat.com>,
"Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>
Subject: [PATCH v3 03/37] build: drop BASIC_CFLAGS and ALL_CFLAGS
Date: Thu, 9 Nov 2017 07:46:14 +0100 [thread overview]
Message-ID: <20171109064648.15379-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20171109064648.15379-1-luc.vanoostenryck@gmail.com>
From: Uwe Kleine-König <uwe@kleine-koenig.org>
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 <uwe@kleine-koenig.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
Makefile | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index ddb4c5e3d..069dae6c8 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)
--
2.14.0
next prev parent reply other threads:[~2017-11-09 6:47 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 6:46 [PATCH v3 00/37] Makefile reorganization Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 01/37] build: make PREFIX overwritable from the environment Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 02/37] build: put comment about local.mk to the place where it is included Luc Van Oostenryck
2017-11-09 6:46 ` Luc Van Oostenryck [this message]
2017-11-09 6:46 ` [PATCH v3 04/37] build: drop -g from LDFLAGS Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 05/37] build: pass CPPFLAGS to compiler Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 06/37] build: fix effectiveness of generated dependencies Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 07/37] build: remove unused support for pkgconfig Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 08/37] build: use '_OBJS' instead of '_EXTRA_DEPS' Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 09/37] build: use '_LDLIBS' instead of '_EXTRA_OBJS' Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 10/37] build: allow target-specific CFLAGS, CPPFLAGS, LDFLAGS & LDLIBS Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 11/37] build: allow CFLAGS & friends from command line Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 12/37] build: avoid rule-specific CFLAGS Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 13/37] build: use $LIBS directly in the dependency list Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 14/37] build: no need to use wildcards for generated dependencies Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 15/37] build: reuse rule for ALL_OBJS Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 16/37] build: CHECKER_FLAGS=-Wno-vla for all targets Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 17/37] build: move tests near their use Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 18/37] build: only generate version.h when needed Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 19/37] build: add note about overwritable vars Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 20/37] build: remove references to unexisting pre-process.h Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 21/37] build: move clean & clean-check together Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 22/37] build: make clean targets quieter Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 23/37] build: remove rule for shared lib, it's unused Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 24/37] build: normalize rules Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 25/37] build: remove the dist rule since unused Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 26/37] build: use one line per item Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 27/37] build: use a dot file name instead of local.mk: .sparse.mk Luc Van Oostenryck
2017-11-09 14:56 ` Ramsay Jones
2017-11-09 15:18 ` Luc Van Oostenryck
2017-11-09 15:28 ` Ramsay Jones
2017-11-09 6:46 ` [PATCH v3 28/37] build: use standard rules for install Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 29/37] build: remove unused QUIET_INST_SH Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 30/37] build: let quiet commands use less indentation Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 31/37] build: simplify quiet commands Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 32/37] build: simplify clean pattern Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 33/37] build: add *.o to clean-check pattern Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 34/37] build: avoid foreach Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 35/37] build: reorg & add comment Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 36/37] build: use a single space before assignments Luc Van Oostenryck
2017-11-09 6:46 ` [PATCH v3 37/37] build: add rule to run a single test Luc Van Oostenryck
2017-11-09 19:11 ` [PATCH v3 00/37] Makefile reorganization Christopher Li
2017-11-09 20:54 ` Luc Van Oostenryck
2017-11-09 21:03 ` Christopher Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171109064648.15379-4-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=jlayton@redhat.com \
--cc=josh@joshtriplett.org \
--cc=linux-sparse@vger.kernel.org \
--cc=uwe@kleine-koenig.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).