1 #-----------------------------------------------------------------------------
2 # Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # See LICENSE.txt for the text of the license.
15 #-----------------------------------------------------------------------------
18 -include ..
/Makefile.platform
19 -include ..
/.Makefile.options.cache
20 ifneq ($(PLATFORM
), $(CACHED_PLATFORM
))
21 $(error platform definitions have been changed
, please
"make clean" at the root of the project
)
24 include ..
/Makefile.defs
26 ifeq ($(PLATFORM
),PM3ICOPYX
)
30 INSTALLBIN
= proxmark3
31 INSTALLSHARE
= cmdscripts lualibs luascripts pyscripts resources dictionaries
34 vpath
%.dic dictionaries
38 INCLUDES
+= -I
$(BREW_PREFIX
)/include
39 LDLIBS
+= -L
$(BREW_PREFIX
)/lib
40 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(BREW_PREFIX
)/lib
/pkgconfig
:$(BREW_PREFIX
)/opt
/qt
/lib
/pkgconfig
:$(BREW_PREFIX
)/opt
/qt5
/lib
/pkgconfig
43 ifdef ($(USE_MACPORTS
),1)
44 INCLUDES
+= -I
$(MACPORTS_PREFIX
)/include
45 LDLIBS
+= -L
$(MACPORTS_PREFIX
)/lib
46 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(MACPORTS_PREFIX
)/lib
/pkgconfig
57 AMIIBOLIBPATH
= .
/deps
/amiitool
58 AMIIBOLIBINC
= -I
$(AMIIBOLIBPATH
)
59 AMIIBOLIB
= $(AMIIBOLIBPATH
)/libamiibo.a
62 ## Cliparser / Argtable3
63 CLIPARSERLIBPATH
= .
/deps
/cliparser
64 CLIPARSERLIBINC
= -I
$(CLIPARSERLIBPATH
)
65 CLIPARSERLIB
= $(CLIPARSERLIBPATH
)/libcliparser.a
69 HARDNESTEDLIBPATH
= .
/deps
/hardnested
70 HARDNESTEDLIBINC
= -I
$(HARDNESTEDLIBPATH
)
71 HARDNESTEDLIB
= $(HARDNESTEDLIBPATH
)/libhardnested.a
75 JANSSONLIBPATH
= .
/deps
/jansson
76 JANSSONLIBINC
= -I
$(JANSSONLIBPATH
)
77 JANSSONLIB
= $(JANSSONLIBPATH
)/libjansson.a
81 # Can be used if Readline is unavailable or explicitely disabled
82 # Requires to be unpacked, see deps/get_linenoise.sh
83 LINENOISELIBPATH
= .
/deps
/linenoise
84 LINENOISELIBINC
= -I
$(LINENOISELIBPATH
)
85 LINENOISELIB
= $(LINENOISELIBPATH
)/liblinenoise.a
89 LUALIBPATH
= .
/deps
/liblua
90 LUALIBINC
= -I
$(LUALIBPATH
)
91 LUALIB
= $(LUALIBPATH
)/liblua.a
94 ifneq (,$(findstring MINGW
,$(platform
)))
98 ifeq ($(platform
),Darwin
)
107 REVENGLIBPATH
= .
/deps
/reveng
108 REVENGLIBINC
= -I
$(REVENGLIBPATH
)
109 REVENGLIB
= $(REVENGLIBPATH
)/libreveng.a
113 TINYCBORLIBPATH
= .
/deps
/tinycbor
114 TINYCBORLIBINC
= -I
$(TINYCBORLIBPATH
)
115 TINYCBORLIB
= $(TINYCBORLIBPATH
)/tinycbor.a
119 WHEREAMILIBPATH
= .
/deps
/whereami
120 WHEREAMILIBINC
= -I
$(WHEREAMILIBPATH
)
121 WHEREAMILIB
= $(WHEREAMILIBPATH
)/libwhereami.a
124 ##########################
125 # common local libraries #
126 ##########################
129 MBEDTLSLIBPATH
= ..
/common
/mbedtls
130 MBEDTLSLIBINC
= -I
$(MBEDTLSLIBPATH
)
131 MBEDTLSLIB
= $(OBJDIR
)/libmbedtls.a
132 MBEDTLSLIBCLIENTRELPATH
= ..
/..
/client
134 ########################################################
135 # optional system libraries to replace local libraries #
136 ########################################################
139 # not distributed as system library
140 STATICLIBS
+= $(AMIIBOLIB
)
141 LDLIBS
+= $(AMIIBOLIBLD
)
142 PM3INCLUDES
+= $(AMIIBOLIBINC
)
144 ## Cliparser / Argtable3
145 # not distributed as system library
146 STATICLIBS
+= $(CLIPARSERLIB
)
147 LDLIBS
+= $(CLIPARSERLIBLD
)
148 PM3INCLUDES
+= $(CLIPARSERLIBINC
)
151 # not distributed as system library
152 STATICLIBS
+= $(HARDNESTEDLIB
)
153 LDLIBS
+=$(HARDNESTEDLIBLD
)
154 PM3INCLUDES
+= $(HARDNESTEDLIBINC
)
157 # wait to see if Readline is available
160 ifneq ($(SKIPLUASYSTEM
),1)
161 ifdef MACPORTS_PREFIX
162 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua-5.2
2>/dev
/null
)
163 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua-5.2
2>/dev
/null
)
165 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua5.2
2>/dev
/null
)
166 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua5.2
2>/dev
/null
)
168 ifneq ($(LUALDLIBS
),)
170 LUALIBLD
= $(LUALDLIBS
)
171 LUALIBINC
= $(LUAINCLUDES
)
175 STATICLIBS
+= $(LUALIB
)
176 LDLIBS
+= $(LUALIBLD
)
177 PM3INCLUDES
+= $(LUALIBINC
)
180 # Jansson section needs to be after Lua to avoid interferences on macOS if a locally incompatible Lua was available, see PR 1155
181 ifneq ($(SKIPJANSSONSYSTEM
),1)
182 JANSSONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags jansson
2>/dev
/null
)
183 JANSSONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs jansson
2>/dev
/null
)
184 ifneq ($(JANSSONLDLIBS
),)
186 JANSSONLIBLD
= $(JANSSONLDLIBS
)
187 JANSSONLIBINC
= $(JANSSONINCLUDES
)
191 STATICLIBS
+= $(JANSSONLIB
)
192 LDLIBS
+= $(JANSSONLIBLD
)
193 PM3INCLUDES
+= $(JANSSONLIBINC
)
196 # system library cannot be used because it is compiled by default without CMAC support
197 STATICLIBS
+= $(MBEDTLSLIB
)
198 LDLIBS
+= $(MBEDTLSLIBLD
)
199 PM3INCLUDES
+= $(MBEDTLSLIBINC
)
202 # not distributed as system library
203 STATICLIBS
+= $(REVENGLIB
)
204 LDLIBS
+= $(REVENGLIBLD
)
205 PM3INCLUDES
+= $(REVENGLIBINC
)
208 # not distributed as system library
209 STATICLIBS
+= $(TINYCBORLIB
)
210 LDLIBS
+= $(TINYCBORLIBLD
)
211 PM3INCLUDES
+= $(TINYCBORLIBINC
)
214 ifneq ($(SKIPWHEREAMISYSTEM
),1)
215 ifneq (,$(wildcard /usr
/include/whereami.h
))
217 WHEREAMILIBLD
= -lwhereami
222 STATICLIBS
+= $(WHEREAMILIB
)
223 LDLIBS
+= $(WHEREAMILIBLD
)
224 PM3INCLUDES
+= $(WHEREAMILIBINC
)
231 # RPi Zero gcc requires -latomic
232 # but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
233 # doesn't recognize option --as-needed
234 ifneq ($(platform
),Darwin
)
235 LDLIBS
+= -Wl
,--as-needed
-latomic
-Wl
,--no-as-needed
243 BTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags bluez
2>/dev
/null
)
244 BTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs bluez
2>/dev
/null
)
246 BTLIBLD
= $(BTLDLIBS
)
247 BTLIBINC
= $(BTINCLUDES
)
252 PM3INCLUDES
+= $(BTLIBINC
)
258 # Some have no pthread, e.g. termux
259 ifneq ($(SKIPPTHREAD
),1)
263 ## Python3 (optional)
264 ifneq ($(SKIPPYTHON
),1)
265 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3
2>/dev
/null
)
266 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3
2>/dev
/null
)
267 ifneq ($(PYTHONLDLIBS
),)
268 PYTHONLIBLD
= $(PYTHONLDLIBS
)
269 PYTHONLIBINC
= $(PYTHONINCLUDES
)
272 # since python3.8, applications willing to embed python must use -embed:
273 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3-embed
2>/dev
/null
)
274 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3-embed
2>/dev
/null
)
275 ifneq ($(PYTHONLDLIBS
),)
276 PYTHONLIBLD
= $(PYTHONLDLIBS
)
277 PYTHONLIBINC
= $(PYTHONINCLUDES
)
282 LDLIBS
+= $(PYTHONLIBLD
)
283 PM3INCLUDES
+= $(PYTHONLIBINC
)
285 ## QT5 (or QT4 fallback) (optional)
287 # Check for correctly configured Qt5
288 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags Qt5Core Qt5Widgets
2>/dev
/null
)
289 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs Qt5Core Qt5Widgets
2>/dev
/null
)
290 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/moc
291 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/uic
292 QMAKE
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/qmake
296 # if Qt5 not found check for correctly configured Qt4
297 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags QtCore QtGui
2>/dev
/null
)
298 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs QtCore QtGui
2>/dev
/null
)
299 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=moc_location QtCore
)
300 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=uic_location QtCore
)
301 QMAKE
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=exec_prefix QtCore
)/bin
/qmake
304 # if both pkg-config commands failed, search in common places
306 ifneq ($(wildcard $(QTDIR
)/include/QtWidgets
),)
308 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
-I
$(QTDIR
)/include/QtWidgets
309 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQt5Core
-lQt5Gui
-lQt5Widgets
313 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
314 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQtCore4
-lQtGui4
316 MOC
= $(QTDIR
)/bin
/moc
317 UIC
= $(QTDIR
)/bin
/uic
318 QMAKE
= $(QTDIR
)/bin
/qmake
325 LDLIBS
+= $(QTLDLIBS
)
326 CXXINCLUDES
+= $(QTINCLUDES
)
329 ifneq ($(SKIPREADLINE
),1)
331 LDLIBS
+= -L
$(BREW_PREFIX
)/opt
/readline
/lib
332 PM3INCLUDES
+= -I
$(BREW_PREFIX
)/opt
/readline
/include
335 ifeq ($(USE_MACPORTS
),1)
336 PM3INCLUDES
+= -I
$(MACPORTS_PREFIX
)/include/readline
343 ifneq ($(SKIPLINENOISE
),1)
344 ifneq (,$(wildcard $(LINENOISELIBPATH
)))
345 STATICLIBS
+= $(LINENOISELIB
)
346 LDLIBS
+= $(LINENOISELIBLD
)
347 PM3INCLUDES
+= $(LINENOISELIBINC
)
348 LINENOISE_LOCAL_FOUND
= 1
357 ifneq ("$(wildcard src/pm3_luawrap.c)","")
360 ifeq ($(PYTHON_FOUND
),1)
361 ifneq ("$(wildcard src/pm3_pywrap.c)","")
362 SWIG_PYTHON_FOUND
= 1
366 #######################################################################################################
367 CFLAGS ?
= $(DEFCFLAGS
)
368 CFLAGS
+= $(MYDEFS
) $(MYCFLAGS
) $(MYINCLUDES
)
370 # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
371 PM3CFLAGS
= $(CFLAGS
)
372 PM3CFLAGS
+= -g
-I.
/src
-I.
/include -I..
/include -I..
/common
-I..
/common_fpga
$(PM3INCLUDES
) $(INCLUDES
)
374 #PM3CFLAGS += -std=c11 -pedantic
377 ifneq (,$(findstring MINGW
,$(platform
)))
378 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
379 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
380 # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
381 # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
382 PM3CFLAGS
+= -D_ISOC99_SOURCE
383 PM3CFLAGS
+= -mno-ms-bitfields
-fexec-charset
=cp850
386 ifeq ($(READLINE_FOUND
),1)
387 PM3CFLAGS
+= -DHAVE_READLINE
390 ifeq ($(LINENOISE_LOCAL_FOUND
),1)
391 PM3CFLAGS
+= -DHAVE_LINENOISE
395 PM3CFLAGS
+= -DHAVE_BLUEZ
398 ifeq ($(PYTHON_FOUND
),1)
399 PM3CFLAGS
+= -DHAVE_PYTHON
402 ifeq ($(SWIG_LUA_FOUND
),1)
403 PM3CFLAGS
+= -DHAVE_LUA_SWIG
405 ifeq ($(SWIG_PYTHON_FOUND
),1)
406 PM3CFLAGS
+= -DHAVE_PYTHON_SWIG
409 PM3CFLAGS
+= -DHAVE_SNPRINTF
411 CXXFLAGS ?
= -Wall
-O3
412 CXXFLAGS
+= $(MYDEFS
) $(MYCXXFLAGS
) $(MYINCLUDES
)
414 PM3CXXFLAGS
= $(CXXFLAGS
)
415 PM3CXXFLAGS
+= -I..
/include -I.
/include
418 PM3CFLAGS
+= -DHAVE_GUI
419 PM3CXXFLAGS
+= -DQT_NO_DEBUG
420 ifeq ($(QT5_FOUND
),1)
421 # On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
422 PM3CXXFLAGS
+= -fPIC
-std
=c
++11
426 PM3CXXFLAGS
+= -DHAVE_SNPRINTF
428 LDFLAGS ?
= $(DEFLDFLAGS
)
429 LDFLAGS
+= $(MYLDFLAGS
)
431 PM3LDFLAGS
= $(LDFLAGS
)
432 ifeq ($(platform
),Darwin
)
433 PM3LDFLAGS
+= -framework Foundation
-framework AppKit
440 $(info ===================================================================)
441 $(info Version
info: $(shell ..
/tools
/mkversion.sh
--short
2>/dev
/null
))
442 $(info Client platform
: $(platform
))
445 $(info GUI support
: skipped
)
448 ifeq ($(QT5_FOUND
),1)
449 $(info GUI support
: QT5 found
, enabled
($(shell QT_SELECT
=5 $(QMAKE
) -v
2>/dev
/null|grep
-o
'Qt version.*')))
451 $(info GUI support
: QT4 found
, enabled
($(shell QT_SELECT
=4 $(QMAKE
) -v
2>/dev
/null|grep
-o
'Qt version.*')))
454 $(info GUI support
: QT not found
, disabled
)
459 $(info native BT support
: skipped
)
462 $(info native BT support
: Bluez found
, enabled
)
464 $(info native BT support
: Bluez not found
, disabled
)
468 ifeq ($(SKIPJANSSONSYSTEM
),1)
469 $(info Jansson library
: local library forced
)
470 else ifeq ($(JANSSON_FOUND
),1)
471 $(info Jansson library
: system library found
)
473 $(info Jansson library
: system library not found
, using local library
)
476 ifeq ($(SKIPLUASYSTEM
),1)
477 $(info Lua library
: local library forced
)
479 ifeq ($(LUA_FOUND
),1)
480 $(info Lua library
: system library found
)
482 $(info Lua library
: system library not found
, using local library
)
486 ifeq ($(SKIPPYTHON
),1)
487 $(info Python3 library
: skipped
)
489 ifeq ($(PYTHON_FOUND
),1)
490 $(info Python3 library
: Python3 v
$(shell $(PKG_CONFIG_ENV
) pkg-config
--modversion python3
) found
, enabled
)
492 $(info Python3 library
: Python3 not found
, disabled
)
496 ifeq ($(SKIPREADLINE
),1)
497 $(info Readline library
: skipped
)
499 ifeq ($(READLINE_FOUND
),1)
500 $(info Readline library
: enabled
)
502 $(info Readline library
: Readline not found
, disabled
)
506 ifneq ($(READLINE_FOUND
),1)
507 ifeq ($(SKIPLINENOISE
),1)
508 $(info Linenoise library
: skipped
)
510 ifeq ($(LINENOISE_LOCAL_FOUND
),1)
511 $(info Linenoise library
: enabled
)
513 $(info Linenoise library
: Linenoise not found
, disabled
)
518 ifeq ($(SKIPWHEREAMISYSTEM
),1)
519 $(info Whereami library
: local library forced
)
521 ifeq ($(WHEREAMI_FOUND
),1)
522 $(info Whereami library
: system library found
)
524 $(info Whereami library
: system library not found
, using local library
)
528 ifeq ($(SWIG_LUA_FOUND
),1)
529 $(info Lua SWIG
: wrapper found
)
531 ifeq ($(SWIG_PYTHON_FOUND
),1)
532 $(info Python SWIG
: wrapper found
)
535 $(info compiler version
: $(shell $(CC
) --version|head
-n
1))
536 $(info ===================================================================)
542 # Flags to generate temporary dependency files
543 DEPFLAGS
= -MT
$@
-MMD
-MP
-MF
$(OBJDIR
)/$*.Td
544 # make temporary to final dependency files after successful compilation
545 POSTCOMPILE
= $(MV
) -f
$(OBJDIR
)/$*.Td
$(OBJDIR
)/$*.d
&& $(TOUCH
) $@
551 SRCS
= mifare
/aiddesfire.c \
558 cmdflashmemspiffs.c \
640 emv
/crypto_polarssl.c\
650 emv
/test/crypto_test.c\
651 emv
/test/cryptotest.c\
655 fido
/additional_ca.c \
659 ksx6924
/ksx6924core.c \
660 cipurse
/cipursecore.c \
661 cipurse
/cipursecrypto.c \
662 cipurse
/cipursetest.c \
669 iso7816
/iso7816core.c \
671 loclass
/cipherutils.c \
672 loclass
/elite_crack.c \
675 mifare
/desfirecrypto.c \
676 mifare
/desfirecore.c \
677 mifare
/desfiresecurechan.c \
678 mifare
/desfiretest.c \
679 mifare
/gallaghercore.c \
683 mifare
/mifaredefault.c \
684 mifare
/mifarehost.c \
700 wiegand_formatutils.c
703 SRCS
+= bucketsort.c \
720 ifeq ($(SWIG_LUA_FOUND
),1)
721 SWIGSRCS
+= pm3_luawrap.c
723 ifeq ($(SWIG_PYTHON_FOUND
),1)
724 SWIGSRCS
+= pm3_pywrap.c
729 CXXSRCS
= proxgui.
cpp proxguiqt.
cpp proxguiqt.moc.
cpp
731 CXXSRCS
= guidummy.
cpp
735 ifeq ($(platform
),Darwin
)
736 OBJCSRCS
= util_darwin.m
739 OBJS
= $(SRCS
:%.c
=$(OBJDIR
)/%.o
)
740 OBJS
+= $(SWIGSRCS
:%.c
=$(OBJDIR
)/%.o
)
741 OBJS
+= $(CXXSRCS
:%.
cpp=$(OBJDIR
)/%.o
)
742 OBJS
+= $(OBJCSRCS
:%.m
=$(OBJDIR
)/%.o
)
746 CLEAN
= $(BINS
) src
/version_pm3.c src
/*.moc.
cpp src
/ui
/ui_overlays.h src
/ui
/ui_image.h lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
747 # transition: cleaning also old path stuff
748 CLEAN
+= flasher
*.moc.
cpp ui
/ui_overlays.h ui
/ui_image.h
754 # need to assign dependancies to build these first...
757 all-static
: LDLIBS
:=-static
$(LDLIBS
)
760 proxmark3
: $(OBJS
) $(STATICLIBS
) lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
762 # $(Q)$(CXX) $(PM3LDFLAGS) $(OBJS) $(STATICLIBS) $(LDLIBS) -o $@
763 $(Q
)$(CXX
) $(PM3CFLAGS
) $(PM3LDFLAGS
) $(OBJS
) $(STATICLIBS
) $(LDLIBS
) -o
$@
765 src
/proxgui.
cpp: src
/ui
/ui_overlays.h src
/ui
/ui_image.h
767 src
/proxguiqt.moc.
cpp: src
/proxguiqt.h
771 src
/ui
/ui_overlays.h
: src
/ui
/overlays.ui
775 src
/ui
/ui_image.h
: src
/ui
/image.ui
779 lualibs
/pm3_cmd.lua
: ..
/include/pm3_cmd.h
781 $(Q
)awk
-f pm3_cmd_h2lua.awk
$^
> $@
783 lualibs
/mfc_default_keys.lua
: mfc_default_keys.dic
785 $(Q
)awk
-f default_keys_dic2lua.awk
$^
> $@
789 $(Q
)$(RMDIR
) $(OBJDIR
)
790 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) clean
791 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) clean
792 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) clean
793 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) clean
794 ifeq ($(LINENOISE_LOCAL_FOUND
), 1)
795 $(Q
)$(MAKE
) --no-print-directory
-C
$(LINENOISELIBPATH
) clean
797 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) clean
798 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) clean
799 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) clean
800 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) clean
801 @
# Just in case someone compiled within these dirs:
802 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) clean
805 $(info [@
] Installing client to
$(DESTDIR
)$(PREFIX
)...
)
806 ifneq (,$(INSTALLBIN
))
807 $(Q
)$(INSTALLSUDO
) $(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
808 $(Q
)$(INSTALLSUDO
) $(CP
) $(INSTALLBIN
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
810 ifneq (,$(INSTALLSHARE
))
811 $(Q
)$(INSTALLSUDO
) $(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
812 $(Q
)$(INSTALLSUDO
) $(CP
) $(INSTALLSHARE
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
813 $(Q
)$(INSTALLSUDO
) $(CP
) src
/pm3.py
$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)/pyscripts
818 $(info [@
] Uninstalling client from
$(DESTDIR
)$(PREFIX
)...
)
819 ifneq (,$(INSTALLBIN
))
820 $(Q
)$(INSTALLSUDO
) $(RM
) $(foreach tool
,$(INSTALLBIN
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)$(PATHSEP
)$(notdir $(tool
)))
822 ifneq (,$(INSTALLSHARE
))
823 $(Q
)$(INSTALLSUDO
) $(RMDIR
) $(foreach tool
,$(INSTALLSHARE
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)$(PATHSEP
)$(notdir $(tool
)))
828 $(info [=] TAR ..
/proxmark3-
$(platform
)-bin.
tar)
829 $(Q
)$(TAR
) $(TARFLAGS
) ..
/proxmark3-
$(platform
)-bin.
tar $(BINS
:%=client
/%) $(WINBINS
:%=client
/%)
831 ###########################
832 # local libraries targets #
833 ###########################
836 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) all
838 $(CLIPARSERLIB
): .FORCE
840 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) all
842 $(HARDNESTEDLIB
): .FORCE
844 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) all
846 $(JANSSONLIB
): .FORCE
847 ifneq ($(JANSSON_FOUND
),1)
849 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) all
852 $(LINENOISELIB
): .FORCE
853 ifeq ($(LINENOISE_LOCAL_FOUND
), 1)
855 $(Q
)$(MAKE
) --no-print-directory
-C
$(LINENOISELIBPATH
) all
859 ifneq ($(LUA_FOUND
),1)
860 $(info [*] MAKE
$@ for
$(LUAPLATFORM
))
861 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) $(LUAPLATFORM
)
864 $(MBEDTLSLIB
): .FORCE
866 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) OBJDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
)/mbedtls BINDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
) all
870 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) all
872 $(TINYCBORLIB
): .FORCE
874 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) all
876 $(WHEREAMILIB
): .FORCE
877 ifneq ($(WHEREAMI_FOUND
),1)
879 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) all
886 src
/pm3_luawrap.c
: pm3.i
888 $(Q
)$(SWIG
) -lua
-o
$@
$<
890 src
/pm3_pywrap.c
: pm3.i
892 $(Q
)$(SWIG
) -python
-o
$@
$<
898 .PHONY
: all clean install uninstall tarbin .FORCE
900 # version_pm3.c should be remade on every compilation
901 src
/version_pm3.c
: default_version_pm3.c .FORCE
905 # easy printing of MAKE VARIABLES
906 print-
%: ; @echo
$* = $($*)
908 # SWIG files emit a number of warnings, we've to ignore them
910 $(OBJDIR
)/%wrap.o
: %wrap.c
$(OBJDIR
)/%.d
912 $(Q
)$(MKDIR
) $(dir $@
)
913 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -Wno-missing-prototypes
-Wno-missing-declarations
-Wno-missing-field-initializers
-c
-o
$@
$<
917 $(OBJDIR
)/%.o
: %.c
$(OBJDIR
)/%.d
919 $(Q
)$(MKDIR
) $(dir $@
)
920 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
924 $(OBJDIR
)/%.o
: %.
cpp $(OBJDIR
)/%.d
926 $(Q
)$(MKDIR
) $(dir $@
)
927 $(Q
)$(CXX
) $(DEPFLAGS
) $(PM3CXXFLAGS
) $(CXXINCLUDES
) -c
-o
$@
$<
931 $(OBJDIR
)/%.o
: %.m
$(OBJDIR
)/%.d
933 $(Q
)$(MKDIR
) $(dir $@
)
934 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
937 DEPENDENCY_FILES
= $(patsubst %.c
, $(OBJDIR
)/%.d
, $(SRCS
)) \
938 $(patsubst %wrap.c
, $(OBJDIR
)/%.d
, $(SWIGSRCS
)) \
939 $(patsubst %.
cpp, $(OBJDIR
)/%.d
, $(CXXSRCS
)) \
940 $(patsubst %.m
, $(OBJDIR
)/%.d
, $(OBJCSRCS
))
942 $(DEPENDENCY_FILES
): ;
943 .PRECIOUS
: $(DEPENDENCY_FILES
)
945 -include $(DEPENDENCY_FILES
)