@@ -479,7 +479,11 @@ all::
479
479
#
480
480
# Define DEVELOPER to enable more compiler warnings. Compiler version
481
481
# and family are auto detected, but could be overridden by defining
482
- # COMPILER_FEATURES (see config.mak.dev)
482
+ # COMPILER_FEATURES (see config.mak.dev). You can still set
483
+ # CFLAGS="..." in combination with DEVELOPER enables, whether that's
484
+ # for tweaking something unrelated (e.g. optimization level), or for
485
+ # selectively overriding something DEVELOPER or one of the DEVOPTS
486
+ # (see just below) brings in.
483
487
#
484
488
# When DEVELOPER is set, DEVOPTS can be used to control compiler
485
489
# options. This variable contains keywords separated by
@@ -506,17 +510,8 @@ GIT-VERSION-FILE: FORCE
506
510
@$(SHELL_PATH ) ./GIT-VERSION-GEN
507
511
-include GIT-VERSION-FILE
508
512
509
- # CFLAGS and LDFLAGS are for the users to override from the command line.
510
-
511
- CFLAGS = -g -O2 -Wall
512
- LDFLAGS =
513
- ALL_CFLAGS = $(CPPFLAGS ) $(CFLAGS )
514
- ALL_LDFLAGS = $(LDFLAGS )
515
- STRIP ?= strip
516
-
517
- # Create as necessary, replace existing, make ranlib unneeded.
518
- ARFLAGS = rcs
519
-
513
+ # Set our default configuration.
514
+ #
520
515
# Among the variables below, these:
521
516
# gitexecdir
522
517
# template_dir
@@ -561,6 +556,7 @@ perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))
561
556
562
557
export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
563
558
559
+ # Set our default programs
564
560
CC = cc
565
561
AR = ar
566
562
RM = rm -f
@@ -573,29 +569,14 @@ TCLTK_PATH = wish
573
569
XGETTEXT = xgettext
574
570
MSGFMT = msgfmt
575
571
CURL_CONFIG = curl-config
576
- PTHREAD_LIBS = -lpthread
577
- PTHREAD_CFLAGS =
578
572
GCOV = gcov
573
+ STRIP = strip
579
574
SPATCH = spatch
580
575
581
576
export TCL_PATH TCLTK_PATH
582
577
583
- # user customisation variable for 'sparse' target
584
- SPARSE_FLAGS ?=
585
- # internal/platform customisation variable for 'sparse'
586
- SP_EXTRA_FLAGS =
587
-
588
- SPATCH_FLAGS = --all-includes --patch .
589
-
590
-
591
-
592
- # ## --- END CONFIGURATION SECTION ---
593
-
594
- # Those must not be GNU-specific; they are shared with perl/ which may
595
- # be built by a different compiler. (Note that this is an artifact now
596
- # but it still might be nice to keep that distinction.)
597
- BASIC_CFLAGS = -I.
598
- BASIC_LDFLAGS =
578
+ # Set our default LIBS variables
579
+ PTHREAD_LIBS = -lpthread
599
580
600
581
# Guard against environment variables
601
582
BUILTIN_OBJS =
@@ -1177,6 +1158,25 @@ ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/s
1177
1158
DC_SHA1_SUBMODULE = auto
1178
1159
endif
1179
1160
1161
+ # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
1162
+ # tweaked by config.* below as well as the command-line, both of
1163
+ # which'll override these defaults.
1164
+ CFLAGS = -g -O2 -Wall
1165
+ LDFLAGS =
1166
+ BASIC_CFLAGS = -I.
1167
+ BASIC_LDFLAGS =
1168
+
1169
+ # library flags
1170
+ ARFLAGS = rcs
1171
+ PTHREAD_CFLAGS =
1172
+
1173
+ # For the 'sparse' target
1174
+ SPARSE_FLAGS ?=
1175
+ SP_EXTRA_FLAGS =
1176
+
1177
+ # For the 'coccicheck' target
1178
+ SPATCH_FLAGS = --all-includes --patch .
1179
+
1180
1180
include config.mak.uname
1181
1181
-include config.mak.autogen
1182
1182
-include config.mak
@@ -1185,6 +1185,9 @@ ifdef DEVELOPER
1185
1185
include config.mak.dev
1186
1186
endif
1187
1187
1188
+ ALL_CFLAGS = $(DEVELOPER_CFLAGS ) $(CPPFLAGS ) $(CFLAGS )
1189
+ ALL_LDFLAGS = $(LDFLAGS )
1190
+
1188
1191
comma := ,
1189
1192
empty :=
1190
1193
space := $(empty ) $(empty )
0 commit comments