Back to Proxmark3

Makefile vs CMake

doc/md/Development/Makefile-vs-CMake.md

4.92376.2 KB
Original Source

Makefile vs CMake

<a id="Top"></a>

Table of Contents

Client

^Top

The client can be compiled both with the historical Makefile and with a newer CMakeLists.txt. At the moment both are maintained because they don't perfectly overlap yet.

  • in_common: src in /common
  • in_deps: src in /client/deps
  • opt: optional dependency
  • pc: use pkg-config
  • sys: system library
FeatureMakefileCMakeRemarks
verboseV=1VERBOSE=1
debug buildDEBUG=1-DCMAKE_BUILD_TYPE=Debugclient only
warnings managementyes (1)no(1) cf Makefile.defs
extra GCC warningsGCCEXTRA=1no
extra Clang warningsCLANGEXTRA=1noonly on host
AddressSanitizeSANITIZE=1noonly on host
Hardeningyes (1)noonly on host; disable it with NOHARDENING=1
compilationin placein build dir
user CFLAGS/LDFLAGSenvvars honored (1)envvars honored (2)(1) also LDLIBS and INCLUDES_CLIENT for more tuning (2) only at first cmake call
Mingw gnu printf_ISOC99_SOURCE_ISOC99_SOURCEand in cbor.h: __attribute__((format (__MINGW_PRINTF_FORMAT, 2, 3)))
C++c++11gnu++14
dep amiiboin_depsin_deps
dep atomicsys, for RPiZsys, for RPiZ-Wl,--as-needed -latomic -Wl,--no-as-needed unless OSX
atomic detectionnonenone
dep bluezopt, sysopt, sys
bluez detectionpcpkg_search_module
SKIPBTyesyes
dep bzip2syssys
bzip2 detectionnonefind_package, Cross:gitclone
dep cliparserin_depsin_deps
dep hardnestedin_depsin_deps
hardn arch autodetectuname -m =? 86 or amd64; $(CC) -E -mavx512f? +AVX512CMAKE_SYSTEM_PROCESSOR =? x86 or x86_64 or i686 or AMD64 (1)(1) currently it always includes AVX512 on Intel arch
cpu_archyesno/auto?e.g. cpu_arch=generic for cross-compilation
dep janssonsys / in_depssys / in_deps
jansson detectionpcpc/find*
SKIPJANSSONSYSTEMyesyes
dep luasys / in_deps(1)in_deps only(2)(1) manual def of LUAPLATFORM for mingw/macosx/linux (2) manual, different?, for Android too
lua detectionpcnone
SKIPLUASYSTEMyesno
lualibs/pm3_cmd.luayesadd_custom_command but unused
lualibs/mfc_default_keys.luayesadd_custom_command but unused
dep lz4syssys+ in_common only used by FW. See get_lz4.sh for upstream fetch & patch
lz4 detectionnonefind, Cross:gitclone
dep libmsyssys
libm detectionnonenone (1)(1) cf https://cmake.org/pipermail/cmake/2019-March/069168.html ?
dep mbedtlsin_commonin_commonno sys lib: missing support for CMAC in def conf (btw no .pc available)
dep python3opt, sys, < 3.8 & 3.8opt, sys, < 3.8 & 3.8
python3 detectionpcpkg_search_module
force python3 versionPYTHON3_PKGCONFIG=python-3.12-DPYTHON3_PKGCONFIG=python-3.12
SKIPPYTHONyesyes
dep pthreadsyssys
pthread detectionnonenone (1)(1) cf https://stackoverflow.com/questions/1620918/cmake-and-libpthread ?
SKIPPTHREADyesyese.g. for termux
dep Qtopt, sys, Qt6 & Qt5opt, sys, Qt6 & Qt5
Qt detectionpc(qt6)/pc(qt5)/QTDIR(1) (2)find_package(qt6/qt5) (3)(1) if QTDIR: hardcode path (2) OSX: pkg-config hook for Brew (3) OSX: add search path
SKIPQTyesyes
SKIPQT6yesyes
dep readlinesyssys
readline detectionnone (1)find*(2), Cross:getzip(1) OSX: hardcoded path (2) additional paths for OSX
SKIPREADLINEyesyesCLI not fully functional without Readline
SKIPLINENOISEyesyesreplacement of Readline, not as complete
dep revengin_depsin_deps
SKIPREVENGTESTyes(1)no(2)(1) e.g. if cross-compilation (2) tests aren't compiled/ran with cmake
dep tinycborin_depsin_deps
dep whereamisys / in_depssys / in_deps
whereami detectionsearch /usr/include/whereami.hfind*no .pc available
SKIPWHEREAMISYSTEMyesyes
versionmkversionmkversion
installyes (1)no(1) supports DESTDIR, PREFIX, UDEV_PREFIX. Installs resources as well, INSTALL*RELPATH
debnopartial?
tarbinyes, unused?no
Android cross-noyes
SWIG Lua+Python embeddednoongoingcf libpm3_experiments branch
libpm3 with SWIG Lua+Pythonnoongoingcf libpm3_experiments branch

Tools

^Top

makefile only at the moment

FeatureMakefileRemarks
Skip OpenCL-dependent codeSKIPOPENCL=1to skip ht2crack5opencl tool when compiling the hitag2crack toolsuite

ARM

^Top

makefile only at the moment

Features to be used via Makefile.platform

^Top

SKIP_*, STANDALONE

FeatureMakefileRemarks
Platform choicePLATFORM=values: PM3RDV4, PM3GENERIC, PM3ICOPYX, PM3ULTIMATE
Platform sizePLATFORM_SIZE=values: 256, 512
Platform extrasPLATFORM_EXTRAS=values: BTADDON, FPC_USART_DEV
Skip LF/HF techs in the firmwareSKIP_*=1see common_arm/Makefile.hal for a list
Standalone mode choiceSTANDALONE=see doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md for a list

Other features

^Top

FeatureMakefileRemarks
ARM debug buildDEBUG_ARM=1to be used with JLink and VSCode
Install dest dirDESTDIR=for maintainers
Install prefix dirPREFIX=for maintainers
Tag firmware imageFWTAG=for maintainers

Global

^Top

makefile only at the moment