-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 loc) · 792 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
.PHONY: all, clean
# Disable implicit rules
.SUFFIXES:
# Keep intermediate files
#.PRECIOUS: %.o
CC = gcc
CFLAGS = -g -Wall -Werror
LDFLAGS =
# Note: -lnsl does not seem to work on Mac OS but will
# probably be necessary on Solaris for linking network-related functions
#LIBS += -lsocket -lnsl -lrt
LIBS += -lpthread
INCLUDE = csapp.h client_file_processor.h server.h request_processor.h server_com.h server_file_processor.h client.h client_com.h
OBJS = csapp.o client_file_processor.o request_processor.o server_com.o server_file_processor.o client_com.o
INCLDIR = -I.
PROGS = server client
all: $(PROGS)
%.o: %.c $(INCLUDE)
$(CC) $(CFLAGS) $(INCLDIR) -c -o $@ $<
%: %.o $(OBJS)
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
# $(CC) -o $@ $(LDFLAGS) $(LIBS) $^
clean:
rm -f $(PROGS) *.o