/[baselayout]/trunk/src/Makefile
Gentoo

Diff of /trunk/src/Makefile

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

Revision 2567 Revision 2573
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 7
21# Loads of nice flags to ensure our code is good 8# Loads of nice flags to ensure our code is good
22CFLAGS += -pedantic -std=c99 \ 9CFLAGS += -pedantic -std=c99 \
23 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ 10 -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
24 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \ 11 -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
25 -Wbad-function-cast -Wnested-externs -Wcomment -Winline \ 12 -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
26 -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \ 13 -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
27 $(call check_gcc, -Wdeclaration-after-statement) \ 14 $(call check_gcc, -Wdeclaration-after-statement) \
28 $(call check_gcc, -Wsequence-point) \ 15 $(call check_gcc, -Wsequence-point) \
29 $(call check_gcc, -Wextra) $(WAFTST) $(WSEQ) $(WEXTRA) 16 $(call check_gcc, -Wextra)
30 17
31# For debugging. -Werror is pointless due to ISO C issues with dlsym 18# For debugging. -Werror is pointless due to ISO C issues with dlsym
32#CFLAGS += -ggdb 19#CFLAGS += -ggdb
33 20
34DESTDIR = 21DESTDIR =

Legend:
Removed from v.2567  
changed lines
  Added in v.2573

  ViewVC Help
Powered by ViewVC 1.1.20