]>
Commit | Line | Data |
---|---|---|
91c38cf7 | 1 | CC=gcc |
709b784c | 2 | #COMMON_FLAGS = -m32 |
022c8791 | 3 | |
7fe9b0b7 | 4 | VPATH = ../common |
5 | ||
a99c6a19 | 6 | LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread |
709b784c | 7 | LDFLAGS = $(COMMON_FLAGS) |
535b5a59 | 8 | CFLAGS = -std=gnu99 -I. -I../include -I../common -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g3 |
6658905f | 9 | |
940a2012 | 10 | WINLIBS = -lgdi32 -lsetupapi |
022c8791 | 11 | CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall |
12 | QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null) | |
13 | ||
7fe9b0b7 | 14 | CMDSRCS = \ |
91c38cf7 | 15 | crc16.c \ |
16 | iso14443crc.c \ | |
7fe9b0b7 | 17 | data.c \ |
18 | graph.c \ | |
19 | ui.c \ | |
20 | cmddata.c \ | |
21 | cmdhf.c \ | |
22 | cmdhf14a.c \ | |
23 | cmdhf14b.c \ | |
24 | cmdhf15.c \ | |
25 | cmdhflegic.c \ | |
26 | cmdhw.c \ | |
27 | cmdlf.c \ | |
28 | cmdlfem4x.c \ | |
29 | cmdlfhid.c \ | |
30 | cmdlfti.c \ | |
31 | cmdparser.c \ | |
32 | cmdmain.c | |
33 | ||
34 | CMDOBJS = $(CMDSRCS:.c=.o) | |
35 | ||
1e1b3030 | 36 | ifeq ($(shell echo ""),) |
37 | ||
022c8791 | 38 | ifeq ($(shell uname),Darwin) |
f39c4119 | 39 | CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers |
40 | QTLDLIBS = -framework QtGui -framework QtCore | |
41 | MOC = moc | |
022c8791 | 42 | endif |
f39c4119 | 43 | |
789d706a | 44 | ifneq ($(QTLDLIBS),) |
6658905f | 45 | QTGUI = proxgui.o proxguiqt.o proxguiqt.moc.o |
46 | CFLAGS += -DHAVE_GUI | |
5ed2c738 | 47 | MOC ?= $(shell pkg-config --variable=moc_location QtCore) |
6658905f | 48 | LINK.o = $(LINK.cpp) |
49 | else | |
50 | QTGUI = guidummy.o | |
51 | endif | |
52 | ||
940a2012 | 53 | RM = rm -f |
54 | BINS = proxmark3 snooper cli flasher | |
7fe9b0b7 | 55 | CLEAN = cli flasher proxmark3 snooper *.o $(CMDOBJS) *.moc.cpp |
940a2012 | 56 | else |
57 | RM = del | |
58 | BINS = prox.exe | |
59 | CLEAN = prox.exe | |
60 | endif | |
61 | ||
62 | all: $(BINS) | |
6658905f | 63 | |
709b784c | 64 | all-static: LDLIBS:=-static $(LDLIBS) |
65 | all-static: snooper cli flasher | |
66 | ||
91c38cf7 | 67 | prox.exe: prox.o wingui.o $(CMDOBJS) flash.o |
68 | $(CC) $(CFLAGS) $(DEFINES) -o prox.exe prox.o wingui.o $(CMDOBJS) flash.c $(WINLIBS) | |
940a2012 | 69 | |
709b784c | 70 | proxmark3: LDLIBS+=$(QTLDLIBS) |
7fe9b0b7 | 71 | proxmark3: proxmark3.o $(CMDOBJS) proxusb.o $(QTGUI) |
3f030abe | 72 | |
7fe9b0b7 | 73 | snooper: snooper.o $(CMDOBJS) proxusb.o guidummy.o |
6658905f | 74 | |
7fe9b0b7 | 75 | cli: cli.o $(CMDOBJS) proxusb.o guidummy.o |
db917a16 | 76 | |
7fe9b0b7 | 77 | flasher: flash.o flasher.o proxusb.o |
06735128 | 78 | |
6658905f | 79 | proxguiqt.moc.cpp: proxguiqt.h |
80 | $(MOC) -o$@ $^ | |
81 | ||
82 | clean: | |
940a2012 | 83 | $(RM) $(CLEAN) |
6658905f | 84 | |
022c8791 | 85 | # must be run as root |
86 | install_kext: Info.plist | |
87 | mkdir -p /System/Library/Extensions/Proxmark3.kext/Contents | |
88 | cp Info.plist /System/Library/Extensions/Proxmark3.kext/Contents | |
89 | chown -R root:wheel /System/Library/Extensions/Proxmark3.kext | |
90 | chmod 755 /System/Library/Extensions/Proxmark3.kext /System/Library/Extensions/Proxmark3.kext/Contents | |
91 | chmod 644 /System/Library/Extensions/Proxmark3.kext/Contents/Info.plist | |
92 | rm -rf /System/Library/Caches/com.apple.kext.caches | |
93 | touch /System/Library/Extensions | |
94 | @echo "*** You may need to reboot for the kext to take effect." | |
95 | ||
6658905f | 96 | .PHONY: all clean |