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
10 INSTALLSHARE
= cmdscripts lualibs luascripts pyscripts resources dictionaries
13 vpath
%.dic dictionaries
17 INCLUDES
+= -I
$(BREW_PREFIX
)/include
18 LDLIBS
+= -L
$(BREW_PREFIX
)/lib
19 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(BREW_PREFIX
)/opt
/qt
/lib
/pkgconfig
20 PKG_CONFIG_ENV
:= PKG_CONFIG_PATH
=$(BREW_PREFIX
)/opt
/qt5
/lib
/pkgconfig
28 AMIIBOLIBPATH
= .
/deps
/amiitool
29 AMIIBOLIBINC
= -I
$(AMIIBOLIBPATH
)
30 AMIIBOLIB
= $(AMIIBOLIBPATH
)/libamiibo.a
33 ## Cliparser / Argtable3
34 CLIPARSERLIBPATH
= .
/deps
/cliparser
35 CLIPARSERLIBINC
= -I
$(CLIPARSERLIBPATH
)
36 CLIPARSERLIB
= $(CLIPARSERLIBPATH
)/libcliparser.a
40 HARDNESTEDLIBPATH
= .
/deps
/hardnested
41 HARDNESTEDLIBINC
= -I
$(HARDNESTEDLIBPATH
)
42 HARDNESTEDLIB
= $(HARDNESTEDLIBPATH
)/libhardnested.a
46 JANSSONLIBPATH
= .
/deps
/jansson
47 JANSSONLIBINC
= -I
$(JANSSONLIBPATH
)
48 JANSSONLIB
= $(JANSSONLIBPATH
)/libjansson.a
52 LUALIBPATH
= .
/deps
/liblua
53 LUALIBINC
= -I
$(LUALIBPATH
)
54 LUALIB
= $(LUALIBPATH
)/liblua.a
57 ifneq (,$(findstring MINGW
,$(platform
)))
60 ifeq ($(platform
),Darwin
)
69 REVENGLIBPATH
= .
/deps
/reveng
70 REVENGLIBINC
= -I
$(REVENGLIBPATH
)
71 REVENGLIB
= $(REVENGLIBPATH
)/libreveng.a
75 TINYCBORLIBPATH
= .
/deps
/tinycbor
76 TINYCBORLIBINC
= -I
$(TINYCBORLIBPATH
)
77 TINYCBORLIB
= $(TINYCBORLIBPATH
)/tinycbor.a
81 WHEREAMILIBPATH
= .
/deps
/whereami
82 WHEREAMILIBINC
= -I
$(WHEREAMILIBPATH
)
83 WHEREAMILIB
= $(WHEREAMILIBPATH
)/libwhereami.a
86 ##########################
87 # common local libraries #
88 ##########################
91 MBEDTLSLIBPATH
= ..
/common
/mbedtls
92 MBEDTLSLIBINC
= -I
$(MBEDTLSLIBPATH
)
93 MBEDTLSLIB
= $(OBJDIR
)/libmbedtls.a
94 MBEDTLSLIBCLIENTRELPATH
= ..
/..
/client
96 ########################################################
97 # optional system libraries to replace local libraries #
98 ########################################################
101 # not distributed as system library
102 STATICLIBS
+= $(AMIIBOLIB
)
103 LDLIBS
+= $(AMIIBOLIBLD
)
104 INCLUDES
+= $(AMIIBOLIBINC
)
106 ## Cliparser / Argtable3
107 # not distributed as system library
108 STATICLIBS
+= $(CLIPARSERLIB
)
109 LDLIBS
+= $(CLIPARSERLIBLD
)
110 INCLUDES
+= $(CLIPARSERLIBINC
)
113 # not distributed as system library
114 STATICLIBS
+= $(HARDNESTEDLIB
)
115 LDLIBS
+=$(HARDNESTEDLIBLD
)
116 INCLUDES
+= $(HARDNESTEDLIBINC
)
119 ifneq ($(SKIPLUASYSTEM
),1)
120 LUAINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags lua5.2
2>/dev
/null
)
121 LUALDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs lua5.2
2>/dev
/null
)
122 ifneq ($(LUALDLIBS
),)
124 LUALIBLD
= $(LUALDLIBS
)
125 LUALIBINC
= $(LUAINCLUDES
)
129 STATICLIBS
+= $(LUALIB
)
130 LDLIBS
+= $(LUALIBLD
)
131 INCLUDES
+= $(LUALIBINC
)
134 # Jansson section needs to be after Lua to avoid interferences on macOS if a locally incompatible Lua was available, see PR 1155
135 ifneq ($(SKIPJANSSONSYSTEM
),1)
136 JANSSONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags jansson
2>/dev
/null
)
137 JANSSONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs jansson
2>/dev
/null
)
138 ifneq ($(JANSSONLDLIBS
),)
140 JANSSONLIBLD
= $(JANSSONLDLIBS
)
141 JANSSONLIBINC
= $(JANSSONINCLUDES
)
145 STATICLIBS
+= $(JANSSONLIB
)
146 LDLIBS
+= $(JANSSONLIBLD
)
147 INCLUDES
+= $(JANSSONLIBINC
)
150 # system library cannot be used because it is compiled by default without CMAC support
151 STATICLIBS
+= $(MBEDTLSLIB
)
152 LDLIBS
+= $(MBEDTLSLIBLD
)
153 INCLUDES
+= $(MBEDTLSLIBINC
)
156 # not distributed as system library
157 STATICLIBS
+= $(REVENGLIB
)
158 LDLIBS
+= $(REVENGLIBLD
)
159 INCLUDES
+= $(REVENGLIBINC
)
162 # not distributed as system library
163 STATICLIBS
+= $(TINYCBORLIB
)
164 LDLIBS
+= $(TINYCBORLIBLD
)
165 INCLUDES
+= $(TINYCBORLIBINC
)
168 ifneq ($(SKIPWHEREAMISYSTEM
),1)
169 ifneq (,$(wildcard /usr
/include/whereami.h
))
171 WHEREAMILIBLD
= -lwhereami
176 STATICLIBS
+= $(WHEREAMILIB
)
177 LDLIBS
+= $(WHEREAMILIBLD
)
178 INCLUDES
+= $(WHEREAMILIBINC
)
185 # RPi Zero gcc requires -latomic
186 # but MacOSX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
187 # doesn't recognize option --as-needed
188 ifneq ($(platform
),Darwin
)
189 LDLIBS
+= -Wl
,--as-needed
-latomic
-Wl
,--no-as-needed
197 BTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags bluez
2>/dev
/null
)
198 BTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs bluez
2>/dev
/null
)
200 BTLIBLD
= $(BTLDLIBS
)
201 BTLIBINC
= $(BTINCLUDES
)
206 INCLUDES
+= $(BTLIBINC
)
212 # Some have no pthread, e.g. termux
213 ifneq ($(SKIPPTHREAD
),1)
217 ## Python3 (optional)
218 ifneq ($(SKIPPYTHON
),1)
219 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3
2>/dev
/null
)
220 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3
2>/dev
/null
)
221 ifneq ($(PYTHONLDLIBS
),)
222 PYTHONLIBLD
= $(PYTHONLDLIBS
)
223 PYTHONLIBINC
= $(PYTHONINCLUDES
)
226 # since python3.8, applications willing to embed python must use -embed:
227 PYTHONINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags python3-embed
2>/dev
/null
)
228 PYTHONLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs python3-embed
2>/dev
/null
)
229 ifneq ($(PYTHONLDLIBS
),)
230 PYTHONLIBLD
= $(PYTHONLDLIBS
)
231 PYTHONLIBINC
= $(PYTHONINCLUDES
)
236 LDLIBS
+= $(PYTHONLIBLD
)
237 INCLUDES
+= $(PYTHONLIBINC
)
239 ## QT5 (or QT4 fallback) (optional)
241 # Check for correctly configured Qt5
242 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags Qt5Core Qt5Widgets
2>/dev
/null
)
243 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs Qt5Core Qt5Widgets
2>/dev
/null
)
244 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/moc
245 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=host_bins Qt5Core
)/uic
249 # if Qt5 not found check for correctly configured Qt4
250 QTINCLUDES
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--cflags QtCore QtGui
2>/dev
/null
)
251 QTLDLIBS
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--libs QtCore QtGui
2>/dev
/null
)
252 MOC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=moc_location QtCore
)
253 UIC
= $(shell $(PKG_CONFIG_ENV
) pkg-config
--variable
=uic_location QtCore
)
256 # if both pkg-config commands failed, search in common places
258 ifneq ($(wildcard $(QTDIR
)/include/QtWidgets
),)
260 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
-I
$(QTDIR
)/include/QtWidgets
261 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQt5Core
-lQt5Gui
-lQt5Widgets
265 QTINCLUDES
= -I
$(QTDIR
)/include -I
$(QTDIR
)/include/QtCore
-I
$(QTDIR
)/include/QtGui
266 QTLDLIBS
= -L
$(QTDIR
)/lib
-lQtCore4
-lQtGui4
268 MOC
= $(QTDIR
)/bin
/moc
269 UIC
= $(QTDIR
)/bin
/uic
276 LDLIBS
+= $(QTLDLIBS
)
277 CXXINCLUDES
+= $(QTINCLUDES
)
280 ifneq ($(SKIPREADLINE
),1)
282 LDLIBS
+= -L
$(BREW_PREFIX
)/opt
/readline
/lib
283 INCLUDES
+= -I
$(BREW_PREFIX
)/opt
/readline
/include
293 ifneq ("$(wildcard src/pm3_luawrap.c)","")
296 ifeq ($(PYTHON_FOUND
),1)
297 ifneq ("$(wildcard src/pm3_pywrap.c)","")
298 SWIG_PYTHON_FOUND
= 1
302 #######################################################################################################
303 CFLAGS ?
= $(DEFCFLAGS
)
304 # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
305 PM3CFLAGS
= $(CFLAGS
)
306 PM3CFLAGS
+= -I.
/src
-I.
/include -I..
/include -I..
/common
-I..
/common_fpga
$(INCLUDES
)
308 #PM3CFLAGS += -std=c11 -pedantic
311 ifneq (,$(findstring MINGW
,$(platform
)))
312 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
313 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
314 # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
315 # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
316 PM3CFLAGS
+= -D_ISOC99_SOURCE
317 PM3CFLAGS
+= -mno-ms-bitfields
-fexec-charset
=cp850
320 ifeq ($(READLINE_FOUND
),1)
321 PM3CFLAGS
+= -DHAVE_READLINE
325 PM3CFLAGS
+= -DHAVE_BLUEZ
328 ifeq ($(PYTHON_FOUND
),1)
329 PM3CFLAGS
+= -DHAVE_PYTHON
332 ifeq ($(SWIG_LUA_FOUND
),1)
333 PM3CFLAGS
+= -DHAVE_LUA_SWIG
335 ifeq ($(SWIG_PYTHON_FOUND
),1)
336 PM3CFLAGS
+= -DHAVE_PYTHON_SWIG
339 CXXFLAGS ?
= -Wall
-Werror
-O3
340 PM3CXXFLAGS
= $(CXXFLAGS
)
341 PM3CXXFLAGS
+= -I..
/include -I.
/include
344 PM3CFLAGS
+= -DHAVE_GUI
345 PM3CXXFLAGS
+= -DQT_NO_DEBUG
346 ifeq ($(QT5_FOUND
),1)
347 # On OSX Qt5 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
348 PM3CXXFLAGS
+= -fPIC
-std
=c
++11
352 LDFLAGS ?
= $(DEFLDFLAGS
)
353 PM3LDFLAGS
= $(LDFLAGS
)
354 ifeq ($(platform
),Darwin
)
355 PM3LDFLAGS
+= -framework Foundation
-framework AppKit
362 $(info ===================================================================)
363 $(info Client platform
: $(platform
))
366 $(info GUI support
: skipped
)
369 ifeq ($(QT5_FOUND
),1)
370 $(info GUI support
: QT5 found
, enabled
($(shell QT_SELECT
=5 qmake
-v
2>/dev
/null|grep
-o
'Qt version.*')))
372 $(info GUI support
: QT4 found
, enabled
($(shell QT_SELECT
=4 qmake
-v
2>/dev
/null|grep
-o
'Qt version.*')))
375 $(info GUI support
: QT not found
, disabled
)
380 $(info native BT support
: skipped
)
383 $(info native BT support
: Bluez found
, enabled
)
385 $(info native BT support
: Bluez not found
, disabled
)
389 ifeq ($(SKIPJANSSONSYSTEM
),1)
390 $(info Jansson library
: local library forced
)
391 else ifeq ($(JANSSON_FOUND
),1)
392 $(info Jansson library
: system library found
)
394 $(info Jansson library
: system library not found
, using local library
)
397 ifeq ($(SKIPLUASYSTEM
),1)
398 $(info Lua library
: local library forced
)
400 ifeq ($(LUA_FOUND
),1)
401 $(info Lua library
: system library found
)
403 $(info Lua library
: system library not found
, using local library
)
407 ifeq ($(SKIPPYTHON
),1)
408 $(info Python3 library
: skipped
)
410 ifeq ($(PYTHON_FOUND
),1)
411 $(info Python3 library
: Python3 v
$(shell pkg-config
--modversion python3
) found
, enabled
)
413 $(info Python3 library
: Python3 not found
, disabled
)
417 ifeq ($(SKIPREADLINE
),1)
418 $(info Readline library
: skipped
)
420 ifeq ($(READLINE_FOUND
),1)
421 $(info Readline library
: enabled
)
423 $(info Readline library
: Readline not found
, disabled
)
427 ifeq ($(SKIPWHEREAMISYSTEM
),1)
428 $(info Whereami library
: local library forced
)
430 ifeq ($(WHEREAMI_FOUND
),1)
431 $(info Whereami library
: system library found
)
433 $(info Whereami library
: system library not found
, using local library
)
437 ifeq ($(SWIG_LUA_FOUND
),1)
438 $(info Lua SWIG
: wrapper found
)
440 ifeq ($(SWIG_PYTHON_FOUND
),1)
441 $(info Python SWIG
: wrapper found
)
444 $(info compiler version
: $(shell $(CC
) --version|head
-n
1))
445 $(info ===================================================================)
451 # Flags to generate temporary dependency files
452 DEPFLAGS
= -MT
$@
-MMD
-MP
-MF
$(OBJDIR
)/$*.Td
453 # make temporary to final dependency files after successful compilation
454 POSTCOMPILE
= $(MV
) -f
$(OBJDIR
)/$*.Td
$(OBJDIR
)/$*.d
&& $(TOUCH
) $@
460 SRCS
= aiddesfire.c \
466 cmdflashmemspiffs.c \
541 emv
/crypto_polarssl.c\
551 emv
/test/crypto_test.c\
552 emv
/test/cryptotest.c\
556 fido
/additional_ca.c \
560 cipurse
/cipursecore.c \
561 cipurse
/cipursecrypto.c \
568 iso7816
/iso7816core.c \
570 loclass
/cipherutils.c \
571 loclass
/elite_crack.c \
573 mifare
/desfire_crypto.c \
577 mifare
/mifaredefault.c \
578 mifare
/mifarehost.c \
595 wiegand_formatutils.c
598 SRCS
+= bucketsort.c \
616 ifeq ($(SWIG_LUA_FOUND
),1)
617 SWIGSRCS
+= pm3_luawrap.c
619 ifeq ($(SWIG_PYTHON_FOUND
),1)
620 SWIGSRCS
+= pm3_pywrap.c
625 CXXSRCS
= proxgui.
cpp proxguiqt.
cpp proxguiqt.moc.
cpp
627 CXXSRCS
= guidummy.
cpp
631 ifeq ($(platform
),Darwin
)
632 OBJCSRCS
= util_darwin.m
635 OBJS
= $(SRCS
:%.c
=$(OBJDIR
)/%.o
)
636 OBJS
+= $(SWIGSRCS
:%.c
=$(OBJDIR
)/%.o
)
637 OBJS
+= $(CXXSRCS
:%.
cpp=$(OBJDIR
)/%.o
)
638 OBJS
+= $(OBJCSRCS
:%.m
=$(OBJDIR
)/%.o
)
642 CLEAN
= $(BINS
) src
/version_pm3.c src
/*.moc.
cpp src
/ui
/ui_overlays.h lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
643 # transition: cleaning also old path stuff
644 CLEAN
+= flasher
*.moc.
cpp ui
/ui_overlays.h
650 # need to assign dependancies to build these first...
653 all-static
: LDLIBS
:=-static
$(LDLIBS
)
656 proxmark3
: $(OBJS
) $(STATICLIBS
) lualibs
/pm3_cmd.lua lualibs
/mfc_default_keys.lua
658 $(Q
)$(LD
) $(PM3LDFLAGS
) $(OBJS
) $(STATICLIBS
) $(LDLIBS
) -o
$@
660 src
/proxgui.
cpp: src
/ui
/ui_overlays.h
662 src
/proxguiqt.moc.
cpp: src
/proxguiqt.h
666 src
/ui
/ui_overlays.h
: src
/ui
/overlays.ui
670 lualibs
/pm3_cmd.lua
: ..
/include/pm3_cmd.h
672 $(Q
)awk
-f pm3_cmd_h2lua.awk
$^
> $@
674 lualibs
/mfc_default_keys.lua
: mfc_default_keys.dic
676 $(Q
)awk
-f default_keys_dic2lua.awk
$^
> $@
680 $(Q
)$(RMDIR
) $(OBJDIR
)
681 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) clean
682 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) clean
683 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) clean
684 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) clean
685 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) clean
686 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) clean
687 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) clean
688 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) clean
689 @
# Just in case someone compiled within these dirs:
690 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) clean
693 $(info [@
] Installing client to
$(DESTDIR
)$(PREFIX
)...
)
694 ifneq (,$(INSTALLBIN
))
695 $(Q
)$(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
696 $(Q
)$(CP
) $(INSTALLBIN
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)
698 ifneq (,$(INSTALLSHARE
))
699 $(Q
)$(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
700 $(Q
)$(CP
) $(INSTALLSHARE
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)
701 $(Q
)$(CP
) src
/pm3.py
$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)/pyscripts
706 $(info [@
] Uninstalling client from
$(DESTDIR
)$(PREFIX
)...
)
707 ifneq (,$(INSTALLBIN
))
708 $(Q
)$(RM
) $(foreach tool
,$(INSTALLBIN
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLBINRELPATH
)$(PATHSEP
)$(notdir $(tool
)))
710 ifneq (,$(INSTALLSHARE
))
711 $(Q
)$(RMDIR
) $(foreach tool
,$(INSTALLSHARE
),$(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLSHARERELPATH
)$(PATHSEP
)$(notdir $(tool
)))
716 $(info [=] TAR ..
/proxmark3-
$(platform
)-bin.
tar)
717 $(Q
)$(TAR
) $(TARFLAGS
) ..
/proxmark3-
$(platform
)-bin.
tar $(BINS
:%=client
/%) $(WINBINS
:%=client
/%)
719 ###########################
720 # local libraries targets #
721 ###########################
724 $(Q
)$(MAKE
) --no-print-directory
-C
$(AMIIBOLIBPATH
) all
726 $(CLIPARSERLIB
): .FORCE
728 $(Q
)$(MAKE
) --no-print-directory
-C
$(CLIPARSERLIBPATH
) all
730 $(HARDNESTEDLIB
): .FORCE
732 $(Q
)$(MAKE
) --no-print-directory
-C
$(HARDNESTEDLIBPATH
) all
734 $(JANSSONLIB
): .FORCE
735 ifneq ($(JANSSON_FOUND
),1)
737 $(Q
)$(MAKE
) --no-print-directory
-C
$(JANSSONLIBPATH
) all
741 ifneq ($(LUA_FOUND
),1)
742 $(info [*] MAKE
$@ for
$(LUAPLATFORM
))
743 $(Q
)$(MAKE
) --no-print-directory
-C
$(LUALIBPATH
) $(LUAPLATFORM
)
746 $(MBEDTLSLIB
): .FORCE
748 $(Q
)$(MAKE
) --no-print-directory
-C
$(MBEDTLSLIBPATH
) OBJDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
) BINDIR
=$(MBEDTLSLIBCLIENTRELPATH
)/$(OBJDIR
) all
752 $(Q
)$(MAKE
) --no-print-directory
-C
$(REVENGLIBPATH
) all
754 $(TINYCBORLIB
): .FORCE
756 $(Q
)$(MAKE
) --no-print-directory
-C
$(TINYCBORLIBPATH
) all
758 $(WHEREAMILIB
): .FORCE
759 ifneq ($(WHEREAMI_FOUND
),1)
761 $(Q
)$(MAKE
) --no-print-directory
-C
$(WHEREAMILIBPATH
) all
768 src
/pm3_luawrap.c
: pm3.i
770 $(Q
)$(SWIG
) -lua
-o
$@
$<
772 src
/pm3_pywrap.c
: pm3.i
774 $(Q
)$(SWIG
) -python
-o
$@
$<
780 .PHONY
: all clean install uninstall tarbin .FORCE
782 # version_pm3.c should be remade on every compilation
783 src
/version_pm3.c
: default_version_pm3.c
785 $(Q
)$(SH
) ..
/tools
/mkversion.sh
> $@ ||
$(PERL
) ..
/tools
/mkversion.pl
> $@ ||
$(CP
) $< $@
787 # easy printing of MAKE VARIABLES
788 print-
%: ; @echo
$* = $($*)
790 # SWIG files emit a number of warnings, we've to ignore them
792 $(OBJDIR
)/%wrap.o
: %wrap.c
$(OBJDIR
)/%.d
794 $(Q
)$(MKDIR
) $(dir $@
)
795 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -Wno-missing-prototypes
-Wno-missing-declarations
-Wno-missing-field-initializers
-c
-o
$@
$<
799 $(OBJDIR
)/%.o
: %.c
$(OBJDIR
)/%.d
801 $(Q
)$(MKDIR
) $(dir $@
)
802 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
806 $(OBJDIR
)/%.o
: %.
cpp $(OBJDIR
)/%.d
808 $(Q
)$(MKDIR
) $(dir $@
)
809 $(Q
)$(CXX
) $(DEPFLAGS
) $(PM3CXXFLAGS
) $(CXXINCLUDES
) -c
-o
$@
$<
813 $(OBJDIR
)/%.o
: %.m
$(OBJDIR
)/%.d
815 $(Q
)$(MKDIR
) $(dir $@
)
816 $(Q
)$(CC
) $(DEPFLAGS
) $(PM3CFLAGS
) -c
-o
$@
$<
819 DEPENDENCY_FILES
= $(patsubst %.c
, $(OBJDIR
)/%.d
, $(SRCS
)) \
820 $(patsubst %wrap.c
, $(OBJDIR
)/%.d
, $(SWIGSRCS
)) \
821 $(patsubst %.
cpp, $(OBJDIR
)/%.d
, $(CXXSRCS
)) \
822 $(patsubst %.m
, $(OBJDIR
)/%.d
, $(OBJCSRCS
))
824 $(DEPENDENCY_FILES
): ;
825 .PRECIOUS
: $(DEPENDENCY_FILES
)
827 -include $(DEPENDENCY_FILES
)