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

134 lines
5.9 KiB
Markdown
Raw Normal View History

2020-06-15 19:48:10 +08:00
# Makefile vs CMake
2021-12-31 18:22:10 +08:00
<a id="Top"></a>
# Table of Contents
- [Makefile vs CMake](#makefile-vs-cmake)
- [Table of Contents](#table-of-contents)
- [Client](#client)
- [Tools](#tools)
- [ARM](#arm)
- [Features to be used via `Makefile.platform`](#features-to-be-used-via-makefileplatform)
- [Other features](#other-features)
- [Global](#global)
2020-06-15 19:48:10 +08:00
## Client
2021-12-31 18:22:10 +08:00
^[Top](#top)
2020-06-15 19:48:10 +08:00
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
| Feature | Makefile | CMake | Remarks |
|-----|---|---|---|
2020-10-20 07:00:00 +08:00
| verbose | `V=1` | `VERBOSE=1` | |
| debug build | `DEBUG=1` | `-DCMAKE_BUILD_TYPE=Debug` | client only |
2020-06-15 19:48:10 +08:00
| warnings management | yes (1) | **no** | (1) cf Makefile.defs |
2020-12-30 08:30:30 +08:00
| extra GCC warnings | `GCCEXTRA=1` | **no** | |
| extra Clang warnings | `CLANGEXTRA=1` | **no** | only on host |
| AddressSanitize | `SANITIZE=1` | **no** | only on host |
2020-06-15 20:26:43 +08:00
| compilation | in place | in build dir | |
2020-06-18 06:51:26 +08:00
| user `CFLAGS`/`LDFLAGS` | envvars honored (1) | envvars honored (2) | (1) also `LDLIBS` and `INCLUDES_CLIENT` for more tuning (2) only at first cmake call |
2020-06-15 20:26:43 +08:00
| Mingw gnu printf | `_ISOC99_SOURCE` | `_ISOC99_SOURCE` | and in cbor.h: `__attribute__((format (__MINGW_PRINTF_FORMAT, 2, 3)))`|
2020-06-15 19:48:10 +08:00
| C++ | c++11 | gnu++14 | |
| dep amiibo | in_deps | in_deps | |
| dep atomic | sys, for RPiZ | sys, for RPiZ | `-Wl,--as-needed -latomic -Wl,--no-as-needed` unless OSX |
| atomic detection | **none** | **none** | |
| dep bluez | opt, sys | opt, sys | |
| bluez detection | pc | pkg_search_module | |
| `SKIPBT` | yes | yes | |
| dep bzip2 | sys | sys | |
2020-06-23 16:12:36 +08:00
| bzip2 detection | **none** | find_package, Cross:gitclone | |
2020-06-15 19:48:10 +08:00
| dep cliparser | in_deps | in_deps | |
| dep hardnested | in_deps | in_deps | |
2020-10-20 07:00:00 +08:00
| hardn arch autodetect | `uname -m` =? 86 or amd64; `$(CC) -E -mavx512f`? +`AVX512` | `CMAKE_SYSTEM_PROCESSOR` =? x86 or x86_64 or i686 or AMD64 (1) | (1) currently it always includes AVX512 on Intel arch |
2020-06-15 20:26:43 +08:00
| `cpu_arch` | yes | **no/auto?** | e.g. `cpu_arch=generic` for cross-compilation
| dep jansson | sys / in_deps | sys / in_deps | |
| jansson detection | pc | pc/find* | |
| `SKIPJANSSONSYSTEM` | yes | yes | |
2020-06-15 19:48:10 +08:00
| dep lua | sys / in_deps(1) | **in_deps only**(2) | (1) manual def of `LUAPLATFORM` for mingw/macosx/linux (2) manual, different?, for Android too |
| lua detection | pc | **none** | |
| `SKIPLUASYSTEM` | yes | **no** | |
2020-06-18 06:51:26 +08:00
| lualibs/pm3_cmd.lua | yes | add_custom_command **but unused** | |
| lualibs/mfc_default_keys.lua | yes | add_custom_command **but unused** | |
2023-07-17 10:56:18 +08:00
| dep lz4 | sys | sys | + in_common only used by FW. See `get_lz4.sh` for upstream fetch & patch |
| lz4 detection | **none** | find, Cross:gitclone | |
2020-06-15 19:48:10 +08:00
| dep libm | sys | sys | |
2020-06-18 06:51:26 +08:00
| libm detection | **none** | **none** (1) | (1) cf https://cmake.org/pipermail/cmake/2019-March/069168.html ? |
2020-06-15 19:48:10 +08:00
| dep mbedtls | in_common | in_common | no sys lib: missing support for CMAC in def conf (btw no .pc available) |
| dep python3 | opt, sys, < 3.8 & 3.8 | opt, sys, < 3.8 & 3.8 | |
2020-06-15 19:48:10 +08:00
| python3 detection | pc | pkg_search_module | |
| `SKIPPYTHON` | yes | yes | |
| dep pthread | sys | sys | |
2020-06-18 06:51:26 +08:00
| pthread detection | **none** | **none** (1) | (1) cf https://stackoverflow.com/questions/1620918/cmake-and-libpthread ? |
2020-06-15 19:48:10 +08:00
| `SKIPPTHREAD` | yes | yes | e.g. for termux |
| dep Qt | opt, sys, Qt5 & Qt4 | opt, sys, Qt5 | |
| Qt detection | pc(qt5)/pc(qt4)/`QTDIR`(1) (2) | find_package(qt5) (3) | (1) if `QTDIR`: hardcode path (2) OSX: pkg-config hook for Brew (3) OSX: add search path|
| `SKIPQT` | yes | yes | |
| dep readline | sys | sys | |
2020-06-23 16:12:36 +08:00
| readline detection | **none** (1) | find*(2), Cross:getzip | (1) OSX: hardcoded path (2) additional paths for OSX |
2020-06-15 19:48:10 +08:00
| `SKIPREADLINE` | yes | yes | CLI not fully functional without Readline |
| `SKIPLINENOISE` | yes | yes | replacement of Readline, not as complete |
2020-06-15 19:48:10 +08:00
| dep reveng | in_deps | in_deps | |
| `SKIPREVENGTEST` | yes(1) | **no**(2) | (1) e.g. if cross-compilation (2) tests aren't compiled/ran with cmake |
| dep tinycbor | in_deps | in_deps | |
| dep whereami | sys / in_deps | sys / in_deps | |
| whereami detection | **search /usr/include/whereami.h** | find* | no .pc available |
| `SKIPWHEREAMISYSTEM` | yes | yes | |
2020-06-15 19:48:10 +08:00
| version | mkversion | mkversion | |
| install | yes (1) | **no** | (1) supports `DESTDIR`, `PREFIX`, `UDEV_PREFIX`. Installs resources as well, `INSTALL*RELPATH` |
| deb | no | partial? | |
| tarbin | yes, unused? | no | |
| Android cross- | **no** | yes | |
| SWIG Lua+Python embedded | **no** | *ongoing* | cf libpm3_experiments branch |
| libpm3 with SWIG Lua+Python| **no** | *ongoing* | cf libpm3_experiments branch |
## Tools
2021-12-31 18:22:10 +08:00
^[Top](#top)
2020-06-15 19:48:10 +08:00
`makefile` only at the moment
2020-12-30 08:30:30 +08:00
| Feature | Makefile | Remarks |
|-----|---|---|
| Skip OpenCL-dependent code | `SKIPOPENCL=1` | to skip ht2crack5opencl tool when compiling the hitag2crack toolsuite |
2020-06-15 19:48:10 +08:00
## ARM
2021-12-31 18:22:10 +08:00
^[Top](#top)
2020-06-15 19:48:10 +08:00
`makefile` only at the moment
2021-12-31 18:22:10 +08:00
### Features to be used via `Makefile.platform`
^[Top](#top)
2020-12-30 08:13:17 +08:00
2020-12-30 08:30:30 +08:00
`SKIP_*`, `STANDALONE`
2020-12-30 08:13:17 +08:00
2020-12-30 08:30:30 +08:00
| Feature | Makefile | Remarks |
|-----|---|---|
2021-08-22 05:43:06 +08:00
| Platform choice | `PLATFORM=` | values: `PM3RDV4`, `PM3GENERIC`, `PM3ICOPYX` |
2020-12-30 08:30:30 +08:00
| Platform size | `PLATFORM_SIZE=` | values: `256`, `512` |
| Platform extras | `PLATFORM_EXTRAS=` | values: `BTADDON`, `FPC_USART_DEV` |
| Skip LF/HF techs in the firmware | `SKIP_`*`=1` | see `common_arm/Makefile.hal` for a list |
| Standalone mode choice | `STANDALONE=` | see `doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md` for a list |
2020-12-30 08:13:17 +08:00
2021-12-31 18:22:10 +08:00
### Other features
^[Top](#top)
2020-12-30 08:30:30 +08:00
| Feature | Makefile | Remarks |
|-----|---|---|
| ARM debug build | `DEBUG_ARM=1` | to be used with JLink and VSCode |
| Install dest dir | `DESTDIR=` | for maintainers |
| Install prefix dir | `PREFIX=` | for maintainers |
| Tag firmware image | `FWTAG=` | for maintainers |
2020-06-15 19:48:10 +08:00
## Global
2021-12-31 18:22:10 +08:00
^[Top](#top)
2020-06-15 19:48:10 +08:00
`makefile` only at the moment