1 #-----------------------------------------------------------------------------
2 # This code is licensed to you under the terms of the GNU GPL, version 2 or,
3 # at your option, any later version. See the LICENSE.txt file for the text of
5 #-----------------------------------------------------------------------------
7 include ..
/Makefile.defs
9 -include ..
/Makefile.platform
10 -include ..
/.Makefile.options.cache
11 ifneq ($(PLATFORM
), $(CACHED_PLATFORM
))
12 $(error platform definitions have been changed
, please
"make clean" at the root of the project
)
16 ifeq ($(PLATFORM
),PM3ICOPYX
)
20 INSTALLBIN
= proxmark3
21 INSTALLSHARE
= cmdscripts lualibs luascripts pyscripts resources dictionaries
24 vpath
%.dic dictionaries
29 INCLUDES
+= -I
$(MACPORTS_PREFIX
)/include
30 LDLIBS
+= -L
$(MACPORTS_PREFIX
)/lib
31 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(MACPORTS_PREFIX
)/lib
/pkgconfig
32 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(MACPORTS_PREFIX
)/libexec
/qt
/lib
/pkgconfig
33 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(MACPORTS_PREFIX
)/libexec
/qt5
/lib
/pkgconfig
35 INCLUDES
+= -I
$(BREW_PREFIX
)/include
36 LDLIBS
+= -L
$(BREW_PREFIX
)/lib
37 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(BREW_PREFIX
)/opt
/qt
/lib
/pkgconfig
38 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(BREW_PREFIX
)/opt
/qt5
/lib
/pkgconfig
47 AMIIBOLIBPATH
= .
/deps
/amiitool
48 AMIIBOLIBINC
= -I
$(AMIIBOLIBPATH
)
49 AMIIBOLIB
= $(AMIIBOLIBPATH
)/libamiibo.a
52 ## Cliparser / Argtable3
53 CLIPARSERLIBPATH
= .
/deps
/cliparser
54 CLIPARSERLIBINC
= -I
$(CLIPARSERLIBPATH
)
55 CLIPARSERLIB
= $(CLIPARSERLIBPATH
)/libcliparser.a
59 HARDNESTEDLIBPATH
= .
/deps
/hardnested
60 HARDNESTEDLIBINC
= -I
$(HARDNESTEDLIBPATH
)
61 HARDNESTEDLIB
= $(HARDNESTEDLIBPATH
)/libhardnested.a
65 JANSSONLIBPATH
= .
/deps
/jansson
66 JANSSONLIBINC
= -I
$(JANSSONLIBPATH
)
67 JANSSONLIB
= $(JANSSONLIBPATH
)/libjansson.a
71 LUALIBPATH
= .
/deps
/liblua
72 LUALIBINC
= -I
$(LUALIBPATH
)
73 LUALIB
= $(LUALIBPATH
)/liblua.a
76 ifneq (,$(findstring MINGW
,$(platform
)))
79 ifeq ($(platform
),Darwin
)
88 REVENGLIBPATH
= .
/deps
/reveng
89 REVENGLIBINC
= -I
$(REVENGLIBPATH
)
90 REVENGLIB
= $(REVENGLIBPATH
)/libreveng.a
94 TINYCBORLIBPATH
= .
/deps
/tinycbor
95 TINYCBORLIBINC
= -I
$(TINYCBORLIBPATH
)
96 TINYCBORLIB
= $(TINYCBORLIBPATH
)/tinycbor.a
100 WHEREAMILIBPATH
= .
/deps
/whereami
101 WHEREAMILIBINC
= -I
$(WHEREAMILIBPATH
)
102 WHEREAMILIB
= $(WHEREAMILIBPATH
)/libwhereami.a
105 ##########################
106 # common local libraries #
107 ##########################
110 MBEDTLSLIBPATH
= ..
/common
/mbedtls
111 MBEDTLSLIBINC
= -I
$(MBEDTLSLIBPATH
)
112 MBEDTLSLIB
= $(OBJDIR
)/libmbedtls.a
113 MBEDTLSLIBCLIENTRELPATH
= ..
/..
/client
115 ########################################################
116 # optional system libraries to replace local libraries #
117 ########################################################
120 # not distributed as system library
121 STATICLIBS
+= $(AMIIBOLIB
)
122 LDLIBS
+= $(AMIIBOLIBLD
)
123 INCLUDES
+= $(AMIIBOLIBINC
)
125 ## Cliparser / Argtable3
126 # not distributed as system library
127 STATICLIBS
+= $(CLIPARSERLIB
)
128 LDLIBS
+= $(CLIPARSERLIBLD
)
129 INCLUDES
+= $(CLIPARSERLIBINC
)
132 # not distributed as system library
133 STATICLIBS
+= $(HARDNESTEDLIB
)
134 LDLIBS
+=$(HARDNESTEDLIBLD
)
135 INCLUDES
+= $(HARDNESTEDLIBINC
)
138 ifneq ($(SKIPLUASYSTEM
),1)
139 ifdef MACPORTS_PREFIX
140 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua-5.2
2>/dev
/null
)
141 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua-5.2
2>/dev
/null
)
143 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua5.2
2>/dev
/null
)
144 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua5.2
2>/dev
/null
)
146 ifneq ($(LUALDLIBS
),)
148 LUALIBLD
= $(LUALDLIBS
)
149 LUALIBINC
= $(LUAINCLUDES
)
153 STATICLIBS
+= $(LUALIB
)
154 LDLIBS
+= $(LUALIBLD
)
155 INCLUDES
+= $(LUALIBINC
)
158 # Jansson section needs to be after Lua to avoid interferences on macOS if a locally incompatible Lua was available, see PR 1155
159 ifneq ($(SKIPJANSSONSYSTEM
),1)
160 JANSSONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags jansson
2>/dev
/null
)
161 JANSSONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs jansson
2>/dev
/null
)
162 ifneq ($(JANSSONLDLIBS
),)
164 JANSSONLIBLD
= $(JANSSONLDLIBS
)
165 JANSSONLIBINC
= $(JANSSONINCLUDES
)
169 STATICLIBS
+= $(JANSSONLIB
)
170 LDLIBS
+= $(JANSSONLIBLD
)
171 INCLUDES
+= $(JANSSONLIBINC
)
174 # system library cannot be used because it is compiled by default without CMAC support
175 STATICLIBS
+= $(MBEDTLSLIB
)
176 LDLIBS
+= $(MBEDTLSLIBLD
)
177 INCLUDES
+= $(MBEDTLSLIBINC
)
180 # not distributed as system library
181 STATICLIBS
+= $(REVENGLIB
)
182 LDLIBS
+= $(REVENGLIBLD
)
183 INCLUDES
+= $(REVENGLIBINC
)
186 # not distributed as system library
187 STATICLIBS
+= $(TINYCBORLIB
)
188 LDLIBS
+= $(TINYCBORLIBLD
)
189 INCLUDES
+= $(TINYCBORLIBINC
)
192 ifneq ($(SKIPWHEREAMISYSTEM
),1)
193 ifneq (,$(wildcard /usr
/include/whereami.h
))
195 WHEREAMILIBLD
= -lwhereami
200 STATICLIBS
+= $(WHEREAMILIB
)
201 LDLIBS
+= $(WHEREAMILIBLD
)
202 INCLUDES
+= $(WHEREAMILIBINC
)
209 # RPi Zero gcc requires -latomic
210 # but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
211 # doesn't recognize option --as-needed
212 ifneq ($(platform
),Darwin
)
213 LDLIBS
+= -Wl
,--as-needed
-latomic
-Wl
,--no-as-needed
221 BTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags bluez
2>/dev
/null
)
222 BTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs bluez
2>/dev
/null
)
224 BTLIBLD
= $(BTLDLIBS
)
225 BTLIBINC
= $(BTINCLUDES
)
230 INCLUDES
+= $(BTLIBINC
)
236 # Some have no pthread, e.g. termux
237 ifneq ($(SKIPPTHREAD
),1)
241 ## Python3 (optional)
242 ifneq ($(SKIPPYTHON
),1)
243 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3
2>/dev
/null
)
244 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3
2>/dev
/null
)
245 ifneq ($(PYTHONLDLIBS
),)
246 PYTHONLIBLD
= $(PYTHONLDLIBS
)
247 PYTHONLIBINC
= $(PYTHONINCLUDES
)
250 # since python3.8, applications willing to embed python must use -embed:
251 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3-embed
2>/dev
/null
)
252 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3-embed
2>/dev
/null
)
253 ifneq ($(PYTHONLDLIBS
),)
254 PYTHONLIBLD
= $(PYTHONLDLIBS
)
255 PYTHONLIBINC
= $(PYTHONINCLUDES
)
260 LDLIBS
+= $(PYTHONLIBLD
)
261 INCLUDES
+= $(PYTHONLIBINC
)
263 ## QT5 (or QT4 fallback) (optional)
265 # Check for correctly configured Qt5
266 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags Qt5Core Qt5Widgets
2>/dev
/null
)
267 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs Qt5Core Qt5Widgets
2>/dev
/null
)
268 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/moc
269 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/uic
273 # if Qt5 not found check for correctly configured Qt4
274 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags QtCore QtGui
2>/dev
/null
)
275 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs QtCore QtGui
2>/dev
/null
)
276 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=moc_location QtCore
)
277 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=uic_location QtCore
)
280 # if both pkg-config commands failed, search in common places
282 ifneq ($(wildcard $(QTDIR
)/include/QtWidgets
),)
284 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
-I
$(QTDIR
)/include/QtWidgets
285 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQt5Core
-lQt5Gui
-lQt5Widgets
289 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
290 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQtCore4
-lQtGui4
292 MOC
= $(QTDIR
)/bin
/moc
293 UIC
= $(QTDIR
)/bin
/uic
300 LDLIBS
+= $(QTLDLIBS
)
301 CXXINCLUDES
+= $(QTINCLUDES
)
304 ifneq ($(SKIPREADLINE
),1)
306 ifdef MACPORTS_PREFIX
307 INCLUDES
+= -I
$(MACPORTS_PREFIX
)/include/readline
309 LDLIBS
+= -L
$(BREW_PREFIX
)/opt
/readline
/lib
310 INCLUDES
+= -I
$(BREW_PREFIX
)/opt
/readline
/include
321 ifneq ("$(wildcard src/pm3_luawrap.c)","")
324 ifeq ($(PYTHON_FOUND
),1)
325 ifneq ("$(wildcard src/pm3_pywrap.c)","")
326 SWIG_PYTHON_FOUND
= 1
330 #######################################################################################################
331 CFLAGS ?
= $(DEFCFLAGS
)
332 # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
333 PM3CFLAGS
= $(CFLAGS
)
334 PM3CFLAGS
+= -I.
/src
-I.
/include -I..
/include -I..
/common
-I..
/common_fpga
$(INCLUDES
)
336 #PM3CFLAGS += -std=c11 -pedantic
339 ifneq (,$(findstring MINGW
,$(platform
)))
340 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
341 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
342 # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
343 # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
344 PM3CFLAGS
+= -D_ISOC99_SOURCE
345 PM3CFLAGS
+= -mno-ms-bitfields
-fexec-charset
=cp850
348 ifeq ($(READLINE_FOUND
),1)
349 PM3CFLAGS
+= -DHAVE_READLINE
353 PM3CFLAGS
+= -DHAVE_BLUEZ
356 ifeq ($(PYTHON_FOUND
),1)
357 PM3CFLAGS
+= -DHAVE_PYTHON
360 ifeq ($(SWIG_LUA_FOUND
),1)
361 PM3CFLAGS
+= -DHAVE_LUA_SWIG
363 ifeq ($(SWIG_PYTHON_FOUND
),1)
364 PM3CFLAGS
+= -DHAVE_PYTHON_SWIG
367 CXXFLAGS ?
= -Wall
-Werror
-O3
368 PM3CXXFLAGS
= $(CXXFLAGS
)
369 PM3CXXFLAGS
+= -I..
/include -I.
/include
372 PM3CFLAGS
+= -DHAVE_GUI
373 PM3CXXFLAGS
+= -DQT_NO_DEBUG
374 ifeq ($(QT5_FOUND
),1)
375 # On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
376 PM3CXXFLAGS
+= -fPIC
-std
=c
++11
380 LDFLAGS ?
= $(DEFLDFLAGS
)
381 PM3LDFLAGS
= $(LDFLAGS
)
382 ifeq ($(platform
),Darwin
)
383 PM3LDFLAGS
+= -framework Foundation
-framework AppKit
390 $(info ===================================================================)
391 $(info Client platform
: $(platform
))
394 $(info GUI support
: skipped
)
397 ifeq ($(QT5_FOUND
),1)
398 $(info GUI support
: QT5 found
, enabled
($(shell QT_SELECT
=5 qmake
-v
2>/dev
/null|grep
-o
'Qt version.*')))
400 $(info GUI support
: QT4 found
, enabled
($(shell QT_SELECT
=4 qmake
-v
2>/dev
/null|grep
-o
'Qt version.*')))
403 $(info GUI support
: QT not found
, disabled
)
408 $(info native BT support
: skipped
)
411 $(info native BT support
: Bluez found
, enabled
)
413 $(info native BT support
: Bluez not found
, disabled
)
417 ifeq ($(SKIPJANSSONSYSTEM
),1)
418 $(info Jansson library
: local library forced
)
419 else ifeq ($(JANSSON_FOUND
),1)
420 $(info Jansson library
: system library found
)
422 $(info Jansson library
: system library not found
, using local library
)
425 ifeq ($(SKIPLUASYSTEM
),1)
426 $(info Lua library
: local library forced
)
428 ifeq ($(LUA_FOUND
),1)
429 $(info Lua library
: system library found
)
431 $(info Lua library
: system library not found
, using local library
)
435 ifeq ($(SKIPPYTHON
),1)
436 $(info Python3 library
: skipped
)
438 ifeq ($(PYTHON_FOUND
),1)
439 $(info Python3 library
: Python3 v
$(shell pkg-config
--modversion python3
) found
, enabled
)
441 $(info Python3 library
: Python3 not found
, disabled
)
445 ifeq ($(SKIPREADLINE
),1)
446 $(info Readline library
: skipped
)
448 ifeq ($(READLINE_FOUND
),1)
449 $(info Readline library
: enabled
)
451 $(info Readline library
: Readline not found
, disabled
)
455 ifeq ($(SKIPWHEREAMISYSTEM
),1)
456 $(info Whereami library
: local library forced
)
458 ifeq ($(WHEREAMI_FOUND
),1)
459 $(info Whereami library
: system library found
)
461 $(info Whereami library
: system library not found
, using local library
)
465 ifeq ($(SWIG_LUA_FOUND
),1)
466 $(info Lua SWIG
: wrapper found
)
468 ifeq ($(SWIG_PYTHON_FOUND
),1)
469 $(info Python SWIG
: wrapper found
)
472 $(info compiler version
: $(shell $(CC
) --version|head
-n
1))
473 $(info ===================================================================)
479 # Flags to generate temporary dependency files
480 DEPFLAGS
= -MT
$@
-MMD
-MP
-MF
$(OBJDIR
)/$*.Td
481 # make temporary to final dependency files after successful compilation
482 POSTCOMPILE
= $(MV
) -f
$(OBJDIR
)/$*.Td
$(OBJDIR
)/$*.d
&& $(TOUCH
) $@
488 SRCS
= mifare
/aiddesfire.c \
494 cmdflashmemspiffs.c \
569 emv
/crypto_polarssl.c\
579 emv
/test/crypto_test.c\
580 emv
/test/cryptotest.c\
584 fido
/additional_ca.c \
588 cipurse
/cipursecore.c \
589 cipurse
/cipursecrypto.c \
590 cipurse
/cipursetest.c \
597 iso7816
/iso7816core.c \
599 loclass
/cipherutils.c \
600 loclass
/elite_crack.c \
603 mifare
/desfirecrypto.c \
604 mifare
/desfirecore.c \
605 mifare
/desfiresecurechan.c \
606 mifare
/desfiretest.c \
610 mifare
/mifaredefault.c \
611 mifare
/mifarehost.c \
628 wiegand_formatutils.c
631 SRCS
+= bucketsort.c \
649 ifeq ($(SWIG_LUA_FOUND
),1)
650 SWIGSRCS
+= pm3_luawrap.c
652 ifeq ($(SWIG_PYTHON_FOUND
),1)
653 SWIGSRCS
+= pm3_pywrap.c
658 CXXSRCS
= proxgui.
cpp proxguiqt.
cpp proxguiqt.moc.
cpp
660 CXXSRCS
= guidummy.
cpp
664 ifeq ($(platform
),Darwin
)
665 OBJCSRCS
= util_darwin.m
668 OBJS
= $(SRCS
:%.c
=$(OBJDIR
)/%.o
)
669 OBJS
+= $(SWIGSRCS
:%.c
=$(OBJDIR
)/%.o
)
670 OBJS
+= $(CXXSRCS
:%.
cpp=$(OBJDIR
)/%.o
)
671 OBJS
+= $(OBJCSRCS
:%.m
=$(OBJDIR
)/%.o
)
675 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
676 # transition: cleaning also old path stuff
677 CLEAN
+= flasher
*.moc.
cpp ui
/ui_overlays.h ui
/ui_image.h
683 # need to assign dependancies to build these first...
686 all-static
: LDLIBS
:=-static
$(LDLIBS
)
689 proxmark3
: $(OBJS
) $(STATICLIBS
) lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
691 $(Q
)$(LD
) $(PM3LDFLAGS
) $(OBJS
) $(STATICLIBS
) $(LDLIBS
) -o
$@
693 src
/proxgui.
cpp: src
/ui
/ui_overlays.h src
/ui
/ui_image.h
695 src
/proxguiqt.moc.
cpp: src
/proxguiqt.h
699 src
/ui
/ui_overlays.h
: src
/ui
/overlays.ui
703 src
/ui
/ui_image.h
: src
/ui
/image.ui
707 lualibs
/pm3_cmd.lua
: ..
/include/pm3_cmd.h
709 $(Q
)awk
-f pm3_cmd_h2lua.awk
$^
> $@
711 lualibs
/mfc_default_keys.lua
: mfc_default_keys.dic
713 $(Q
)awk
-f default_keys_dic2lua.awk
$^
> $@
717 $(Q
)$(RMDIR
) $(OBJDIR
)
718 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) clean
719 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) clean
720 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) clean
721 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) clean
722 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) clean
723 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) clean
724 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) clean
725 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) clean
726 @
# Just in case someone compiled within these dirs:
727 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) clean
730 $(info [@
] Installing client to
$(DESTDIR
)$(PREFIX
)...
)
731 ifneq (,$(INSTALLBIN
))
732 $(Q
)$(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
733 $(Q
)$(CP
) $(INSTALLBIN
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
735 ifneq (,$(INSTALLSHARE
))
736 $(Q
)$(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
737 $(Q
)$(CP
) $(INSTALLSHARE
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
738 $(Q
)$(CP
) src
/pm3.py
$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)/pyscripts
743 $(info [@
] Uninstalling client from
$(DESTDIR
)$(PREFIX
)...
)
744 ifneq (,$(INSTALLBIN
))
745 $(Q
)$(RM
) $(foreach tool
,$(INSTALLBIN
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)$(PATHSEP
)$(notdir $(tool
)))
747 ifneq (,$(INSTALLSHARE
))
748 $(Q
)$(RMDIR
) $(foreach tool
,$(INSTALLSHARE
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)$(PATHSEP
)$(notdir $(tool
)))
753 $(info [=] TAR ..
/proxmark3-
$(platform
)-bin.
tar)
754 $(Q
)$(TAR
) $(TARFLAGS
) ..
/proxmark3-
$(platform
)-bin.
tar $(BINS
:%=client
/%) $(WINBINS
:%=client
/%)
756 ###########################
757 # local libraries targets #
758 ###########################
761 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) all
763 $(CLIPARSERLIB
): .FORCE
765 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) all
767 $(HARDNESTEDLIB
): .FORCE
769 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) all
771 $(JANSSONLIB
): .FORCE
772 ifneq ($(JANSSON_FOUND
),1)
774 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) all
778 ifneq ($(LUA_FOUND
),1)
779 $(info [*] MAKE
$@ for
$(LUAPLATFORM
))
780 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) $(LUAPLATFORM
)
783 $(MBEDTLSLIB
): .FORCE
785 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) OBJDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
)/mbedtls BINDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
) all
789 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) all
791 $(TINYCBORLIB
): .FORCE
793 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) all
795 $(WHEREAMILIB
): .FORCE
796 ifneq ($(WHEREAMI_FOUND
),1)
798 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) all
805 src
/pm3_luawrap.c
: pm3.i
807 $(Q
)$(SWIG
) -lua
-o
$@
$<
809 src
/pm3_pywrap.c
: pm3.i
811 $(Q
)$(SWIG
) -python
-o
$@
$<
817 .PHONY
: all clean install uninstall tarbin .FORCE
819 # version_pm3.c should be remade on every compilation
820 src
/version_pm3.c
: default_version_pm3.c
822 $(Q
)$(SH
) ..
/tools
/mkversion.sh
> $@ ||
$(PERL
) ..
/tools
/mkversion.pl
> $@ ||
$(CP
) $< $@
824 # easy printing of MAKE VARIABLES
825 print-
%: ; @echo
$* = $($*)
827 # SWIG files emit a number of warnings, we've to ignore them
829 $(OBJDIR
)/%wrap.o
: %wrap.c
$(OBJDIR
)/%.d
831 $(Q
)$(MKDIR
) $(dir $@
)
832 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -Wno-missing-prototypes
-Wno-missing-declarations
-Wno-missing-field-initializers
-c
-o
$@
$<
836 $(OBJDIR
)/%.o
: %.c
$(OBJDIR
)/%.d
838 $(Q
)$(MKDIR
) $(dir $@
)
839 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
843 $(OBJDIR
)/%.o
: %.
cpp $(OBJDIR
)/%.d
845 $(Q
)$(MKDIR
) $(dir $@
)
846 $(Q
)$(CXX
) $(DEPFLAGS
) $(PM3CXXFLAGS
) $(CXXINCLUDES
) -c
-o
$@
$<
850 $(OBJDIR
)/%.o
: %.m
$(OBJDIR
)/%.d
852 $(Q
)$(MKDIR
) $(dir $@
)
853 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
856 DEPENDENCY_FILES
= $(patsubst %.c
, $(OBJDIR
)/%.d
, $(SRCS
)) \
857 $(patsubst %wrap.c
, $(OBJDIR
)/%.d
, $(SWIGSRCS
)) \
858 $(patsubst %.
cpp, $(OBJDIR
)/%.d
, $(CXXSRCS
)) \
859 $(patsubst %.m
, $(OBJDIR
)/%.d
, $(OBJCSRCS
))
861 $(DEPENDENCY_FILES
): ;
862 .PRECIOUS
: $(DEPENDENCY_FILES
)
864 -include $(DEPENDENCY_FILES
)