diff options
Diffstat (limited to 'Rules.mak')
-rw-r--r-- | Rules.mak | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -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. |
77 | INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include | 77 | INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include |
78 | CFLAGS=$(INCS) -I$(srcdir) | 78 | CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE |
79 | CFLAGS+=$(CHECKED_CFLAGS) | 79 | CFLAGS+=$(CHECKED_CFLAGS) |
80 | ARFLAGS=cru | 80 | ARFLAGS=cru |
81 | 81 | ||
82 | # Warnings | 82 | # Warnings |
83 | 83 | ||
84 | CFLAGS+=-Wall -Wstrict-prototypes -Wshadow | 84 | CFLAGS += -Wall -Wstrict-prototypes -Wshadow |
85 | LDFLAGS += $(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,) |
184 | endif # gcc-4.1 and beyond | 185 | endif # gcc-4.1 and beyond |
185 | endif | 186 | endif |
186 | OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,) | 187 | OPTIMIZATION+=$(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 |
209 | endif | 210 | endif |
211 | |||
212 | # Debugging info | ||
213 | |||
210 | ifeq ($(strip $(CONFIG_DEBUG)),y) | 214 | ifeq ($(strip $(CONFIG_DEBUG)),y) |
211 | CFLAGS +=-g -D_GNU_SOURCE | 215 | CFLAGS +=-g |
212 | LDFLAGS += $(call check_ld,--warn-common,) | ||
213 | else | 216 | else |
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,) |
217 | endif | 219 | endif |
220 | |||
221 | ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y) | ||
222 | else | ||
223 | CFLAGS += $(OPTIMIZATION) | ||
224 | endif | ||
225 | |||
218 | # warn a bit more verbosely for non-release versions | 226 | # warn a bit more verbosely for non-release versions |
219 | ifneq ($(EXTRAVERSION),) | 227 | ifneq ($(EXTRAVERSION),) |
220 | CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) | 228 | CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) |