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