1 # Hide full compilation line:
5 # To see full command lines, use make V=1
15 # rmdir only if dir is empty, tolerate failure
21 TARFLAGS ?= -v --ignore-failed-read -r
23 CROSS ?= arm-none-eabi-
30 UDEV_PREFIX ?= /etc/udev/rules.d
31 INSTALLBINRELPATH ?= bin
32 INSTALLSHARERELPATH ?= share/proxmark3
33 INSTALLFWRELPATH ?= share/proxmark3/firmware
34 INSTALLTOOLSRELPATH ?= share/proxmark3/tools
35 INSTALLDOCSRELPATH ?= share/doc/proxmark3
37 platform = $(shell uname)
38 DETECTED_OS=$(platform)
40 ifeq ($(platform),Darwin)
42 RANLIB= /usr/bin/ranlib
48 DEFCFLAGS = -Wall -Werror -O3
49 # Some more warnings we want as errors:
50 DEFCFLAGS += -Wcast-align -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
51 # Some more warnings we need first to eliminate, so temporarely tolerated:
52 DEFCFLAGS += -Wno-error=cast-align
54 #DEFCFLAGS += -Wunused-parameter -Wold-style-declaration -Wsign-compare -Wimplicit-fallthrough=3 -Wtype-limits -Wmissing-field-initializers -Wunused-but-set-parameter -Wswitch-enum -Wold-style-definition
55 #DEFCFLAGS += -Wno-error=unused-parameter -Wno-error=old-style-declaration -Wno-error=sign-compare -Wno-error=implicit-fallthrough -Wno-error=type-limits -Wno-error=missing-field-initializers -Wno-error=unused-but-set-parameter -Wno-error=switch-enum -Wno-error=old-style-definition
56 # unknown to clang: -Wclobbered -Wmissing-parameter-type -Wcast-function-type
57 # unknown to clang < 8: -Woverride-init
58 # unknown to gcc < 6: -Wshift-negative-value
60 ifeq ($(platform),Darwin)
61 # their readline has strict-prototype issues
62 DEFCFLAGS += -Wstrict-prototypes -Wno-error=strict-prototypes
64 DEFCFLAGS += -Wstrict-prototypes