mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
Makefile & CMake rework
This commit is contained in:
parent
9d97962759
commit
72acec5806
23 changed files with 467 additions and 291 deletions
524
client/Makefile
524
client/Makefile
|
@ -4,11 +4,6 @@
|
||||||
# the license.
|
# the license.
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
# reveng will compile without macros, but these may be useful:
|
|
||||||
# Add -DBMPMACRO to use bitmap size constant macros (edit config.h)
|
|
||||||
# Add -DNOFORCE to disable the -F switch
|
|
||||||
# Add -DPRESETS to compile with preset models (edit config.h)
|
|
||||||
|
|
||||||
# Must be called before any Makefile include
|
# Must be called before any Makefile include
|
||||||
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
ROOT_DIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
|
@ -22,44 +17,45 @@ vpath %.dic dictionaries
|
||||||
OBJDIR = obj
|
OBJDIR = obj
|
||||||
|
|
||||||
LDLIBS ?= -L/usr/local/lib
|
LDLIBS ?= -L/usr/local/lib
|
||||||
LDLIBS += -lreadline -lm
|
|
||||||
ifneq ($(SKIPPTHREAD),1)
|
ifeq ($(platform),Darwin)
|
||||||
LDLIBS += -lpthread
|
# cf brew info qt: qt not symlinked anymore
|
||||||
|
PKG_CONFIG_ENV := PKG_CONFIG_PATH=/usr/local/opt/qt/lib/pkgconfig
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# RPi Zero gcc requires -latomic
|
###################
|
||||||
# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
|
# local libraries #
|
||||||
# doesn't recognize option --as-needed
|
###################
|
||||||
ifneq ($(platform),Darwin)
|
|
||||||
LDLIBS += -Wl,--as-needed -latomic -Wl,--no-as-needed
|
|
||||||
endif
|
|
||||||
|
|
||||||
# local libraries
|
## Amiibo
|
||||||
LUALIBPATH = ./deps/liblua
|
|
||||||
LUALIBINC = -I$(LUALIBPATH)
|
|
||||||
LUALIB = $(LUALIBPATH)/liblua.a
|
|
||||||
JANSSONLIBPATH = ./deps/jansson
|
|
||||||
JANSSONLIBINC = -I$(JANSSONLIBPATH)
|
|
||||||
JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a
|
|
||||||
CBORLIBPATH = ./deps/tinycbor
|
|
||||||
CBORLIBINC = -I$(CBORLIBPATH)
|
|
||||||
CBORLIB = $(CBORLIBPATH)/tinycbor.a
|
|
||||||
REVENGLIBPATH = ./deps/reveng
|
|
||||||
REVENGLIBINC = -I$(REVENGLIBPATH)
|
|
||||||
REVENGLIB = $(REVENGLIBPATH)/libreveng.a
|
|
||||||
AMIIBOLIBPATH = ./deps/amiitool
|
AMIIBOLIBPATH = ./deps/amiitool
|
||||||
AMIIBOLIBINC = -I$(AMIIBOLIBPATH)
|
AMIIBOLIBINC = -I$(AMIIBOLIBPATH)
|
||||||
AMIIBOLIB = $(AMIIBOLIBPATH)/libamiibo.a
|
AMIIBOLIB = $(AMIIBOLIBPATH)/libamiibo.a
|
||||||
HARDNESTEDLIBPATH = ./deps/hardnested
|
|
||||||
HARDNESTEDLIBINC = -I$(HARDNESTEDLIBPATH)
|
## Tinycbor
|
||||||
HARDNESTEDLIB = $(HARDNESTEDLIBPATH)/libhardnested.a
|
CBORLIBPATH = ./deps/tinycbor
|
||||||
|
CBORLIBINC = -I$(CBORLIBPATH)
|
||||||
|
CBORLIB = $(CBORLIBPATH)/tinycbor.a
|
||||||
|
|
||||||
|
## Cliparser / Argtable3
|
||||||
CLIPARSERLIBPATH = ./deps/cliparser
|
CLIPARSERLIBPATH = ./deps/cliparser
|
||||||
CLIPARSERLIBINC = -I$(CLIPARSERLIBPATH)
|
CLIPARSERLIBINC = -I$(CLIPARSERLIBPATH)
|
||||||
CLIPARSERLIB = $(CLIPARSERLIBPATH)/libcliparser.a
|
CLIPARSERLIB = $(CLIPARSERLIBPATH)/libcliparser.a
|
||||||
WAILIBPATH = ./deps/whereami
|
|
||||||
WAILIBINC = -I$(WAILIBPATH)
|
|
||||||
WAILIB = $(WAILIBPATH)/libwhereami.a
|
|
||||||
|
|
||||||
|
## Hardnested
|
||||||
|
HARDNESTEDLIBPATH = ./deps/hardnested
|
||||||
|
HARDNESTEDLIBINC = -I$(HARDNESTEDLIBPATH)
|
||||||
|
HARDNESTEDLIB = $(HARDNESTEDLIBPATH)/libhardnested.a
|
||||||
|
|
||||||
|
## Jansson
|
||||||
|
JANSSONLIBPATH = ./deps/jansson
|
||||||
|
JANSSONLIBINC = -I$(JANSSONLIBPATH)
|
||||||
|
JANSSONLIB = $(JANSSONLIBPATH)/libjansson.a
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
LUALIBPATH = ./deps/liblua
|
||||||
|
LUALIBINC = -I$(LUALIBPATH)
|
||||||
|
LUALIB = $(LUALIBPATH)/liblua.a
|
||||||
LUAPLATFORM = generic
|
LUAPLATFORM = generic
|
||||||
ifneq (,$(findstring MINGW,$(platform)))
|
ifneq (,$(findstring MINGW,$(platform)))
|
||||||
LUAPLATFORM = mingw
|
LUAPLATFORM = mingw
|
||||||
|
@ -72,85 +68,195 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# common libraries
|
## Reveng
|
||||||
|
REVENGLIBPATH = ./deps/reveng
|
||||||
|
REVENGLIBINC = -I$(REVENGLIBPATH)
|
||||||
|
REVENGLIB = $(REVENGLIBPATH)/libreveng.a
|
||||||
|
|
||||||
|
## Whereami
|
||||||
|
WAILIBPATH = ./deps/whereami
|
||||||
|
WAILIBINC = -I$(WAILIBPATH)
|
||||||
|
WAILIB = $(WAILIBPATH)/libwhereami.a
|
||||||
|
|
||||||
|
##########################
|
||||||
|
# common local libraries #
|
||||||
|
##########################
|
||||||
|
|
||||||
|
## mbed TLS
|
||||||
MBEDTLSLIBPATH = ../common/mbedtls
|
MBEDTLSLIBPATH = ../common/mbedtls
|
||||||
|
MBEDTLSLIBINC = -I$(MBEDTLSLIBPATH)
|
||||||
MBEDTLSLIB = $(OBJDIR)/libmbedtls.a
|
MBEDTLSLIB = $(OBJDIR)/libmbedtls.a
|
||||||
|
|
||||||
|
## Zlib
|
||||||
ZLIBPATH = ../common/zlib
|
ZLIBPATH = ../common/zlib
|
||||||
|
ZLIBINC = -I$(ZLIBPATH)
|
||||||
ZLIB = $(OBJDIR)/libz.a
|
ZLIB = $(OBJDIR)/libz.a
|
||||||
|
|
||||||
# system libraries
|
########################################################
|
||||||
ifneq ($(SKIPLUASYSTEM),1)
|
# optional system libraries to replace local libraries #
|
||||||
LUAINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags lua5.2 2>/dev/null)
|
########################################################
|
||||||
LUALDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs lua5.2 2>/dev/null)
|
|
||||||
ifneq ($(LUALDLIBS),)
|
|
||||||
LUALIB = $(LUALDLIBS)
|
|
||||||
LUALIBINC = $(LUAINCLUDES)
|
|
||||||
LUASYSTEM = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
## Amiibo
|
||||||
|
# not distributed as system library
|
||||||
|
LDLIBS += $(AMIIBOLIB)
|
||||||
|
INCLUDES += $(AMIIBOLIBINC)
|
||||||
|
|
||||||
|
## Tinycbor
|
||||||
|
# not distributed as system library
|
||||||
|
LDLIBS += $(CBORLIB)
|
||||||
|
INCLUDES += $(CBORLIBINC)
|
||||||
|
|
||||||
|
## Cliparser / Argtable3
|
||||||
|
# not distributed as system library
|
||||||
|
LDLIBS += $(CLIPARSERLIB)
|
||||||
|
INCLUDES += $(CLIPARSERLIBINC)
|
||||||
|
|
||||||
|
## Hardnested
|
||||||
|
# not distributed as system library
|
||||||
|
LDLIBS += $(HARDNESTEDLIB)
|
||||||
|
INCLUDES += $(HARDNESTEDLIBINC)
|
||||||
|
|
||||||
|
## Jansson
|
||||||
ifneq ($(SKIPJANSSONSYSTEM),1)
|
ifneq ($(SKIPJANSSONSYSTEM),1)
|
||||||
JANSSONINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags jansson 2>/dev/null)
|
JANSSONINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags jansson 2>/dev/null)
|
||||||
JANSSONLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs jansson 2>/dev/null)
|
JANSSONLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs jansson 2>/dev/null)
|
||||||
ifneq ($(JANSSONLDLIBS),)
|
ifneq ($(JANSSONLDLIBS),)
|
||||||
JANSSONLIB = $(JANSSONLDLIBS)
|
JANSSONLIB = $(JANSSONLDLIBS)
|
||||||
JANSSONLIBINC = $(JANSSONINCLUDES)
|
JANSSONLIBINC = $(JANSSONINCLUDES)
|
||||||
JANSSONSYSTEM = 1
|
JANSSON_FOUND = 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
LDLIBS += $(JANSSONLIB)
|
||||||
|
INCLUDES += $(JANSSONLIBINC)
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
ifneq ($(SKIPLUASYSTEM),1)
|
||||||
|
LUAINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags lua5.2 2>/dev/null)
|
||||||
|
LUALDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs lua5.2 2>/dev/null)
|
||||||
|
ifneq ($(LUALDLIBS),)
|
||||||
|
LUALIB = $(LUALDLIBS)
|
||||||
|
LUALIBINC = $(LUAINCLUDES)
|
||||||
|
LUA_FOUND = 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
LDLIBS += $(LUALIB)
|
||||||
|
INCLUDES += $(LUALIBINC)
|
||||||
|
|
||||||
|
## mbed TLS
|
||||||
|
# system library cannot be used because it is compiled by default without CMAC support
|
||||||
|
LDLIBS +=$(MBEDTLSLIB)
|
||||||
|
INCLUDES += $(MBEDTLSLIBINC)
|
||||||
|
|
||||||
|
## Reveng
|
||||||
|
# not distributed as system library
|
||||||
|
LDLIBS += $(REVENGLIB)
|
||||||
|
INCLUDES += $(REVENGLIBINC)
|
||||||
|
|
||||||
|
## Whereami
|
||||||
ifneq ($(SKIPWHEREAMISYSTEM),1)
|
ifneq ($(SKIPWHEREAMISYSTEM),1)
|
||||||
ifneq (,$(wildcard /usr/include/whereami.h))
|
ifneq (,$(wildcard /usr/include/whereami.h))
|
||||||
WAILIB = -lwhereami
|
WAILIB = -lwhereami
|
||||||
WAILIBINC =
|
WAILIBINC =
|
||||||
WAISYSTEM = 1
|
WAI_FOUND = 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
LDLIBS += $(WAILIB)
|
||||||
|
INCLUDES += $(WAILIBINC)
|
||||||
|
|
||||||
|
## Zlib
|
||||||
|
# system library useable? Need to recompress hardnested tables?
|
||||||
|
LDLIBS +=$(ZLIB)
|
||||||
|
INCLUDES += $(ZLIBINC)
|
||||||
|
|
||||||
|
####################
|
||||||
|
# system libraries #
|
||||||
|
####################
|
||||||
|
|
||||||
|
## Atomic
|
||||||
|
# RPi Zero gcc requires -latomic
|
||||||
|
# but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
|
||||||
|
# doesn't recognize option --as-needed
|
||||||
|
ifneq ($(platform),Darwin)
|
||||||
|
LDLIBS += -Wl,--as-needed -latomic -Wl,--no-as-needed
|
||||||
|
endif
|
||||||
|
|
||||||
|
## Bluez (optional)
|
||||||
ifneq ($(SKIPBT),1)
|
ifneq ($(SKIPBT),1)
|
||||||
|
BTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags bluez 2>/dev/null)
|
||||||
BTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs bluez 2>/dev/null)
|
BTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs bluez 2>/dev/null)
|
||||||
|
ifneq ($(BTLDLIBS),)
|
||||||
|
BTLIB = $(BTLDLIBS)
|
||||||
|
BTLIBINC = $(BTINCLUDES)
|
||||||
|
BT_FOUND = 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
LDLIBS += $(BTLIB)
|
||||||
|
INCLUDES += $(BTLIBINC)
|
||||||
|
|
||||||
|
## Readline
|
||||||
|
ifeq ($(platform),Darwin)
|
||||||
|
LDLIBS += -L/usr/local/opt/readline/lib
|
||||||
|
INCLUDES += -I/usr/local/opt/readline/include
|
||||||
|
endif
|
||||||
|
LDLIBS += -lreadline
|
||||||
|
|
||||||
|
## Math
|
||||||
|
LDLIBS += -lm
|
||||||
|
|
||||||
|
## Pthread
|
||||||
|
# Some have no pthread, e.g. termux
|
||||||
|
ifneq ($(SKIPPTHREAD),1)
|
||||||
|
LDLIBS += -lpthread
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
## QT5 (or QT4 fallback) (optional)
|
||||||
ifneq ($(SKIPQT),1)
|
ifneq ($(SKIPQT),1)
|
||||||
# Check for correctly configured Qt5
|
# Check for correctly configured Qt5
|
||||||
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
|
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
|
||||||
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
|
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
|
||||||
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/moc
|
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/moc
|
||||||
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/uic
|
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=host_bins Qt5Core)/uic
|
||||||
ifeq ($(QTINCLUDES), )
|
ifneq ($(QTLDLIBS),)
|
||||||
|
QT5_FOUND = 1
|
||||||
|
else
|
||||||
# if Qt5 not found check for correctly configured Qt4
|
# if Qt5 not found check for correctly configured Qt4
|
||||||
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags QtCore QtGui 2>/dev/null)
|
QTINCLUDES = $(shell $(PKG_CONFIG_ENV) pkg-config --cflags QtCore QtGui 2>/dev/null)
|
||||||
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs QtCore QtGui 2>/dev/null)
|
QTLDLIBS = $(shell $(PKG_CONFIG_ENV) pkg-config --libs QtCore QtGui 2>/dev/null)
|
||||||
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=moc_location QtCore)
|
MOC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=moc_location QtCore)
|
||||||
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=uic_location QtCore)
|
UIC = $(shell $(PKG_CONFIG_ENV) pkg-config --variable=uic_location QtCore)
|
||||||
else
|
|
||||||
# On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
|
|
||||||
QT5FOUND = 1
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(QTINCLUDES), )
|
ifeq ($(QTLDLIBS),)
|
||||||
# if both pkg-config commands failed, search in common places
|
# if both pkg-config commands failed, search in common places
|
||||||
ifneq ($(QTDIR),)
|
ifneq ($(QTDIR),)
|
||||||
|
ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
|
||||||
|
# QT5
|
||||||
|
QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui -I$(QTDIR)/include/QtWidgets
|
||||||
|
QTLDLIBS = -L$(QTDIR)/lib -lQt5Core -lQt5Gui -lQt5Widgets
|
||||||
|
QT5_FOUND = 1
|
||||||
|
else
|
||||||
|
# QT4
|
||||||
QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
|
QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
|
||||||
QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
|
QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
|
||||||
ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
|
|
||||||
QTINCLUDES += -I$(QTDIR)/include/QtWidgets
|
|
||||||
QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core
|
|
||||||
QT5FOUND = 1
|
|
||||||
endif
|
endif
|
||||||
MOC = $(QTDIR)/bin/moc
|
MOC = $(QTDIR)/bin/moc
|
||||||
UIC = $(QTDIR)/bin/uic
|
UIC = $(QTDIR)/bin/uic
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(QTLDLIBS),)
|
||||||
|
QT_FOUND = 1
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
LDLIBS += $(QTLDLIBS)
|
||||||
|
CXXINCLUDES += $(QTINCLUDES)
|
||||||
|
|
||||||
LIBS = $(LUALIBINC) $(MBEDTLSLIBINC) $(JANSSONLIBINC) $(CBORLIBINC) $(ZLIBINC) $(REVENGLIBINC) $(AMIIBOLIBINC) $(HARDNESTEDLIBINC) $(CLIPARSERLIBINC) $(WAILIBINC)
|
#######################################################################################################
|
||||||
INCLUDES_CLIENT += -I./src -I../include -I../common -I../common_fpga $(LIBS)
|
|
||||||
CFLAGS ?= $(DEFCFLAGS)
|
CFLAGS ?= $(DEFCFLAGS)
|
||||||
|
|
||||||
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
|
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
|
||||||
PM3CFLAGS = $(CFLAGS) $(INCLUDES_CLIENT)
|
PM3CFLAGS = $(CFLAGS)
|
||||||
|
PM3CFLAGS += -I./src -I../include -I../common -I../common_fpga $(INCLUDES)
|
||||||
# WIP Testing
|
# WIP Testing
|
||||||
#PM3CFLAGS = $(CFLAGS) -std=c11 -pedantic $(INCLUDES_CLIENT)
|
#PM3CFLAGS += -std=c11 -pedantic
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
ifneq (,$(findstring MINGW,$(platform)))
|
ifneq (,$(findstring MINGW,$(platform)))
|
||||||
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
|
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
|
||||||
|
@ -160,44 +266,48 @@ ifneq (,$(findstring MINGW,$(platform)))
|
||||||
PM3CFLAGS += -D_ISOC99_SOURCE
|
PM3CFLAGS += -D_ISOC99_SOURCE
|
||||||
PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850
|
PM3CFLAGS += -mno-ms-bitfields -fexec-charset=cp850
|
||||||
endif
|
endif
|
||||||
ifeq ($(platform),Darwin)
|
|
||||||
OBJCSRCS = util_darwin.m
|
|
||||||
LDFLAGS += -framework Foundation -framework AppKit
|
|
||||||
LDLIBS := -L/usr/local/opt/readline/lib $(LDLIBS)
|
|
||||||
LIBS := -I/usr/local/opt/readline/include $(LIBS)
|
|
||||||
# cf brew info qt: qt not symlinked anymore
|
|
||||||
PKG_CONFIG_ENV := PKG_CONFIG_PATH=/usr/local/opt/qt/lib/pkgconfig
|
|
||||||
endif
|
|
||||||
|
|
||||||
CXXFLAGS ?= -Wall -Werror -O3
|
ifeq ($(BT_FOUND),1)
|
||||||
PM3CXXFLAGS = $(CXXFLAGS) -I../include
|
|
||||||
|
|
||||||
ifneq ($(BTLDLIBS),)
|
|
||||||
PM3CFLAGS += -DHAVE_BLUEZ
|
PM3CFLAGS += -DHAVE_BLUEZ
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(QTLDLIBS),)
|
CXXFLAGS ?= -Wall -Werror -O3
|
||||||
QTGUISRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp
|
PM3CXXFLAGS = $(CXXFLAGS)
|
||||||
QTGUIOBJS = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
|
PM3CXXFLAGS += -I../include
|
||||||
|
|
||||||
|
ifeq ($(QT_FOUND),1)
|
||||||
PM3CFLAGS += -DHAVE_GUI
|
PM3CFLAGS += -DHAVE_GUI
|
||||||
PM3CXXFLAGS += -DQT_NO_DEBUG
|
PM3CXXFLAGS += -DQT_NO_DEBUG
|
||||||
ifeq ($(QT5FOUND),1)
|
ifeq ($(QT5_FOUND),1)
|
||||||
|
# On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
|
||||||
PM3CXXFLAGS += -fPIC -std=c++11
|
PM3CXXFLAGS += -fPIC -std=c++11
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
QTGUISRCS = guidummy.cpp
|
|
||||||
QTGUIOBJS = $(OBJDIR)/guidummy.o
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
PM3LDFLAGS = $(LDFLAGS)
|
||||||
|
ifeq ($(platform),Darwin)
|
||||||
|
PM3LDFLAGS += -framework Foundation -framework AppKit
|
||||||
|
endif
|
||||||
|
|
||||||
|
###################
|
||||||
|
# printing status #
|
||||||
|
###################
|
||||||
|
|
||||||
$(info ===================================================================)
|
$(info ===================================================================)
|
||||||
$(info Client platform: $(platform))
|
$(info Client platform: $(platform))
|
||||||
|
|
||||||
ifeq ($(SKIPQT),1)
|
ifeq ($(SKIPQT),1)
|
||||||
$(info GUI support: skipped)
|
$(info GUI support: skipped)
|
||||||
else ifneq ($(QTLDLIBS),)
|
else ifeq ($(QT_FOUND),1)
|
||||||
$(info GUI support: QT found, enabled)
|
ifeq ($(QT5_FOUND),1)
|
||||||
|
$(info GUI support: QT5 found, enabled)
|
||||||
|
else
|
||||||
|
$(info GUI support: QT4 found, enabled)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
$(info GUI support: QT not found, disabled)
|
$(info GUI support: QT not found, disabled)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(SKIPBT),1)
|
ifeq ($(SKIPBT),1)
|
||||||
$(info native BT support: skipped)
|
$(info native BT support: skipped)
|
||||||
else ifneq ($(BTLDLIBS),)
|
else ifneq ($(BTLDLIBS),)
|
||||||
|
@ -205,107 +315,60 @@ $(info native BT support: Bluez found, enabled)
|
||||||
else
|
else
|
||||||
$(info native BT support: Bluez not found, disabled)
|
$(info native BT support: Bluez not found, disabled)
|
||||||
endif
|
endif
|
||||||
ifeq ($(JANSSONSYSTEM),1)
|
|
||||||
|
ifeq ($(JANSSON_FOUND),1)
|
||||||
$(info Jansson library: system library found)
|
$(info Jansson library: system library found)
|
||||||
endif
|
endif
|
||||||
ifeq ($(LUASYSTEM),1)
|
|
||||||
|
ifeq ($(LUA_FOUND),1)
|
||||||
$(info Lua library: system library found)
|
$(info Lua library: system library found)
|
||||||
endif
|
endif
|
||||||
ifeq ($(WAISYSTEM),1)
|
|
||||||
|
ifeq ($(WAI_FOUND),1)
|
||||||
$(info Whereami library: system library found)
|
$(info Whereami library: system library found)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(info compiler version: $(shell $(CC) --version|head -n 1))
|
$(info compiler version: $(shell $(CC) --version|head -n 1))
|
||||||
$(info ===================================================================)
|
$(info ===================================================================)
|
||||||
|
|
||||||
|
################
|
||||||
|
# dependencies #
|
||||||
|
################
|
||||||
|
|
||||||
# Flags to generate temporary dependency files
|
# Flags to generate temporary dependency files
|
||||||
DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td
|
DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td
|
||||||
# make temporary to final dependency files after successful compilation
|
# make temporary to final dependency files after successful compilation
|
||||||
POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d && $(TOUCH) $@
|
POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d && $(TOUCH) $@
|
||||||
|
|
||||||
CORESRCS = uart/uart_posix.c \
|
################
|
||||||
uart/uart_win32.c \
|
# enumerations #
|
||||||
ui.c \
|
################
|
||||||
commonutil.c \
|
|
||||||
util.c \
|
|
||||||
util_posix.c \
|
|
||||||
scandir.c \
|
|
||||||
crc16.c \
|
|
||||||
crc32.c \
|
|
||||||
comms.c \
|
|
||||||
version.c
|
|
||||||
|
|
||||||
CMDSRCS = crapto1/crapto1.c \
|
SRCS = aidsearch.c \
|
||||||
crapto1/crypto1.c \
|
|
||||||
mifare/mifaredefault.c \
|
|
||||||
mifare/mfkey.c \
|
|
||||||
tea.c \
|
|
||||||
fido/additional_ca.c \
|
|
||||||
fido/cose.c \
|
|
||||||
fido/cbortools.c \
|
|
||||||
fido/fidocore.c \
|
|
||||||
crypto/asn1dump.c \
|
|
||||||
crypto/libpcrypto.c\
|
|
||||||
crypto/asn1utils.c\
|
|
||||||
loclass/cipher.c \
|
|
||||||
loclass/cipherutils.c \
|
|
||||||
loclass/ikeys.c \
|
|
||||||
loclass/elite_crack.c \
|
|
||||||
fileutils.c \
|
|
||||||
mifare/mifarehost.c \
|
|
||||||
parity.c \
|
|
||||||
crc.c \
|
|
||||||
crc64.c \
|
|
||||||
legic_prng.c \
|
|
||||||
iso15693tools.c \
|
|
||||||
prng.c \
|
|
||||||
generator.c \
|
|
||||||
graph.c \
|
|
||||||
cmddata.c \
|
|
||||||
lfdemod.c \
|
|
||||||
emv/crypto_polarssl.c\
|
|
||||||
emv/crypto.c\
|
|
||||||
emv/emv_pk.c\
|
|
||||||
emv/emv_pki.c\
|
|
||||||
emv/emv_pki_priv.c\
|
|
||||||
emv/test/cryptotest.c\
|
|
||||||
emv/apduinfo.c \
|
|
||||||
emv/dump.c \
|
|
||||||
emv/tlv.c \
|
|
||||||
emv/emv_tags.c \
|
|
||||||
emv/dol.c \
|
|
||||||
emv/emvjson.c\
|
|
||||||
emv/emvcore.c \
|
|
||||||
emv/test/crypto_test.c\
|
|
||||||
emv/test/sda_test.c\
|
|
||||||
emv/test/dda_test.c\
|
|
||||||
emv/test/cda_test.c\
|
|
||||||
emv/cmdemv.c \
|
|
||||||
emv/emv_roca.c \
|
|
||||||
mifare/mifare4.c \
|
|
||||||
mifare/mad.c \
|
|
||||||
mifare/ndef.c \
|
|
||||||
mifare/desfire_crypto.c \
|
|
||||||
cmdanalyse.c \
|
cmdanalyse.c \
|
||||||
|
cmdcrc.c \
|
||||||
|
cmddata.c \
|
||||||
|
cmdflashmem.c \
|
||||||
|
cmdflashmemspiffs.c \
|
||||||
cmdhf.c \
|
cmdhf.c \
|
||||||
cmdhflist.c \
|
|
||||||
aidsearch.c \
|
|
||||||
cmdhf14a.c \
|
cmdhf14a.c \
|
||||||
cmdhf14b.c \
|
cmdhf14b.c \
|
||||||
cmdhf15.c \
|
cmdhf15.c \
|
||||||
|
cmdhfcryptorf.c \
|
||||||
cmdhfepa.c \
|
cmdhfepa.c \
|
||||||
cmdhflegic.c \
|
cmdhffelica.c \
|
||||||
|
cmdhffido.c \
|
||||||
cmdhficlass.c \
|
cmdhficlass.c \
|
||||||
|
cmdhflegic.c \
|
||||||
|
cmdhflist.c \
|
||||||
|
cmdhflto.c \
|
||||||
cmdhfmf.c \
|
cmdhfmf.c \
|
||||||
|
cmdhfmfdes.c \
|
||||||
|
cmdhfmfhard.c \
|
||||||
cmdhfmfu.c \
|
cmdhfmfu.c \
|
||||||
cmdhfmfp.c \
|
cmdhfmfp.c \
|
||||||
cmdhfmfhard.c \
|
|
||||||
cmdhfmfdes.c \
|
|
||||||
cmdhftopaz.c \
|
|
||||||
cmdhffido.c \
|
|
||||||
cmdhffelica.c \
|
|
||||||
cmdhfthinfilm.c \
|
cmdhfthinfilm.c \
|
||||||
cmdhfcryptorf.c \
|
cmdhftopaz.c \
|
||||||
cmdhflto.c \
|
|
||||||
cmdhw.c \
|
cmdhw.c \
|
||||||
cmdlf.c \
|
cmdlf.c \
|
||||||
cmdlfawid.c \
|
cmdlfawid.c \
|
||||||
|
@ -316,12 +379,13 @@ CMDSRCS = crapto1/crapto1.c \
|
||||||
cmdlfgallagher.c \
|
cmdlfgallagher.c \
|
||||||
cmdlfhid.c \
|
cmdlfhid.c \
|
||||||
cmdlfhitag.c \
|
cmdlfhitag.c \
|
||||||
cmdlfio.c \
|
|
||||||
cmdlfindala.c \
|
cmdlfindala.c \
|
||||||
|
cmdlfio.c \
|
||||||
cmdlfjablotron.c \
|
cmdlfjablotron.c \
|
||||||
cmdlfkeri.c \
|
cmdlfkeri.c \
|
||||||
cmdlfnexwatch.c \
|
cmdlfmotorola.c \
|
||||||
cmdlfnedap.c \
|
cmdlfnedap.c \
|
||||||
|
cmdlfnexwatch.c \
|
||||||
cmdlfnoralsy.c \
|
cmdlfnoralsy.c \
|
||||||
cmdlfpac.c \
|
cmdlfpac.c \
|
||||||
cmdlfparadox.c \
|
cmdlfparadox.c \
|
||||||
|
@ -333,47 +397,123 @@ CMDSRCS = crapto1/crapto1.c \
|
||||||
cmdlfti.c \
|
cmdlfti.c \
|
||||||
cmdlfviking.c \
|
cmdlfviking.c \
|
||||||
cmdlfvisa2000.c \
|
cmdlfvisa2000.c \
|
||||||
cmdlfmotorola.c \
|
cmdmain.c \
|
||||||
cmdtrace.c \
|
cmdparser.c \
|
||||||
cmdflashmem.c \
|
cmdscript.c \
|
||||||
cmdflashmemspiffs.c \
|
|
||||||
cmdsmartcard.c \
|
cmdsmartcard.c \
|
||||||
|
cmdtrace.c \
|
||||||
cmdusart.c \
|
cmdusart.c \
|
||||||
cmdwiegand.c \
|
cmdwiegand.c \
|
||||||
cmdparser.c \
|
comms.c \
|
||||||
cmdmain.c \
|
crypto/asn1dump.c \
|
||||||
pm3_binlib.c \
|
crypto/asn1utils.c\
|
||||||
scripting.c \
|
crypto/libpcrypto.c\
|
||||||
cmdscript.c \
|
emv/apduinfo.c \
|
||||||
pm3_bitlib.c \
|
emv/cmdemv.c \
|
||||||
cmdcrc.c \
|
emv/crypto.c\
|
||||||
bucketsort.c \
|
emv/crypto_polarssl.c\
|
||||||
|
emv/dol.c \
|
||||||
|
emv/dump.c \
|
||||||
|
emv/emv_pk.c\
|
||||||
|
emv/emv_pki.c\
|
||||||
|
emv/emv_pki_priv.c\
|
||||||
|
emv/emv_roca.c \
|
||||||
|
emv/emv_tags.c \
|
||||||
|
emv/emvcore.c \
|
||||||
|
emv/emvjson.c\
|
||||||
|
emv/tlv.c \
|
||||||
|
emv/test/crypto_test.c\
|
||||||
|
emv/test/cryptotest.c\
|
||||||
|
emv/test/cda_test.c\
|
||||||
|
emv/test/dda_test.c\
|
||||||
|
emv/test/sda_test.c\
|
||||||
|
fido/additional_ca.c \
|
||||||
|
fido/cose.c \
|
||||||
|
fido/cbortools.c \
|
||||||
|
fido/fidocore.c \
|
||||||
|
fileutils.c \
|
||||||
flash.c \
|
flash.c \
|
||||||
wiegand_formats.c \
|
generator.c \
|
||||||
wiegand_formatutils.c \
|
graph.c \
|
||||||
cardhelper.c \
|
jansson_path.c \
|
||||||
|
loclass/cipher.c \
|
||||||
|
loclass/cipherutils.c \
|
||||||
|
loclass/elite_crack.c \
|
||||||
|
loclass/ikeys.c \
|
||||||
|
mifare/desfire_crypto.c \
|
||||||
|
mifare/mad.c \
|
||||||
|
mifare/mfkey.c \
|
||||||
|
mifare/mifare4.c \
|
||||||
|
mifare/mifaredefault.c \
|
||||||
|
mifare/mifarehost.c \
|
||||||
|
mifare/ndef.c \
|
||||||
|
pm3_binlib.c \
|
||||||
|
pm3_bitlib.c \
|
||||||
preferences.c \
|
preferences.c \
|
||||||
jansson_path.c
|
prng.c \
|
||||||
|
proxmark3.c \
|
||||||
|
scandir.c \
|
||||||
|
uart/uart_posix.c \
|
||||||
|
uart/uart_win32.c \
|
||||||
|
scripting.c \
|
||||||
|
tea.c \
|
||||||
|
ui.c \
|
||||||
|
util.c \
|
||||||
|
version.c \
|
||||||
|
wiegand_formats.c \
|
||||||
|
wiegand_formatutils.c
|
||||||
|
|
||||||
COREOBJS = $(CORESRCS:%.c=$(OBJDIR)/%.o)
|
# common
|
||||||
CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o)
|
SRCS += bucketsort.c \
|
||||||
OBJCOBJS = $(OBJCSRCS:%.m=$(OBJDIR)/%.o)
|
cardhelper.c \
|
||||||
|
crapto1/crapto1.c \
|
||||||
|
crapto1/crypto1.c \
|
||||||
|
crc.c \
|
||||||
|
crc16.c \
|
||||||
|
crc32.c \
|
||||||
|
crc64.c \
|
||||||
|
commonutil.c \
|
||||||
|
iso15693tools.c \
|
||||||
|
legic_prng.c \
|
||||||
|
lfdemod.c \
|
||||||
|
parity.c \
|
||||||
|
util_posix.c
|
||||||
|
|
||||||
|
# gui
|
||||||
|
ifeq ($(QT_FOUND),1)
|
||||||
|
CXXSRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp
|
||||||
|
else
|
||||||
|
CXXSRCS = guidummy.cpp
|
||||||
|
endif
|
||||||
|
|
||||||
|
# OS X
|
||||||
|
ifeq ($(platform),Darwin)
|
||||||
|
OBJCSRCS = util_darwin.m
|
||||||
|
endif
|
||||||
|
|
||||||
|
OBJS = $(SRCS:%.c=$(OBJDIR)/%.o)
|
||||||
|
OBJS += $(CXXSRCS:%.cpp=$(OBJDIR)/%.o)
|
||||||
|
OBJS += $(OBJCSRCS:%.m=$(OBJDIR)/%.o)
|
||||||
|
|
||||||
BINS = proxmark3
|
BINS = proxmark3
|
||||||
|
|
||||||
CLEAN = $(BINS) src/version.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
CLEAN = $(BINS) src/version.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
||||||
# transition: cleaning also old path stuff
|
# transition: cleaning also old path stuff
|
||||||
CLEAN += flasher *.moc.cpp ui/ui_overlays.h
|
CLEAN += flasher *.moc.cpp ui/ui_overlays.h
|
||||||
|
|
||||||
|
###########
|
||||||
|
# targets #
|
||||||
|
###########
|
||||||
|
|
||||||
# need to assign dependancies to build these first...
|
# need to assign dependancies to build these first...
|
||||||
all: $(BINS)
|
all: $(BINS)
|
||||||
|
|
||||||
all-static: LDLIBS:=-static $(LDLIBS)
|
all-static: LDLIBS:=-static $(LDLIBS)
|
||||||
all-static: $(BINS)
|
all-static: $(BINS)
|
||||||
|
|
||||||
proxmark3: LDLIBS+=$(LUALIB) $(JANSSONLIB) $(MBEDTLSLIB) $(CBORLIB) $(ZLIB) $(REVENGLIB) $(AMIIBOLIB) $(HARDNESTEDLIB) $(CLIPARSERLIB) $(WAILIB) $(BTLDLIBS) $(QTLDLIBS)
|
proxmark3: $(OBJS) liblua jansson tinycbor reveng mbedtls zlib amiibo hardnested cliparser whereami lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
||||||
proxmark3: $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) liblua jansson tinycbor reveng mbedtls zlib amiibo hardnested cliparser whereami lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua
|
|
||||||
$(info [=] LD $@)
|
$(info [=] LD $@)
|
||||||
$(Q)$(LD) $(LDFLAGS) $(OBJDIR)/proxmark3.o $(COREOBJS) $(CMDOBJS) $(OBJCOBJS) $(QTGUIOBJS) $(LDLIBS) -o $@
|
$(Q)$(LD) $(PM3LDFLAGS) $(OBJS) $(LDLIBS) -o $@
|
||||||
|
|
||||||
src/proxgui.cpp: src/ui/ui_overlays.h
|
src/proxgui.cpp: src/ui/ui_overlays.h
|
||||||
|
|
||||||
|
@ -434,15 +574,18 @@ tarbin: $(BINS)
|
||||||
$(info [=] TAR ../proxmark3-$(platform)-bin.tar)
|
$(info [=] TAR ../proxmark3-$(platform)-bin.tar)
|
||||||
$(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%)
|
$(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%)
|
||||||
|
|
||||||
# local libraries:
|
###########################
|
||||||
|
# local libraries targets #
|
||||||
|
###########################
|
||||||
|
|
||||||
liblua:
|
liblua:
|
||||||
ifneq ($(LUASYSTEM),1)
|
ifneq ($(LUA_FOUND),1)
|
||||||
$(info [*] MAKE $@ for $(LUAPLATFORM))
|
$(info [*] MAKE $@ for $(LUAPLATFORM))
|
||||||
$(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) $(LUAPLATFORM)
|
$(Q)$(MAKE) --no-print-directory -C $(LUALIBPATH) $(LUAPLATFORM)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
jansson:
|
jansson:
|
||||||
ifneq ($(JANSSONSYSTEM),1)
|
ifneq ($(JANSSON_FOUND),1)
|
||||||
$(info [*] MAKE $@)
|
$(info [*] MAKE $@)
|
||||||
$(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) all
|
$(Q)$(MAKE) --no-print-directory -C $(JANSSONLIBPATH) all
|
||||||
endif
|
endif
|
||||||
|
@ -468,7 +611,7 @@ cliparser:
|
||||||
$(Q)$(MAKE) --no-print-directory -C $(CLIPARSERLIBPATH) all
|
$(Q)$(MAKE) --no-print-directory -C $(CLIPARSERLIBPATH) all
|
||||||
|
|
||||||
whereami:
|
whereami:
|
||||||
ifneq ($(WAISYSTEM),1)
|
ifneq ($(WAI_FOUND),1)
|
||||||
$(info [*] MAKE $@)
|
$(info [*] MAKE $@)
|
||||||
$(Q)$(MAKE) --no-print-directory -C $(WAILIBPATH) all
|
$(Q)$(MAKE) --no-print-directory -C $(WAILIBPATH) all
|
||||||
endif
|
endif
|
||||||
|
@ -482,6 +625,10 @@ zlib:
|
||||||
$(info [*] MAKE $@)
|
$(info [*] MAKE $@)
|
||||||
$(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
|
$(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all
|
||||||
|
|
||||||
|
########
|
||||||
|
# misc #
|
||||||
|
########
|
||||||
|
|
||||||
.PHONY: all clean install uninstall tarbin liblua jansson tinycbor reveng hardnested amiibo cliparser whereami mbedtls zlib
|
.PHONY: all clean install uninstall tarbin liblua jansson tinycbor reveng hardnested amiibo cliparser whereami mbedtls zlib
|
||||||
|
|
||||||
# version.c should be remade on every compilation
|
# version.c should be remade on every compilation
|
||||||
|
@ -503,7 +650,7 @@ $(OBJDIR)/%.o : %.c $(OBJDIR)/%.d
|
||||||
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d
|
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/%.d
|
||||||
$(info [-] CXX $<)
|
$(info [-] CXX $<)
|
||||||
$(Q)$(MKDIR) $(dir $@)
|
$(Q)$(MKDIR) $(dir $@)
|
||||||
$(Q)$(CXX) $(DEPFLAGS) $(PM3CXXFLAGS) $(QTINCLUDES) -c -o $@ $<
|
$(Q)$(CXX) $(DEPFLAGS) $(PM3CXXFLAGS) $(CXXINCLUDES) -c -o $@ $<
|
||||||
$(Q)$(POSTCOMPILE)
|
$(Q)$(POSTCOMPILE)
|
||||||
|
|
||||||
%.o: %.m
|
%.o: %.m
|
||||||
|
@ -513,10 +660,9 @@ $(OBJDIR)/%.o : %.m $(OBJDIR)/%.d
|
||||||
$(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $<
|
$(Q)$(CC) $(DEPFLAGS) $(PM3CFLAGS) -c -o $@ $<
|
||||||
$(Q)$(POSTCOMPILE)
|
$(Q)$(POSTCOMPILE)
|
||||||
|
|
||||||
DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(CORESRCS) $(CMDSRCS)) \
|
DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(SRCS)) \
|
||||||
$(patsubst %.cpp, $(OBJDIR)/%.d, $(QTGUISRCS)) \
|
$(patsubst %.cpp, $(OBJDIR)/%.d, $(CXXSRCS)) \
|
||||||
$(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS)) \
|
$(patsubst %.m, $(OBJDIR)/%.d, $(OBJCSRCS))
|
||||||
$(OBJDIR)/proxmark3.d
|
|
||||||
|
|
||||||
$(DEPENDENCY_FILES): ;
|
$(DEPENDENCY_FILES): ;
|
||||||
.PRECIOUS: $(DEPENDENCY_FILES)
|
.PRECIOUS: $(DEPENDENCY_FILES)
|
||||||
|
|
|
@ -1,10 +1,30 @@
|
||||||
include(cliparser.cmake)
|
if (NOT TARGET pm3rrg_rdv4_amiibo)
|
||||||
include(tinycbor.cmake)
|
|
||||||
include(jansson.cmake)
|
|
||||||
include(lua.cmake)
|
|
||||||
include(mbedtls.cmake)
|
|
||||||
include(amiibo.cmake)
|
include(amiibo.cmake)
|
||||||
include(reveng.cmake)
|
endif()
|
||||||
include(zlib.cmake)
|
if (NOT TARGET pm3rrg_rdv4_cliparser)
|
||||||
|
include(cliparser.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_hardnested)
|
||||||
include(hardnested.cmake)
|
include(hardnested.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_jansson)
|
||||||
|
include(jansson.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_lua)
|
||||||
|
include(lua.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_mbedtls)
|
||||||
|
include(mbedtls.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_reveng)
|
||||||
|
include(reveng.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_tinycbor)
|
||||||
|
include(tinycbor.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_whereami)
|
||||||
include(whereami.cmake)
|
include(whereami.cmake)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_z)
|
||||||
|
include(zlib.cmake)
|
||||||
|
endif()
|
||||||
|
|
|
@ -11,6 +11,14 @@ add_library(pm3rrg_rdv4_amiibo STATIC
|
||||||
amiitool/keygen.c
|
amiitool/keygen.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (NOT TARGET pm3rrg_rdv4_mbedtls)
|
||||||
|
include(mbedtls.cmake)
|
||||||
|
endif()
|
||||||
|
find_library(pm3rrg_rdv4_mbedtls REQUIRED)
|
||||||
|
target_link_libraries(pm3rrg_rdv4_amiibo PRIVATE
|
||||||
|
readline
|
||||||
|
m
|
||||||
|
pm3rrg_rdv4_mbedtls)
|
||||||
target_include_directories(pm3rrg_rdv4_amiibo PRIVATE ../../include ../../common)
|
target_include_directories(pm3rrg_rdv4_amiibo PRIVATE ../../include ../../common)
|
||||||
target_include_directories(pm3rrg_rdv4_amiibo INTERFACE amiitool)
|
target_include_directories(pm3rrg_rdv4_amiibo INTERFACE amiitool)
|
||||||
target_compile_options(pm3rrg_rdv4_amiibo PRIVATE -Wall -Werror -O3)
|
target_compile_options(pm3rrg_rdv4_amiibo PRIVATE -Wall -Werror -O3)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
MYSRCPATHS =
|
MYSRCPATHS =
|
||||||
MYINCLUDES = -I. -I.. -I../jansson -I../../../common -I../../../include
|
MYINCLUDES = -I. -I.. -I../jansson -I../../../common -I../../../common/mbedtls -I../../../include
|
||||||
MYCFLAGS =
|
MYCFLAGS =
|
||||||
MYDEFS =
|
MYDEFS =
|
||||||
MYSRCS = \
|
MYSRCS = \
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amiibo.h"
|
#include "amiibo.h"
|
||||||
#include "mbedtls/md.h"
|
#include "md.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
|
|
||||||
#define HMAC_POS_DATA 0x008
|
#define HMAC_POS_DATA 0x008
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "drbg.h"
|
#include "drbg.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/md.h"
|
#include "md.h"
|
||||||
|
|
||||||
void nfc3d_drbg_init(nfc3d_drbg_ctx *ctx, const uint8_t *hmacKey, size_t hmacKeySize, const uint8_t *seed, size_t seedSize) {
|
void nfc3d_drbg_init(nfc3d_drbg_ctx *ctx, const uint8_t *hmacKey, size_t hmacKeySize, const uint8_t *seed, size_t seedSize) {
|
||||||
assert(ctx != NULL);
|
assert(ctx != NULL);
|
||||||
|
|
|
@ -45,5 +45,6 @@ add_library(pm3rrg_rdv4_mbedtls STATIC
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(pm3rrg_rdv4_mbedtls PRIVATE ../../common)
|
target_include_directories(pm3rrg_rdv4_mbedtls PRIVATE ../../common)
|
||||||
|
target_include_directories(pm3rrg_rdv4_mbedtls INTERFACE ../../common/mbedtls)
|
||||||
target_compile_options(pm3rrg_rdv4_mbedtls PRIVATE -Wall -Werror -O3)
|
target_compile_options(pm3rrg_rdv4_mbedtls PRIVATE -Wall -Werror -O3)
|
||||||
set_property(TARGET pm3rrg_rdv4_mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET pm3rrg_rdv4_mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
|
@ -9,5 +9,6 @@ add_library(pm3rrg_rdv4_z STATIC
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(pm3rrg_rdv4_z PRIVATE Z_SOLO NO_GZIP ZLIB_PM3_TUNED)
|
target_compile_definitions(pm3rrg_rdv4_z PRIVATE Z_SOLO NO_GZIP ZLIB_PM3_TUNED)
|
||||||
|
target_include_directories(pm3rrg_rdv4_z INTERFACE ../../common/zlib)
|
||||||
target_compile_options(pm3rrg_rdv4_z PRIVATE -Wall -Werror -O3)
|
target_compile_options(pm3rrg_rdv4_z PRIVATE -Wall -Werror -O3)
|
||||||
set_property(TARGET pm3rrg_rdv4_z PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET pm3rrg_rdv4_z PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
#include "comms.h" //getfromdevice
|
#include "comms.h" //getfromdevice
|
||||||
#include "cmdflashmemspiffs.h" // spiffs commands
|
#include "cmdflashmemspiffs.h" // spiffs commands
|
||||||
|
|
||||||
#include "mbedtls/rsa.h"
|
#include "rsa.h"
|
||||||
#include "mbedtls/sha1.h"
|
#include "sha1.h"
|
||||||
|
|
||||||
#define MCK 48000000
|
#define MCK 48000000
|
||||||
#define FLASH_MINFAST 24000000 //33000000
|
#define FLASH_MINFAST 24000000 //33000000
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "mifare.h" // felica_card_select_t struct
|
#include "mifare.h" // felica_card_select_t struct
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#define AddCrc(data, len) compute_crc(CRC_FELICA, (data), (len), (data)+(len)+1, (data)+(len))
|
#define AddCrc(data, len) compute_crc(CRC_FELICA, (data), (len), (data)+(len)+1, (data)+(len))
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "cmdtrace.h"
|
#include "cmdtrace.h"
|
||||||
#include "util_posix.h"
|
#include "util_posix.h"
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "loclass/cipherutils.h"
|
#include "loclass/cipherutils.h"
|
||||||
#include "loclass/cipher.h"
|
#include "loclass/cipher.h"
|
||||||
#include "loclass/ikeys.h"
|
#include "loclass/ikeys.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "cmdhf14a.h"
|
#include "cmdhf14a.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
#include "protocols.h"
|
#include "protocols.h"
|
||||||
#include "cmdtrace.h"
|
#include "cmdtrace.h"
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
#include "cmdhfmf.h"
|
#include "cmdhfmf.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "hardnested_bruteforce.h"
|
#include "hardnested_bruteforce.h"
|
||||||
#include "hardnested_bf_core.h"
|
#include "hardnested_bf_core.h"
|
||||||
#include "hardnested_bitarray_core.h"
|
#include "hardnested_bitarray_core.h"
|
||||||
#include "zlib/zlib.h"
|
#include "zlib.h"
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
|
|
||||||
#define NUM_CHECK_BITFLIPS_THREADS (num_CPUs())
|
#define NUM_CHECK_BITFLIPS_THREADS (num_CPUs())
|
||||||
|
@ -220,7 +220,7 @@ static void inflate_free(voidpf opaque, voidpf address) {
|
||||||
#define INPUT_BUFFER_LEN 80
|
#define INPUT_BUFFER_LEN 80
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Initialize decompression of the respective (HF or LF) FPGA stream
|
// Initialize decompression of the respective bitflip_bitarray stream
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static void init_inflate(z_streamp compressed_stream, uint8_t *input_buffer, uint32_t insize, uint8_t *output_buffer, uint32_t outsize) {
|
static void init_inflate(z_streamp compressed_stream, uint8_t *input_buffer, uint32_t insize, uint8_t *output_buffer, uint32_t outsize) {
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "cmdparser.h"
|
#include "cmdparser.h"
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "cmdhfmf.h"
|
#include "cmdhfmf.h"
|
||||||
#include "cmdhf14a.h"
|
#include "cmdhf14a.h"
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "mbedtls/rsa.h"
|
#include "rsa.h"
|
||||||
#include "mbedtls/sha1.h"
|
#include "sha1.h"
|
||||||
|
|
||||||
struct crypto_hash_polarssl {
|
struct crypto_hash_polarssl {
|
||||||
struct crypto_hash ch;
|
struct crypto_hash ch;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "emv_roca.h"
|
#include "emv_roca.h"
|
||||||
|
|
||||||
#include "ui.h" // Print...
|
#include "ui.h" // Print...
|
||||||
#include "mbedtls/bignum.h"
|
#include "bignum.h"
|
||||||
|
|
||||||
static uint8_t g_primes[ROCA_PRINTS_LENGTH] = {
|
static uint8_t g_primes[ROCA_PRINTS_LENGTH] = {
|
||||||
11, 13, 17, 19, 37, 53, 61, 71, 73, 79, 97, 103, 107, 109, 127, 151, 157
|
11, 13, 17, 19, 37, 53, 61, 71, 73, 79, 97, 103, 107, 109, 127, 151, 157
|
||||||
|
|
|
@ -12,19 +12,19 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
#include "mbedtls/bignum.h"
|
#include "bignum.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
#include "mbedtls/cmac.h"
|
#include "cmac.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "mbedtls/ecp.h"
|
#include "ecp.h"
|
||||||
#include "mbedtls/rsa.h"
|
#include "rsa.h"
|
||||||
#include "mbedtls/sha1.h"
|
#include "sha1.h"
|
||||||
#include "mbedtls/md5.h"
|
#include "md5.h"
|
||||||
#include "mbedtls/x509.h"
|
#include "x509.h"
|
||||||
#include "mbedtls/base64.h"
|
#include "base64.h"
|
||||||
#include "mbedtls/ctr_drbg.h"
|
#include "ctr_drbg.h"
|
||||||
#include "mbedtls/entropy.h"
|
#include "entropy.h"
|
||||||
#include "mbedtls/timing.h"
|
#include "timing.h"
|
||||||
|
|
||||||
#include "crypto_test.h"
|
#include "crypto_test.h"
|
||||||
#include "sda_test.h"
|
#include "sda_test.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "emv/emvcore.h"
|
#include "emv/emvcore.h"
|
||||||
#include "emv/emvjson.h"
|
#include "emv/emvjson.h"
|
||||||
#include "cbortools.h"
|
#include "cbortools.h"
|
||||||
#include "mbedtls/x509_crt.h"
|
#include "x509_crt.h"
|
||||||
#include "crypto/asn1utils.h"
|
#include "crypto/asn1utils.h"
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
#include "additional_ca.h"
|
#include "additional_ca.h"
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#include "ikeys.h"
|
#include "ikeys.h"
|
||||||
#include "elite_crack.h"
|
#include "elite_crack.h"
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "util_posix.h"
|
#include "util_posix.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -70,7 +70,7 @@ From "Dismantling iclass":
|
||||||
|
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
#include "cipherutils.h"
|
#include "cipherutils.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
|
|
||||||
uint8_t pi[35] = {
|
uint8_t pi[35] = {
|
||||||
0x0F, 0x17, 0x1B, 0x1D, 0x1E, 0x27, 0x2B, 0x2D,
|
0x0F, 0x17, 0x1B, 0x1D, 0x1E, 0x27, 0x2B, 0x2D,
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
#include "mbedtls/des.h"
|
#include "des.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "crc16.h" // crc16 ccitt
|
#include "crc16.h" // crc16 ccitt
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include "mifare/mifarehost.h"
|
#include "mifare/mifarehost.h"
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "crc64.h"
|
#include "crc64.h"
|
||||||
#include "mbedtls/sha1.h"
|
#include "sha1.h"
|
||||||
#include "mbedtls/aes.h"
|
#include "aes.h"
|
||||||
#include "cmdcrc.h"
|
#include "cmdcrc.h"
|
||||||
#include "cmdhfmfhard.h"
|
#include "cmdhfmfhard.h"
|
||||||
#include "cmdhfmfu.h"
|
#include "cmdhfmfu.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue