-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (34 loc) · 1.1 KB
/
Makefile
File metadata and controls
48 lines (34 loc) · 1.1 KB
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
39
40
41
42
43
44
45
46
47
48
# Some variables
CC = gcc
CFLAGS = -g -Wall -DDEBUG -O3
LDFLAGS = -lm
#TESTDEFS = -DTESTING # comment this out to disable debugging code
OBJS = peer.o bt_parse.o spiffy.o debug.o input_buffer.o chunk.o sha.o job.o queue.o conn.o timer.o
MK_CHUNK_OBJS = make_chunks.o chunk.o sha.o
BINS = peer make-chunks
TESTBINS = test_debug test_input_buffer
# Implicit .o target
.c.o:
$(CC) $(TESTDEFS) -c $(CFLAGS) $<
# Explit build and testing targets
all: ${BINS} ${TESTBINS}
run: peer_run
./peer_run
test: peer_test
./peer_test
peer: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
make-chunks: $(MK_CHUNK_OBJS)
$(CC) $(CFLAGS) $(MK_CHUNK_OBJS) -o $@ $(LDFLAGS)
clean:
rm -f *.o $(BINS) $(TESTBINS)
bt_parse.c: bt_parse.h
conn.c: job.h
# The debugging utility code
debug-text.h: debug.h
./debugparse.pl < debug.h > debug-text.h
test_debug.o: debug.c debug-text.h
${CC} debug.c ${INCLUDES} ${CFLAGS} -c -D_TEST_DEBUG_ -o $@
test_input_buffer: test_input_buffer.o input_buffer.o
handin:
(make clean; cd ..; tar cvf handin.tar 15-441-project-2 --exclude='tmp' --exclude='example')