-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
35 lines (26 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CC = g++
BIN = bin
ODIR = obj
CXXFLAGS = -std=c++11 -lnfc
OBJS = $(ODIR)/apdu.o $(ODIR)/nfcManager.o $(ODIR)/nfcUtils.o $(ODIR)/apdu_cli.o
.PHONY : examples
examples : $(ODIR) $(OBJS)
$(CC) -o $(BIN)/apdu_cli $(OBJS) $(CXXFLAGS)
$(CC) -o $(BIN)/select $(OBJS) $(CXXFLAGS)
$(ODIR)/apdu.o : ./nfc/src/apdu.cpp ./nfc/include/apdu.h ./nfc/include/nfcUtils.h
$(CC) -c ./nfc/src/apdu.cpp -o $@ $(CXXFLAGS)
$(ODIR)/nfcManager.o : ./nfc/src/nfcManager.cpp ./nfc/include/nfcManager.h ./nfc/include/apdu.h ./nfc/include/nfcUtils.h
$(CC) -c ./nfc/src/nfcManager.cpp -o $@ $(CXXFLAGS)
$(ODIR)/nfcUtils.o : ./nfc/src/nfcUtils.cpp ./nfc/include/nfcUtils.h
$(CC) -c ./nfc/src/nfcUtils.cpp -o $@ $(CXXFLAGS)
$(ODIR)/apdu_cli.o : ./examples/apdu_cli.cpp ./nfc/include/nfcManager.h ./nfc/include/apdu.h ./nfc/include/nfcUtils.h
$(CC) -c ./examples/apdu_cli.cpp -o $@ $(CXXFLAGS)
$(ODIR)/select.o : ./examples/select.cpp ./nfc/include/nfcManager.h ./nfc/include/apdu.h ./nfc/include/nfcUtils.h
$(CC) -c ./examples/select.cpp -o $@ $(CXXFLAGS)
$(ODIR) :
if [ ! -d $(ODIR) ]; then mkdir $(ODIR); fi
if [ ! -d $(BIN) ]; then mkdir $(BIN); fi
.PHONY : clean
clean :
if [ -d $(ODIR) ]; then rm $(ODIR) -r; fi
if [ -d $(BIN) ]; then rm $(BIN) -r; fi