aboutsummaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak22
1 files changed, 15 insertions, 7 deletions
diff --git a/Rules.mak b/Rules.mak
index 605cce3c2..53dd6a857 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -75,13 +75,14 @@ CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
75 75
76# This must bind late because srcdir is reset for every source subdirectory. 76# This must bind late because srcdir is reset for every source subdirectory.
77INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include 77INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include
78CFLAGS=$(INCS) -I$(srcdir) 78CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE
79CFLAGS+=$(CHECKED_CFLAGS) 79CFLAGS+=$(CHECKED_CFLAGS)
80ARFLAGS=cru 80ARFLAGS=cru
81 81
82# Warnings 82# Warnings
83 83
84CFLAGS+=-Wall -Wstrict-prototypes -Wshadow 84CFLAGS += -Wall -Wstrict-prototypes -Wshadow
85LDFLAGS += $(call check_ld,--warn-common,)
85 86
86# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest 87# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest
87# get the CC MAJOR/MINOR version 88# get the CC MAJOR/MINOR version
@@ -183,7 +184,7 @@ ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
183 OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,) 184 OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,)
184endif # gcc-4.1 and beyond 185endif # gcc-4.1 and beyond
185endif 186endif
186OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,) 187OPTIMIZATION+=$(call check_gcc,-fomit-frame-pointer,)
187 188
188# 189#
189#-------------------------------------------------------- 190#--------------------------------------------------------
@@ -207,14 +208,21 @@ else
207 LIBRARIES:=-lefence 208 LIBRARIES:=-lefence
208 endif 209 endif
209endif 210endif
211
212# Debugging info
213
210ifeq ($(strip $(CONFIG_DEBUG)),y) 214ifeq ($(strip $(CONFIG_DEBUG)),y)
211 CFLAGS +=-g -D_GNU_SOURCE 215 CFLAGS +=-g
212 LDFLAGS += $(call check_ld,--warn-common,)
213else 216else
214 CFLAGS+=$(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG 217 CFLAGS +=-DNDEBUG
215 LDFLAGS += $(call check_ld,--warn-common,)
216 LDFLAGS += $(call check_ld,--sort-common,) 218 LDFLAGS += $(call check_ld,--sort-common,)
217endif 219endif
220
221ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y)
222else
223 CFLAGS += $(OPTIMIZATION)
224endif
225
218# warn a bit more verbosely for non-release versions 226# warn a bit more verbosely for non-release versions
219ifneq ($(EXTRAVERSION),) 227ifneq ($(EXTRAVERSION),)
220 CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) 228 CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,)