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