madtty only need to control colors, let the caller deal with ncurses.
[apps/madtty.git] / am / cflags.mk
1 ifneq (,$(filter gcc%,$(CC)))
2     _gccversion:=$(shell $(CC) -dumpversion)
3     _gccmachine:=$(shell $(CC) -dumpmachine)
4     _cobjs := .objs-$(_gccmachine:-linux-gnu=)-$(_gccversion)
5
6     CFLAGS += -ggdb3
7     # Use pipes and not temp files.
8     CFLAGS += -pipe
9     # optimize even more
10     CFLAGS += -O2
11     # let the type char be unsigned by default
12     CFLAGS += -funsigned-char
13     CFLAGS += -fstrict-aliasing
14     # turn on all common warnings
15     CFLAGS += -Wall
16     # turn on extra warnings
17     CFLAGS += $(if $(filter 4.%,$(GCCVERSION)),-W,-Wextra)
18     # treat warnings as errors
19     CFLAGS += -Werror
20     CFLAGS += -Wchar-subscripts
21     # warn about undefined preprocessor identifiers
22     CFLAGS += -Wundef
23     # warn about local variable shadowing another local variable
24     CFLAGS += -Wshadow
25     # warn about casting of pointers to increased alignment requirements
26     CFLAGS += -Wcast-align
27     # make string constants const
28     CFLAGS += -Wwrite-strings
29     # warn about implicit conversions with side effects
30     # fgets, calloc and friends take an int, not size_t...
31     #CFLAGS += -Wconversion
32     # warn about comparisons between signed and unsigned values
33     CFLAGS += -Wsign-compare
34     # warn about unused declared stuff
35     CFLAGS += -Wunused
36     # don not warn about unused return value
37     CFLAGS += -Wno-unused-value
38     # warn about variable use before initialization
39     CFLAGS += -Wuninitialized
40     # warn about pointer arithmetic on void* and function pointers
41     CFLAGS += -Wpointer-arith
42     # warn about multiple declarations
43     CFLAGS += -Wredundant-decls
44     # warn if the format string is not a string literal
45     CFLAGS += -Wformat-nonliteral
46     # do not warn about strftime format with y2k issues
47     CFLAGS += -Wno-format-y2k
48
49     CFLAGS += -I$(DEPTH)
50 else
51     CFLAGS += -Wall
52     _cobjs := .objs
53 endif
54
55 LDFLAGS += -Wl,--warn-common