]>
Commit | Line | Data |
---|---|---|
1 | WINCC=c:\mingw\bin\gcc | |
2 | ||
3 | #COMMON_FLAGS = -m32 | |
4 | ||
5 | LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread | |
6 | LDFLAGS = $(COMMON_FLAGS) | |
7 | CFLAGS = -I. -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) | |
8 | ||
9 | WINLIBS = -lgdi32 -lsetupapi | |
10 | CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall | |
11 | QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null) | |
12 | ||
13 | ifeq ($(shell uname),Darwin) | |
14 | CXXFLAGS += -arch i386 -DQ_WS_MAC32 | |
15 | CFLAGS += -arch i386 | |
16 | QTLDLIBS += -arch i386 | |
17 | endif | |
18 | ||
19 | ifneq ($(QTLDLIBS),) | |
20 | QTGUI = proxgui.o proxguiqt.o proxguiqt.moc.o | |
21 | CFLAGS += -DHAVE_GUI | |
22 | MOC = $(shell pkg-config --variable=moc_location QtCore) | |
23 | LINK.o = $(LINK.cpp) | |
24 | else | |
25 | QTGUI = guidummy.o | |
26 | endif | |
27 | ||
28 | ifeq ($(shell echo ""),) | |
29 | RM = rm -f | |
30 | BINS = proxmark3 snooper cli flasher | |
31 | CLEAN = cli flasher proxmark3 snooper *.o *.moc.cpp | |
32 | else | |
33 | RM = del | |
34 | BINS = prox.exe | |
35 | CLEAN = prox.exe | |
36 | endif | |
37 | ||
38 | all: $(BINS) | |
39 | ||
40 | all-static: LDLIBS:=-static $(LDLIBS) | |
41 | all-static: snooper cli flasher | |
42 | ||
43 | prox.exe: prox.c wingui.c command.c | |
44 | $(WINCC) $(CFLAGS) $(DEFINES) -o prox.exe prox.c wingui.c command.c $(WINLIBS) | |
45 | ||
46 | proxmark3: LDLIBS+=$(QTLDLIBS) | |
47 | proxmark3: proxmark3.o gui.o command.o usb.o $(QTGUI) | |
48 | ||
49 | command.o: command.c | |
50 | ||
51 | snooper: snooper.o gui.o command.o usb.o guidummy.o | |
52 | ||
53 | cli: cli.o gui.o command.o usb.o guidummy.o | |
54 | ||
55 | flasher: flasher.o usb.o | |
56 | ||
57 | proxguiqt.moc.cpp: proxguiqt.h | |
58 | $(MOC) -o$@ $^ | |
59 | ||
60 | clean: | |
61 | $(RM) $(CLEAN) | |
62 | ||
63 | # must be run as root | |
64 | install_kext: Info.plist | |
65 | mkdir -p /System/Library/Extensions/Proxmark3.kext/Contents | |
66 | cp Info.plist /System/Library/Extensions/Proxmark3.kext/Contents | |
67 | chown -R root:wheel /System/Library/Extensions/Proxmark3.kext | |
68 | chmod 755 /System/Library/Extensions/Proxmark3.kext /System/Library/Extensions/Proxmark3.kext/Contents | |
69 | chmod 644 /System/Library/Extensions/Proxmark3.kext/Contents/Info.plist | |
70 | rm -rf /System/Library/Caches/com.apple.kext.caches | |
71 | touch /System/Library/Extensions | |
72 | @echo "*** You may need to reboot for the kext to take effect." | |
73 | ||
74 | .PHONY: all clean |