-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (28 loc) · 769 Bytes
/
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
36
37
38
# all: library.cpp main.cpp
#
# $@ evaluates to all
# $< evaluates to library.cpp
# $^ evaluates to library.cpp main.cpp
CC = g++
CFLAGS = -Wall -std=c++1z
CL_OBJ = client.o utils.o
TR_OBJ = tracker.o utils.o
DEPS = utils.h
# all such targets which do not create a file
.PHONY : all clean
%.o: %.cpp $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $< -lcrypto -pthread
# rule to build both tracker and client
# TODO: find if this is the correct way to do this
all:
make tracker
make client
tracker: $(TR_OBJ)
$(CC) $(CFLAGS) -o $@ $^ -lcrypto -pthread
# -lcrypto will include the crypto library from openssl
client: $(CL_OBJ)
$(CC) $(CFLAGS) -o $@ $^ -lcrypto -pthread
clean:
rm -f *.o tracker client
removejunk:
git ls-files -z -o --exclude-standard | xargs -0 rm