]> cvs.zerfleddert.de Git - proxmark3-svn/blob - client/Makefile
/client/Makefile: Output object files to the obj subdir.
[proxmark3-svn] / client / Makefile
1 CC=gcc
2 CXX=g++
3 #COMMON_FLAGS = -m32
4
5 VPATH = ../common
6 OBJDIR = obj
7
8 LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread
9 LDFLAGS = $(COMMON_FLAGS)
10 CFLAGS = -std=gnu99 -I. -I../include -I../common -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g3
11
12 CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall
13 QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
14
15 CMDSRCS = \
16 crc16.c \
17 iso14443crc.c \
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
35 CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o)
36
37 ifeq ($(shell uname),Darwin)
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
41 endif
42
43 ifneq ($(QTLDLIBS),)
44 QTGUI = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
45 CFLAGS += -DHAVE_GUI
46 MOC ?= $(shell pkg-config --variable=moc_location QtCore)
47 LINK.o = $(LINK.cpp)
48 else
49 QTGUI = guidummy.o
50 endif
51
52 RM = rm -f
53 BINS = proxmark3 snooper cli flasher
54 CLEAN = cli cli.exe flasher flasher.exe proxmark3 proxmark3.exe snooper snooper.exe $(CMDOBJS) $(OBJDIR)/*.o *.o *.moc.cpp
55
56 all: $(BINS)
57
58 all-static: LDLIBS:=-static $(LDLIBS)
59 all-static: snooper cli flasher
60
61 proxmark3: LDLIBS+=$(QTLDLIBS)
62 proxmark3: $(OBJDIR)/proxmark3.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(QTGUI)
63 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
64
65 snooper: $(OBJDIR)/snooper.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(OBJDIR)/guidummy.o
66 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
67
68 cli: $(OBJDIR)/cli.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(OBJDIR)/guidummy.o
69 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
70
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 $@ $<
79
80 proxguiqt.moc.cpp: proxguiqt.h
81 $(MOC) -o$@ $^
82
83 clean:
84 $(RM) $(CLEAN)
85
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
97 .PHONY: all clean
Impressum, Datenschutz