Release v4.9237 - Ice Coffee :coffee:
[RRG-proxmark3.git] / Makefile.defs
blob477743d69309352855347b3608bfd324714477b0
1 # Hide full compilation line:
2 ifneq ($(V),1)
3   Q?=@
4 endif
5 # To see full command lines, use make V=1
7 # been here
8 DEFSBEENHERE = true
10 CP = cp -a
11 GZIP = gzip
12 MKDIR = mkdir -p
13 RM = rm -f
14 RMDIR = rm -rf
15 # rmdir only if dir is empty, tolerate failure
16 RMDIR_SOFT = -rmdir
17 MV = mv
18 TOUCH = touch
19 FALSE = false
20 TAR = tar
21 TARFLAGS ?= -v --ignore-failed-read -r
22 TARFLAGS += -C .. -f
23 CROSS  ?= arm-none-eabi-
24 CC = gcc
25 CXX = g++
26 LD = g++
27 SH = sh
28 PERL = perl
30 PATHSEP=/
31 PREFIX ?=              /usr/local
32 UDEV_PREFIX ?=         /etc/udev/rules.d
33 INSTALLBINRELPATH ?=   bin
34 INSTALLSHARERELPATH ?= share/proxmark3
35 INSTALLFWRELPATH ?=    share/proxmark3/firmware
36 INSTALLTOOLSRELPATH ?= share/proxmark3/tools
37 INSTALLDOCSRELPATH ?=  share/doc/proxmark3
39 platform = $(shell uname)
40 DETECTED_OS=$(platform)
42 ifeq ($(platform),Darwin)
43     AR= /usr/bin/ar rcs
44     RANLIB= /usr/bin/ranlib
45 else
46     AR= ar rcs
47     RANLIB= ranlib
48 endif
50 DEFCFLAGS = -Wall -O3 -fstrict-aliasing -pipe
51 # Some more warnings we want as errors:
52 DEFCFLAGS += -Wbad-function-cast -Wredundant-decls -Wmissing-prototypes -Wchar-subscripts -Wshadow -Wundef -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wnested-externs -Wmissing-declarations -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wtype-limits -Wold-style-definition
53 # Some more warnings we need first to eliminate, so temporarely tolerated:
54 DEFCFLAGS += -Wcast-align -Wno-error=cast-align
55 DEFCFLAGS += -Wswitch-enum -Wno-error=switch-enum
57 ifeq ($(platform),Darwin)
58 # their readline has strict-prototype issues
59 DEFCFLAGS += -Wno-strict-prototypes
60 else
61 DEFCFLAGS += -Wstrict-prototypes
62 endif
64 # Next ones are activated only if GCCEXTRA=1 or CLANGEXTRA=1
65 EXTRACFLAGS =
66 EXTRACFLAGS += -Wunused-parameter -Wno-error=unused-parameter
67 EXTRACFLAGS += -Wsign-compare -Wno-error=sign-compare
68 EXTRACFLAGS += -Wconversion -Wno-error=conversion -Wno-error=sign-conversion -Wno-error=float-conversion
70 # unknown to clang or old gcc:
71 # First we activate Wextra then we explicitly list those we know about
72 # Those without -Wno-error are supposed to be completely solved
73 GCCEXTRACFLAGS = -Wextra
74 GCCEXTRACFLAGS += -Wclobbered -Wno-error=clobbered
75 GCCEXTRACFLAGS += -Wcast-function-type
76 GCCEXTRACFLAGS += -Wimplicit-fallthrough=3 -Wno-error=implicit-fallthrough
77 GCCEXTRACFLAGS += -Wmissing-parameter-type
78 GCCEXTRACFLAGS += -Wold-style-declaration -Wno-error=old-style-declaration
79 GCCEXTRACFLAGS += -Woverride-init
80 GCCEXTRACFLAGS += -Wshift-negative-value
81 GCCEXTRACFLAGS += -Wunused-but-set-parameter -Wno-error=unused-but-set-parameter
82 ifeq ($(GCCEXTRA),1)
83   DEFCFLAGS += $(GCCEXTRACFLAGS) $(EXTRACFLAGS)
84 endif
85 # unknown to gcc or old clang:
86 # First we activate Wextra then we explicitly list those we know about
87 # Those without -Wno-error are supposed to be completely solved
88 CLANGEXTRACFLAGS = -Wextra
89 CLANGEXTRACFLAGS += -Wtautological-type-limit-compare
90 CLANGEXTRACFLAGS += -Wnull-pointer-arithmetic
91 CLANGEXTRACFLAGS += -Woverride-init
92 CLANGEXTRACFLAGS += -Wshift-negative-value
93 CLANGEXTRACFLAGS += -Wimplicit-fallthrough
94 ifeq ($(CLANGEXTRA),1)
95   DEFCFLAGS += $(CLANGEXTRACFLAGS) $(EXTRACFLAGS)
96 endif
97 ifeq ($(CLANGEVERYTHING),1)
98   DEFCFLAGS += -Weverything -Wno-error
99 endif
100 ifeq ($(NOERROR),1)
101   DEFCFLAGS += -Wno-error
102 endif