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