1#########################################################################
2# COMMON COMPILATION FLAGS                                              #
3#########################################################################
4CFLAGS          := -Wall -Wbad-function-cast -Wcast-align \
5		   -Werror-implicit-function-declaration -Wextra \
6		   -Wfloat-equal -Wformat-nonliteral -Wformat-security \
7		   -Wformat=2 -Winit-self -Wmissing-declarations \
8		   -Wmissing-format-attribute -Wmissing-include-dirs \
9		   -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs \
10		   -Wpointer-arith -Wshadow -Wstrict-prototypes \
11		   -Wswitch-default \
12		   -Wwrite-strings
13ifeq ($(CFG_WERROR),y)
14CFLAGS		+= -Werror
15endif
16CFLAGS          += -c -fPIC
17
18DEBUG       ?= 0
19ifeq ($(DEBUG), 1)
20CFLAGS          += -DDEBUG -O0 -g
21endif
22
23RM              := rm -rf
24
25define rmdir
26if [ -d "$(1)" ] ; then rmdir --ignore-fail-on-non-empty $(1) ; fi
27endef
28