proxmark3/Makefile.defs

106 lines
3.3 KiB
Text
Raw Normal View History

2019-08-31 04:10:06 +08:00
# Hide full compilation line:
ifneq ($(V),1)
Q?=@
endif
# To see full command lines, use make V=1
# been here
DEFSBEENHERE = true
CP = cp -a
GZIP = gzip
MKDIR = mkdir -p
RM = rm -f
RMDIR = rm -rf
2019-08-31 04:29:01 +08:00
# rmdir only if dir is empty, tolerate failure
RMDIR_SOFT = -rmdir
2019-08-31 04:10:06 +08:00
MV = mv
TOUCH = touch
FALSE = false
TAR = tar
TARFLAGS ?= -v --ignore-failed-read -r
TARFLAGS += -C .. -f
CROSS ?= arm-none-eabi-
CC = gcc
CXX = g++
LD = g++
2020-05-21 00:12:41 +08:00
SH = sh
BASH = bash
2020-05-21 00:12:41 +08:00
PERL = perl
2019-08-31 04:10:06 +08:00
PATHSEP=/
PREFIX ?= /usr/local
UDEV_PREFIX ?= /etc/udev/rules.d
INSTALLBINRELPATH ?= bin
INSTALLSHARERELPATH ?= share/proxmark3
INSTALLFWRELPATH ?= share/proxmark3/firmware
INSTALLTOOLSRELPATH ?= share/proxmark3/tools
INSTALLDOCSRELPATH ?= share/doc/proxmark3
2019-08-31 04:10:06 +08:00
platform = $(shell uname)
DETECTED_OS=$(platform)
ifeq ($(platform),Darwin)
AR= /usr/bin/ar rcs
RANLIB= /usr/bin/ranlib
else
AR= ar rcs
RANLIB= ranlib
endif
2020-08-20 03:38:21 +08:00
DEFCXXFLAGS = -Wall -Werror -O3 -pipe
DEFCFLAGS = -Wall -Werror -O3 -fstrict-aliasing -pipe
2020-10-06 20:56:26 +08:00
DEFLDFLAGS =
# Some more warnings we want as errors:
2020-05-12 04:15:32 +08:00
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
# Some more warnings we need first to eliminate, so temporarely tolerated:
2020-05-09 21:06:28 +08:00
DEFCFLAGS += -Wcast-align -Wno-error=cast-align
2020-05-12 05:46:26 +08:00
DEFCFLAGS += -Wswitch-enum -Wno-error=switch-enum
2020-05-09 21:06:28 +08:00
2020-05-12 07:49:01 +08:00
ifeq ($(platform),Darwin)
# their readline has strict-prototype issues
DEFCFLAGS += -Wno-strict-prototypes
else
DEFCFLAGS += -Wstrict-prototypes
endif
2020-05-09 21:06:28 +08:00
# Next ones are activated only if GCCEXTRA=1 or CLANGEXTRA=1
EXTRACFLAGS =
EXTRACFLAGS += -Wunused-parameter -Wno-error=unused-parameter
EXTRACFLAGS += -Wsign-compare -Wno-error=sign-compare
2020-05-20 19:28:37 +08:00
EXTRACFLAGS += -Wconversion -Wno-error=conversion -Wno-error=sign-conversion -Wno-error=float-conversion
2020-05-09 21:06:28 +08:00
# unknown to clang or old gcc:
# First we activate Wextra then we explicitly list those we know about
2020-05-09 22:12:54 +08:00
# Those without -Wno-error are supposed to be completely solved
2020-05-09 21:06:28 +08:00
GCCEXTRACFLAGS = -Wextra
GCCEXTRACFLAGS += -Wclobbered -Wno-error=clobbered
2020-05-09 22:12:54 +08:00
GCCEXTRACFLAGS += -Wcast-function-type
2020-05-09 21:06:28 +08:00
GCCEXTRACFLAGS += -Wimplicit-fallthrough=3 -Wno-error=implicit-fallthrough
2020-05-09 22:12:54 +08:00
GCCEXTRACFLAGS += -Wmissing-parameter-type
2020-05-09 21:06:28 +08:00
GCCEXTRACFLAGS += -Wold-style-declaration -Wno-error=old-style-declaration
2020-05-09 22:12:54 +08:00
GCCEXTRACFLAGS += -Woverride-init
GCCEXTRACFLAGS += -Wshift-negative-value
2020-05-09 21:06:28 +08:00
GCCEXTRACFLAGS += -Wunused-but-set-parameter -Wno-error=unused-but-set-parameter
ifeq ($(GCCEXTRA),1)
DEFCFLAGS += $(GCCEXTRACFLAGS) $(EXTRACFLAGS)
endif
# unknown to gcc or old clang:
# First we activate Wextra then we explicitly list those we know about
2020-05-09 22:12:54 +08:00
# Those without -Wno-error are supposed to be completely solved
2020-05-09 21:06:28 +08:00
CLANGEXTRACFLAGS = -Wextra
CLANGEXTRACFLAGS += -Wtautological-type-limit-compare
CLANGEXTRACFLAGS += -Wnull-pointer-arithmetic
CLANGEXTRACFLAGS += -Woverride-init
CLANGEXTRACFLAGS += -Wshift-negative-value
CLANGEXTRACFLAGS += -Wimplicit-fallthrough
ifeq ($(CLANGEXTRA),1)
DEFCFLAGS += $(CLANGEXTRACFLAGS) $(EXTRACFLAGS)
endif
2020-05-12 07:49:01 +08:00
ifeq ($(CLANGEVERYTHING),1)
DEFCFLAGS += -Weverything -Wno-error
endif
ifeq ($(NOERROR),1)
DEFCFLAGS += -Wno-error
endif