/[baselayout]/trunk/src/Makefile
Gentoo

Diff of /trunk/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2560 Revision 2561
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3 3
4CC ?= gcc 4CC ?= gcc
5 5
6CFLAGS ?= -Wall -O2 -pipe 6CFLAGS ?= -Wall -O2 -pipe
7
8# Saying that, this function only works with GNU Make :/
9check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
10 then echo "$(1)"; else echo "$(2)"; fi)
11
12# Luckily we can do this more long winded thing with pmake used by the BSDs
13# FIXME: Look into making this into a loop
14WAFTST != if $(CC) -Wextra -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
15 then echo "-Wdeclaration-after-statement"; fi
16WSEQ != if $(CC) -Wextra -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
17 then echo "-Wsequence-point"; fi
18WEXTRA != if $(CC) -Wextra -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
19 then echo "-Wextra"; fi
20
21# Loads of nice flags to ensure our code is good
7CFLAGS += -pedantic -std=c99 \ 22CFLAGS += -pedantic -std=c99 \
8 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ 23 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
9 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \ 24 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
10 -Wbad-function-cast -Wnested-externs -Wcomment -Winline \ 25 -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
11 -Wchar-subscripts -Wcast-align -Wno-format-nonliteral 26 -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
12 27 $(call check_gcc, -Wdeclaration-after-statement) \
13# Early GCC versions don't support these flags, so you may need to comment 28 $(call check_gcc, -Wsequence-point) \
14# this line out 29 $(call check_gcc, -Wextra) $(WAFTST) $(WSEQ) $(WEXTRA)
15CFLAGS += -Wsequence-point -Wextra -Wdeclaration-after-statement
16 30
17# For debugging. -Werror is pointless due to ISO C issues with dlsym 31# For debugging. -Werror is pointless due to ISO C issues with dlsym
18#CFLAGS += -ggdb 32#CFLAGS += -ggdb
19 33
20DESTDIR = 34DESTDIR =

Legend:
Removed from v.2560  
changed lines
  Added in v.2561

  ViewVC Help
Powered by ViewVC 1.1.20