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@
5/lib
/pkgconfig
:$(BREW_PREFIX
)/opt
/qt@
5/lib
/pkgconfig
43 ifeq ($(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 ID48LIBPATH
= .
/deps
/id48
76 ID48LIBINC
= -I
$(ID48LIBPATH
)
77 ID48LIB
= $(ID48LIBPATH
)/libid48.a
81 JANSSONLIBPATH
= .
/deps
/jansson
82 JANSSONLIBINC
= -I
$(JANSSONLIBPATH
)
83 JANSSONLIB
= $(JANSSONLIBPATH
)/libjansson.a
87 # Can be used if Readline is unavailable or explicitely disabled
88 # Requires to be unpacked, see deps/get_linenoise.sh
89 LINENOISELIBPATH
= .
/deps
/linenoise
90 LINENOISELIBINC
= -I
$(LINENOISELIBPATH
)
91 LINENOISELIB
= $(LINENOISELIBPATH
)/liblinenoise.a
95 LUALIBPATH
= .
/deps
/liblua
96 LUALIBINC
= -I
$(LUALIBPATH
)
97 LUALIB
= $(LUALIBPATH
)/liblua.a
100 ifneq (,$(findstring MINGW
,$(platform
)))
103 ifeq ($(platform
),Darwin
)
112 ifneq (,$(findstring MINGW
,$(platform
)))
117 REVENGLIBPATH
= .
/deps
/reveng
118 REVENGLIBINC
= -I
$(REVENGLIBPATH
)
119 REVENGLIB
= $(REVENGLIBPATH
)/libreveng.a
123 TINYCBORLIBPATH
= .
/deps
/tinycbor
124 TINYCBORLIBINC
= -I
$(TINYCBORLIBPATH
)
125 TINYCBORLIB
= $(TINYCBORLIBPATH
)/tinycbor.a
129 WHEREAMILIBPATH
= .
/deps
/whereami
130 WHEREAMILIBINC
= -I
$(WHEREAMILIBPATH
)
131 WHEREAMILIB
= $(WHEREAMILIBPATH
)/libwhereami.a
134 ##########################
135 # common local libraries #
136 ##########################
139 MBEDTLSLIBPATH
= ..
/common
/mbedtls
140 MBEDTLSLIBINC
= -I
$(MBEDTLSLIBPATH
)
141 MBEDTLSLIB
= $(OBJDIR
)/libmbedtls.a
142 MBEDTLSLIBCLIENTRELPATH
= ..
/..
/client
144 ########################################################
145 # optional system libraries to replace local libraries #
146 ########################################################
149 # not distributed as system library
150 STATICLIBS
+= $(AMIIBOLIB
)
151 LDLIBS
+= $(AMIIBOLIBLD
)
152 PM3INCLUDES
+= $(AMIIBOLIBINC
)
154 ## Cliparser / Argtable3
155 # not distributed as system library
156 STATICLIBS
+= $(CLIPARSERLIB
)
157 LDLIBS
+= $(CLIPARSERLIBLD
)
158 PM3INCLUDES
+= $(CLIPARSERLIBINC
)
161 # not distributed as system library
162 STATICLIBS
+= $(HARDNESTEDLIB
)
163 LDLIBS
+=$(HARDNESTEDLIBLD
)
164 PM3INCLUDES
+= $(HARDNESTEDLIBINC
)
167 # not distributed as system library
168 STATICLIBS
+= $(ID48LIB
)
169 LDLIBS
+= $(ID48LIBLD
)
170 PM3INCLUDES
+= $(ID48LIBINC
)
173 # wait to see if Readline is available
176 ifneq ($(SKIPLUASYSTEM
),1)
177 ifdef MACPORTS_PREFIX
178 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua-5.2
2>/dev
/null
)
179 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua-5.2
2>/dev
/null
)
181 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua5.2
2>/dev
/null
)
182 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua5.2
2>/dev
/null
)
184 ifneq ($(LUALDLIBS
),)
186 LUALIBLD
= $(LUALDLIBS
)
187 LUALIBINC
= $(LUAINCLUDES
)
191 STATICLIBS
+= $(LUALIB
)
192 LDLIBS
+= $(LUALIBLD
)
193 PM3INCLUDES
+= $(LUALIBINC
)
196 # Jansson section needs to be after Lua to avoid interferences on macOS if a locally incompatible Lua was available, see PR 1155
197 ifneq ($(SKIPJANSSONSYSTEM
),1)
198 JANSSONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags jansson
2>/dev
/null
)
199 JANSSONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs jansson
2>/dev
/null
)
200 ifneq ($(JANSSONLDLIBS
),)
202 JANSSONLIBLD
= $(JANSSONLDLIBS
)
203 JANSSONLIBINC
= $(JANSSONINCLUDES
)
207 STATICLIBS
+= $(JANSSONLIB
)
208 LDLIBS
+= $(JANSSONLIBLD
)
209 PM3INCLUDES
+= $(JANSSONLIBINC
)
212 # system library cannot be used because it is compiled by default without CMAC support
213 STATICLIBS
+= $(MBEDTLSLIB
)
214 LDLIBS
+= $(MBEDTLSLIBLD
)
215 PM3INCLUDES
+= $(MBEDTLSLIBINC
)
218 # not distributed as system library
219 STATICLIBS
+= $(REVENGLIB
)
220 LDLIBS
+= $(REVENGLIBLD
)
221 PM3INCLUDES
+= $(REVENGLIBINC
)
224 # not distributed as system library
225 STATICLIBS
+= $(TINYCBORLIB
)
226 LDLIBS
+= $(TINYCBORLIBLD
)
227 PM3INCLUDES
+= $(TINYCBORLIBINC
)
230 ifneq ($(SKIPWHEREAMISYSTEM
),1)
231 ifneq (,$(wildcard /usr
/include/whereami.h
))
233 WHEREAMILIBLD
= -lwhereami
238 STATICLIBS
+= $(WHEREAMILIB
)
239 LDLIBS
+= $(WHEREAMILIBLD
)
240 PM3INCLUDES
+= $(WHEREAMILIBINC
)
247 # RPi Zero gcc requires -latomic
248 # but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
249 # doesn't recognize option --as-needed
250 ifneq ($(platform
),Darwin
)
251 LDLIBS
+= -Wl
,--as-needed
-latomic
-Wl
,--no-as-needed
262 BTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags bluez
2>/dev
/null
)
263 BTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs bluez
2>/dev
/null
)
265 BTLIBLD
= $(BTLDLIBS
)
266 BTLIBINC
= $(BTINCLUDES
)
271 PM3INCLUDES
+= $(BTLIBINC
)
277 # Some have no pthread, e.g. termux
278 ifneq ($(SKIPPTHREAD
),1)
282 ## Python3 (optional)
283 ifneq ($(SKIPPYTHON
),1)
284 # since python3.8, applications willing to embed python must use -embed:
285 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3-embed
2>/dev
/null
)
286 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3-embed
2>/dev
/null
)
287 ifneq ($(PYTHONLDLIBS
),)
288 PYTHONLIBLD
= $(PYTHONLDLIBS
)
289 PYTHONLIBINC
= $(subst -I
,-isystem
,$(PYTHONINCLUDES
))
292 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3
2>/dev
/null
)
293 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3
2>/dev
/null
)
294 ifneq ($(PYTHONLDLIBS
),)
295 PYTHONLIBLD
= $(PYTHONLDLIBS
)
296 PYTHONLIBINC
= $(subst -I
,-isystem
,$(PYTHONINCLUDES
))
301 LDLIBS
+= $(PYTHONLIBLD
)
302 PM3INCLUDES
+= $(PYTHONLIBINC
)
304 ## QT5 (or QT4 fallback) (optional)
306 # Check for correctly configured Qt5
307 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags Qt5Core Qt5Widgets
2>/dev
/null
)
308 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs Qt5Core Qt5Widgets
2>/dev
/null
)
309 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/moc
310 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/uic
311 QMAKE
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/qmake
315 # if Qt5 not found check for correctly configured Qt4
316 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags QtCore QtGui
2>/dev
/null
)
317 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs QtCore QtGui
2>/dev
/null
)
318 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=moc_location QtCore
)
319 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=uic_location QtCore
)
320 QMAKE
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=exec_prefix QtCore
)/bin
/qmake
323 # if both pkg-config commands failed, search in common places
325 ifneq ($(wildcard $(QTDIR
)/include/QtWidgets
),)
327 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
-I
$(QTDIR
)/include/QtWidgets
328 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQt5Core
-lQt5Gui
-lQt5Widgets
332 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
333 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQtCore4
-lQtGui4
335 MOC
= $(QTDIR
)/bin
/moc
336 UIC
= $(QTDIR
)/bin
/uic
337 QMAKE
= $(QTDIR
)/bin
/qmake
344 LDLIBS
+= $(QTLDLIBS
)
345 CXXINCLUDES
+= $(QTINCLUDES
)
349 GDINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags gdlib
2>/dev
/null
)
350 GDLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs gdlib
2>/dev
/null
)
352 LDLIBS
+= $(GDLDLIBS
)
353 PM3INCLUDES
+= $(GDINCLUDES
)
359 ifneq ($(SKIPREADLINE
),1)
361 LDLIBS
+= -L
$(BREW_PREFIX
)/opt
/readline
/lib
362 PM3INCLUDES
+= -I
$(BREW_PREFIX
)/opt
/readline
/include
365 ifeq ($(USE_MACPORTS
),1)
366 PM3INCLUDES
+= -I
$(MACPORTS_PREFIX
)/include/readline
373 ifneq ($(SKIPLINENOISE
),1)
374 ifneq (,$(wildcard $(LINENOISELIBPATH
)))
375 STATICLIBS
+= $(LINENOISELIB
)
376 LDLIBS
+= $(LINENOISELIBLD
)
377 PM3INCLUDES
+= $(LINENOISELIBINC
)
378 LINENOISE_LOCAL_FOUND
= 1
387 ifneq ("$(wildcard src/pm3_luawrap.c)","")
390 ifeq ($(PYTHON_FOUND
),1)
391 ifneq ("$(wildcard src/pm3_pywrap.c)","")
392 SWIG_PYTHON_FOUND
= 1
396 #######################################################################################################
397 # clang doesn't like this params
398 #MYCFLAGS += --param max-completely-peeled-insns=1000 --param max-completely-peel-times=10000
401 CFLAGS ?
= $(DEFCFLAGS
)
402 CFLAGS
+= $(MYDEFS
) $(MYCFLAGS
) $(MYINCLUDES
)
404 # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
405 PM3CFLAGS
= $(CFLAGS
)
406 PM3CFLAGS
+= -I.
/src
-I.
/include -I..
/include -I..
/common
-I..
/common_fpga
$(PM3INCLUDES
) $(INCLUDES
)
408 #PM3CFLAGS += -std=c11 -pedantic
411 ifneq (,$(findstring MINGW
,$(platform
)))
412 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
413 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
414 # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
415 # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
416 PM3CFLAGS
+= -D_ISOC99_SOURCE
417 PM3CFLAGS
+= -mno-ms-bitfields
-fexec-charset
=cp850
420 ifeq ($(READLINE_FOUND
),1)
421 PM3CFLAGS
+= -DHAVE_READLINE
424 ifeq ($(LINENOISE_LOCAL_FOUND
),1)
425 PM3CFLAGS
+= -DHAVE_LINENOISE
429 PM3CFLAGS
+= -DHAVE_BLUEZ
432 ifeq ($(PYTHON_FOUND
),1)
433 PM3CFLAGS
+= -DHAVE_PYTHON
437 PM3CFLAGS
+= -DHAVE_GD
440 ifeq ($(SWIG_LUA_FOUND
),1)
441 PM3CFLAGS
+= -DHAVE_LUA_SWIG
443 ifeq ($(SWIG_PYTHON_FOUND
),1)
444 PM3CFLAGS
+= -DHAVE_PYTHON_SWIG
447 PM3CFLAGS
+= -DHAVE_SNPRINTF
449 CXXFLAGS ?
= -Wall
-Werror
450 CXXFLAGS
+= $(MYDEFS
) $(MYCXXFLAGS
) $(MYINCLUDES
)
452 PM3CXXFLAGS
= $(CXXFLAGS
)
453 PM3CXXFLAGS
+= -I..
/include -I.
/include
456 PM3CFLAGS
+= -DHAVE_GUI
457 PM3CXXFLAGS
+= -DQT_NO_DEBUG
458 ifeq ($(QT5_FOUND
),1)
459 # On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
460 PM3CXXFLAGS
+= -fPIC
-std
=c
++11
464 PM3CXXFLAGS
+= -DHAVE_SNPRINTF
466 LDFLAGS ?
= $(DEFLDFLAGS
)
467 LDFLAGS
+= $(MYLDFLAGS
)
469 PM3LDFLAGS
= $(LDFLAGS
)
470 ifeq ($(platform
),Darwin
)
471 ifeq ($(shell uname
-p
),arm64
)
472 # The platform is iOS
473 PM3LDFLAGS
+= -framework Foundation
-framework UIKit
475 # M* macOS devices return arm
476 PM3LDFLAGS
+= -framework Foundation
-framework AppKit
484 $(info ===================================================================)
485 $(info Version
info: $(shell ..
/tools
/mkversion.sh
--short
2>/dev
/null
))
486 $(info Client platform
: $(platform
))
489 $(info GUI support
: skipped
)
492 ifeq ($(QT5_FOUND
),1)
493 $(info GUI support
: QT5 found
, enabled
($(shell QT_SELECT
=5 $(QMAKE
) -v
2>/dev
/null|grep
-o
'Qt version.*')))
495 $(info GUI support
: QT4 found
, enabled
($(shell QT_SELECT
=4 $(QMAKE
) -v
2>/dev
/null|grep
-o
'Qt version.*')))
498 $(info GUI support
: QT not found
, disabled
)
503 $(info native BT support
: skipped
)
506 $(info native BT support
: Bluez found
, enabled
)
508 $(info native BT support
: Bluez not found
, disabled
)
512 ifeq ($(SKIPJANSSONSYSTEM
),1)
513 $(info Jansson library
: local library forced
)
514 else ifeq ($(JANSSON_FOUND
),1)
515 $(info Jansson library
: system library found
)
517 $(info Jansson library
: system library not found
, using local library
)
520 ifeq ($(SKIPLUASYSTEM
),1)
521 $(info Lua library
: local library forced
)
523 ifeq ($(LUA_FOUND
),1)
524 $(info Lua library
: system library found
)
526 $(info Lua library
: system library not found
, using local library
)
530 ifeq ($(SKIPPYTHON
),1)
531 $(info Python3 library
: skipped
)
533 ifeq ($(PYTHON_FOUND
),1)
534 $(info Python3 library
: Python3 v
$(shell $(PKG_CONFIG_ENV
) pkg-config
--modversion python3
) found
, enabled
)
536 $(info Python3 library
: Python3 not found
, disabled
)
541 $(info GD library
: skipped
)
544 $(info GD library
: GD v
$(shell $(PKG_CONFIG_ENV
) pkg-config
--modversion gdlib
) found
, enabled
)
546 $(info GD library
: GD not found
, disabled
)
550 ifeq ($(SKIPREADLINE
),1)
551 $(info Readline library
: skipped
)
553 ifeq ($(READLINE_FOUND
),1)
554 $(info Readline library
: enabled
)
556 $(info Readline library
: Readline not found
, disabled
)
560 ifneq ($(READLINE_FOUND
),1)
561 ifeq ($(SKIPLINENOISE
),1)
562 $(info Linenoise library
: skipped
)
564 ifeq ($(LINENOISE_LOCAL_FOUND
),1)
565 $(info Linenoise library
: enabled
)
567 $(info Linenoise library
: Linenoise not found
, disabled
)
572 ifeq ($(SKIPWHEREAMISYSTEM
),1)
573 $(info Whereami library
: local library forced
)
575 ifeq ($(WHEREAMI_FOUND
),1)
576 $(info Whereami library
: system library found
)
578 $(info Whereami library
: system library not found
, using local library
)
582 ifeq ($(SWIG_LUA_FOUND
),1)
583 $(info Lua SWIG
: wrapper found
)
585 ifeq ($(SWIG_PYTHON_FOUND
),1)
586 $(info Python SWIG
: wrapper found
)
589 $(info compiler version
: $(shell $(CC
) --version|head
-n
1))
590 $(info ===================================================================)
596 # Flags to generate temporary dependency files
597 DEPFLAGS
= -MT
$@
-MMD
-MP
-MF
$(OBJDIR
)/$*.Td
598 # make temporary to final dependency files after successful compilation
599 POSTCOMPILE
= $(MV
) -f
$(OBJDIR
)/$*.Td
$(OBJDIR
)/$*.d
&& $(TOUCH
) $@
605 SRCS
= mifare
/aiddesfire.c \
612 cmdflashmemspiffs.c \
698 emv
/crypto_polarssl.c\
708 emv
/test/crypto_test.c\
709 emv
/test/cryptotest.c\
713 fido
/additional_ca.c \
717 ksx6924
/ksx6924core.c \
718 cipurse
/cipursecore.c \
719 cipurse
/cipursecrypto.c \
720 cipurse
/cipursetest.c \
728 iso7816
/iso7816core.c \
730 loclass
/cipherutils.c \
731 loclass
/elite_crack.c \
734 mifare
/desfirecrypto.c \
735 mifare
/desfirecore.c \
736 mifare
/desfiresecurechan.c \
737 mifare
/desfiretest.c \
738 mifare
/gallaghercore.c \
742 mifare
/mifaredefault.c \
743 mifare
/mifarehost.c \
762 wiegand_formatutils.c
765 SRCS
+= bucketsort.c \
775 hitag2
/hitag2_crypto.c \
782 # electronic shelf labels
790 ifeq ($(SWIG_LUA_FOUND
),1)
791 SWIGSRCS
+= pm3_luawrap.c
793 ifeq ($(SWIG_PYTHON_FOUND
),1)
794 SWIGSRCS
+= pm3_pywrap.c
799 CXXSRCS
= proxgui.
cpp proxguiqt.
cpp proxguiqt.moc.
cpp
801 CXXSRCS
= guidummy.
cpp
805 ifeq ($(platform
),Darwin
)
806 OBJCSRCS
= util_darwin.m
809 OBJS
= $(SRCS
:%.c
=$(OBJDIR
)/%.o
)
810 OBJS
+= $(SWIGSRCS
:%.c
=$(OBJDIR
)/%.o
)
811 OBJS
+= $(CXXSRCS
:%.
cpp=$(OBJDIR
)/%.o
)
812 OBJS
+= $(OBJCSRCS
:%.m
=$(OBJDIR
)/%.o
)
816 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
817 # transition: cleaning also old path stuff
818 CLEAN
+= flasher
*.moc.
cpp ui
/ui_overlays.h ui
/ui_image.h
824 # need to assign dependancies to build these first...
827 all-static
: LDLIBS
:=-static
$(LDLIBS
)
830 proxmark3
: $(OBJS
) $(STATICLIBS
) lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
832 # $(Q)$(CXX) $(PM3LDFLAGS) $(OBJS) $(STATICLIBS) $(LDLIBS) -o $@
833 $(Q
)$(CXX
) $(PM3CFLAGS
) $(PM3LDFLAGS
) $(OBJS
) $(STATICLIBS
) $(LDLIBS
) -o
$@
835 src
/proxgui.
cpp: src
/ui
/ui_overlays.h src
/ui
/ui_image.h
837 src
/proxguiqt.
cpp: src
/proxguiqt.h
839 src
/proxguiqt.moc.
cpp: src
/proxguiqt.h
843 src
/proxguiqt.h
: src
/ui
/ui_overlays.h src
/ui
/ui_image.h
845 src
/ui
/ui_overlays.h
: src
/ui
/overlays.ui
849 src
/ui
/ui_image.h
: src
/ui
/image.ui
853 lualibs
/pm3_cmd.lua
: ..
/include/pm3_cmd.h
855 $(Q
)awk
-f pm3_cmd_h2lua.awk
$^
> $@
857 lualibs
/mfc_default_keys.lua
: mfc_default_keys.dic
859 $(Q
)awk
-f default_keys_dic2lua.awk
$^
> $@
863 $(Q
)$(RMDIR
) $(OBJDIR
)
864 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) clean
865 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) clean
866 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) clean
867 $(Q
)$(MAKE
) --no-print-directory
-C
$(ID48LIBPATH
) clean
868 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) clean
869 ifeq ($(LINENOISE_LOCAL_FOUND
), 1)
870 $(Q
)$(MAKE
) --no-print-directory
-C
$(LINENOISELIBPATH
) clean
872 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) clean
873 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) clean
874 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) clean
875 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) clean
876 @
# Just in case someone compiled within these dirs:
877 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) clean
880 $(info [@
] Installing client to
$(DESTDIR
)$(PREFIX
)...
)
881 ifneq (,$(INSTALLBIN
))
882 $(Q
)$(INSTALLSUDO
) $(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
883 $(Q
)$(INSTALLSUDO
) $(CP
) $(INSTALLBIN
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
885 ifneq (,$(INSTALLSHARE
))
886 $(Q
)$(INSTALLSUDO
) $(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
887 $(Q
)$(INSTALLSUDO
) $(CP
) $(INSTALLSHARE
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
892 $(info [@
] Uninstalling client from
$(DESTDIR
)$(PREFIX
)...
)
893 ifneq (,$(INSTALLBIN
))
894 $(Q
)$(INSTALLSUDO
) $(RM
) $(foreach tool
,$(INSTALLBIN
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)$(PATHSEP
)$(notdir $(tool
)))
896 ifneq (,$(INSTALLSHARE
))
897 $(Q
)$(INSTALLSUDO
) $(RMDIR
) $(foreach tool
,$(INSTALLSHARE
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)$(PATHSEP
)$(notdir $(tool
)))
902 $(info [=] TAR ..
/proxmark3-
$(platform
)-bin.
tar)
903 $(Q
)$(TAR
) $(TARFLAGS
) ..
/proxmark3-
$(platform
)-bin.
tar $(BINS
:%=client
/%) $(WINBINS
:%=client
/%)
905 ###########################
906 # local libraries targets #
907 ###########################
910 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) all
912 $(CLIPARSERLIB
): .FORCE
914 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) all
916 $(HARDNESTEDLIB
): .FORCE
918 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) all
922 $(Q
)$(MAKE
) --no-print-directory
-C
$(ID48LIBPATH
) all
924 $(JANSSONLIB
): .FORCE
925 ifneq ($(JANSSON_FOUND
),1)
927 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) all
930 $(LINENOISELIB
): .FORCE
931 ifeq ($(LINENOISE_LOCAL_FOUND
), 1)
933 $(Q
)$(MAKE
) --no-print-directory
-C
$(LINENOISELIBPATH
) all
937 ifneq ($(LUA_FOUND
),1)
938 $(info [*] MAKE
$@ for
$(LUAPLATFORM
))
939 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) $(LUAPLATFORM
)
942 $(MBEDTLSLIB
): .FORCE
944 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) OBJDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
)/mbedtls BINDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
) all
948 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) all
950 $(TINYCBORLIB
): .FORCE
952 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) all
954 $(WHEREAMILIB
): .FORCE
955 ifneq ($(WHEREAMI_FOUND
),1)
957 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) all
964 src
/pm3_luawrap.c
: pm3.i
966 $(Q
)$(SWIG
) -lua
-o
$@
$<
968 src
/pm3_pywrap.c
: pm3.i
970 $(Q
)$(SWIG
) -python
-o
$@
$<
976 .PHONY
: all clean install uninstall tarbin .FORCE
978 # version_pm3.c should be checked on every compilation
979 src
/version_pm3.c
: default_version_pm3.c .FORCE
981 $(Q
)$(SH
) ..
/tools
/mkversion.sh
$@ ||
$(CP
) $< $@
983 # easy printing of MAKE VARIABLES
984 print-
%: ; @echo
$* = $($*)
986 # SWIG files emit a number of warnings, we've to ignore them
988 $(OBJDIR
)/%wrap.o
: %wrap.c
$(OBJDIR
)/%.d
990 $(Q
)$(MKDIR
) $(dir $@
)
991 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -Wno-missing-prototypes
-Wno-missing-declarations
-Wno-missing-field-initializers
-c
-o
$@
$<
995 $(OBJDIR
)/%.o
: %.c
$(OBJDIR
)/%.d
997 $(Q
)$(MKDIR
) $(dir $@
)
998 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
1002 $(OBJDIR
)/%.o
: %.
cpp $(OBJDIR
)/%.d
1004 $(Q
)$(MKDIR
) $(dir $@
)
1005 $(Q
)$(CXX
) $(DEPFLAGS
) $(PM3CXXFLAGS
) $(CXXINCLUDES
) -c
-o
$@
$<
1009 $(OBJDIR
)/%.o
: %.m
$(OBJDIR
)/%.d
1011 $(Q
)$(MKDIR
) $(dir $@
)
1012 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
1015 DEPENDENCY_FILES
= $(patsubst %.c
, $(OBJDIR
)/%.d
, $(SRCS
)) \
1016 $(patsubst %wrap.c
, $(OBJDIR
)/%.d
, $(SWIGSRCS
)) \
1017 $(patsubst %.
cpp, $(OBJDIR
)/%.d
, $(CXXSRCS
)) \
1018 $(patsubst %.m
, $(OBJDIR
)/%.d
, $(OBJCSRCS
))
1020 $(DEPENDENCY_FILES
): ;
1021 .PRECIOUS
: $(DEPENDENCY_FILES
)
1023 -include $(DEPENDENCY_FILES
)