git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Thomas Gummerer" <t.gummerer@gmail.com>,
	"Beat Bolli" <dev+git@drbeat.li>,
	"Lars Schneider" <larsxschneider@gmail.com>,
	"Matthieu Moy" <Matthieu.Moy@imag.fr>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 5/6] Makefile: move the setting of *FLAGS closer to "include"
Date: Fri, 22 Feb 2019 15:41:26 +0100	[thread overview]
Message-ID: <20190222144127.32248-6-avarab@gmail.com> (raw)
In-Reply-To: <20190222105658.26831-1-avarab@gmail.com>

Move the setting of variables like CFLAGS down past settings like
"prefix" and default programs like "TAR" to just before we do the
include from "config.mak.*".

There's no functional changes here yet, but move note that
"ALL_CFLAGS" and "ALL_LDFLAGS" are moved below the include. A
follow-up change will tweak those depending on a variable set in
config.mak.dev.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 59674ce9d7..82cfd6c2e4 100644
--- a/Makefile
+++ b/Makefile
@@ -506,13 +506,6 @@ GIT-VERSION-FILE: FORCE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
 
-# CFLAGS and LDFLAGS are for the users to override from the command line.
-CFLAGS = -g -O2 -Wall
-LDFLAGS =
-ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
-ALL_LDFLAGS = $(LDFLAGS)
-ARFLAGS = rcs
-
 # Set our default configuration.
 #
 # Among the variables below, these:
@@ -572,7 +565,6 @@ TCLTK_PATH = wish
 XGETTEXT = xgettext
 MSGFMT = msgfmt
 CURL_CONFIG = curl-config
-PTHREAD_CFLAGS =
 GCOV = gcov
 STRIP = strip
 SPATCH = spatch
@@ -582,16 +574,6 @@ export TCL_PATH TCLTK_PATH
 # Set our default LIBS variables
 PTHREAD_LIBS = -lpthread
 
-# user customisation variable for 'sparse' target
-SPARSE_FLAGS ?=
-# internal/platform customisation variable for 'sparse'
-SP_EXTRA_FLAGS =
-
-SPATCH_FLAGS = --all-includes --patch .
-
-BASIC_CFLAGS = -I.
-BASIC_LDFLAGS =
-
 # Guard against environment variables
 BUILTIN_OBJS =
 BUILT_INS =
@@ -1160,6 +1142,25 @@ ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/s
 DC_SHA1_SUBMODULE = auto
 endif
 
+# Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
+# tweaked by config.* below as well as the command-line, both of
+# which'll override these defaults.
+CFLAGS = -g -O2 -Wall
+LDFLAGS =
+BASIC_CFLAGS = -I.
+BASIC_LDFLAGS =
+
+# library flags
+ARFLAGS = rcs
+PTHREAD_CFLAGS =
+
+# For the 'sparse' target
+SPARSE_FLAGS ?=
+SP_EXTRA_FLAGS =
+
+# For the 'coccicheck' target
+SPATCH_FLAGS = --all-includes --patch .
+
 include config.mak.uname
 -include config.mak.autogen
 -include config.mak
@@ -1168,6 +1169,9 @@ ifdef DEVELOPER
 include config.mak.dev
 endif
 
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
+ALL_LDFLAGS = $(LDFLAGS)
+
 comma := ,
 empty :=
 space := $(empty) $(empty)
-- 
2.21.0.rc2.1.g2d5e20a900.dirty


  parent reply	other threads:[~2019-02-22 14:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 10:56 [PATCH] Makefile: remove an out-of-date comment Ævar Arnfjörð Bjarmason
2019-02-22 14:41 ` [PATCH v2 0/6] Makefile: allow for combining DEVELOPER= and CFLAGS="..." Ævar Arnfjörð Bjarmason
2019-02-22 15:16   ` Jeff King
2019-02-22 21:59     ` Ævar Arnfjörð Bjarmason
2019-02-23 13:22       ` Jeff King
2019-02-22 14:41 ` [PATCH v2 1/6] Makefile: remove an out-of-date comment Ævar Arnfjörð Bjarmason
2019-02-22 14:41 ` [PATCH v2 2/6] Makefile: move "strip" assignment down from flags Ævar Arnfjörð Bjarmason
2019-02-22 15:18   ` Jeff King
2019-02-22 21:58     ` Ramsay Jones
2019-02-23 13:23       ` Jeff King
2019-02-22 14:41 ` [PATCH v2 3/6] Makefile: add/remove comments at top and tweak whitespace Ævar Arnfjörð Bjarmason
2019-02-22 14:41 ` [PATCH v2 4/6] Makefile: Move *_LIBS assignment into its own section Ævar Arnfjörð Bjarmason
2019-02-22 15:21   ` Jeff King
2019-02-22 15:49   ` Eric Sunshine
2019-02-22 14:41 ` Ævar Arnfjörð Bjarmason [this message]
2019-02-22 23:19   ` [PATCH v2 5/6] Makefile: move the setting of *FLAGS closer to "include" Junio C Hamano
2019-02-22 14:41 ` [PATCH v2 6/6] Makefile: allow for combining DEVELOPER=1 and CFLAGS="..." Ævar Arnfjörð Bjarmason
2019-02-22 15:29   ` Jeff King
2019-02-22 23:23   ` Junio C Hamano
2019-02-22 15:09 ` [PATCH] Makefile: remove an out-of-date comment Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222144127.32248-6-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=t.gummerer@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).