-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
43 lines (29 loc) · 1.04 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
36
37
38
39
40
41
42
43
#
# Makefile for Proxy Lab
#
# You may modify is file any way you like (except for the handin
# rule). Autolab will execute the command "make" on your specific
# Makefile to build your proxy from sources.
#
CC = gcc
CFLAGS = -g -Wall
LDFLAGS = -lpthread
all: proxy
%.o: %.c
$(CC) $(CFLAGS) -c $<
H_FILES = util.h bytes.h csapp.h cache.h
OBJ_SRC = csapp.c bytes.c util.c cache.c
PROXY_SRC = $(OBJ_SRC) proxy.c
PROXY_OBJ = $(PROXY_SRC:%c=%o)
proxy: $(PROXY_OBJ) $(H_FILES)
$(CC) $(CFLAGS) $(LDFLAGS) $(PROXY_OBJ) -o $@
TEST_SRC = $(OBJ_SRC) test.c
TEST_OBJ = $(TEST_SRC:%c=%o)
test: $(TEST_OBJ) $(H_FILES)
$(CC) $(CFLAGS) $(LDFLAGS) $(TEST_OBJ) -o $@
# Creates a tarball in ../proxylab-handin.tar that you should then
# hand in to Autolab. DO NOT MODIFY THIS!
handin:
(make clean; cd ..; tar cvf proxylab-handin.tar proxylab-handout --exclude tiny --exclude nop-server.py --exclude proxy --exclude driver.sh --exclude port-for-user.pl --exclude free-port.sh --exclude ".*")
clean:
rm -f *~ *.o proxy core *.tar *.zip *.gzip *.bzip *.gz test