]> git.zerfleddert.de Git - proxmark3-svn/blame - client/Makefile
/client/Makefile: Output object files to the obj subdir.
[proxmark3-svn] / client / Makefile
CommitLineData
91c38cf7 1CC=gcc
46cd4046 2CXX=g++
709b784c 3#COMMON_FLAGS = -m32
022c8791 4
7fe9b0b7 5VPATH = ../common
46cd4046 6OBJDIR = obj
7fe9b0b7 7
a99c6a19 8LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread
709b784c 9LDFLAGS = $(COMMON_FLAGS)
535b5a59 10CFLAGS = -std=gnu99 -I. -I../include -I../common -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g3
6658905f 11
022c8791 12CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall
13QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
14
7fe9b0b7 15CMDSRCS = \
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 35CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o)
7fe9b0b7 36
022c8791 37ifeq ($(shell uname),Darwin)
f39c4119 38CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
39QTLDLIBS = -framework QtGui -framework QtCore
40MOC = moc
022c8791 41endif
f39c4119 42
789d706a 43ifneq ($(QTLDLIBS),)
46cd4046 44QTGUI = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
6658905f 45CFLAGS += -DHAVE_GUI
5ed2c738 46MOC ?= $(shell pkg-config --variable=moc_location QtCore)
6658905f 47LINK.o = $(LINK.cpp)
48else
49QTGUI = guidummy.o
50endif
51
940a2012 52RM = rm -f
53BINS = proxmark3 snooper cli flasher
46cd4046 54CLEAN = cli cli.exe flasher flasher.exe proxmark3 proxmark3.exe snooper snooper.exe $(CMDOBJS) $(OBJDIR)/*.o *.o *.moc.cpp
940a2012 55
56all: $(BINS)
6658905f 57
709b784c 58all-static: LDLIBS:=-static $(LDLIBS)
59all-static: snooper cli flasher
940a2012 60
709b784c 61proxmark3: LDLIBS+=$(QTLDLIBS)
46cd4046 62proxmark3: $(OBJDIR)/proxmark3.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(QTGUI)
63 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
3f030abe 64
46cd4046 65snooper: $(OBJDIR)/snooper.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(OBJDIR)/guidummy.o
66 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
6658905f 67
46cd4046 68cli: $(OBJDIR)/cli.o $(CMDOBJS) $(OBJDIR)/proxusb.o $(OBJDIR)/guidummy.o
69 $(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
db917a16 70
46cd4046 71flasher: $(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 80proxguiqt.moc.cpp: proxguiqt.h
81 $(MOC) -o$@ $^
82
83clean:
940a2012 84 $(RM) $(CLEAN)
6658905f 85
022c8791 86# must be run as root
87install_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
Impressum, Datenschutz