-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (51 loc) · 2.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This is a sample Makefile which compiles source files named:
# - tcpechotimeserv.c
# - tcpechotimecli.c
# - time_cli.c
# - echo_cli.c
# and creating executables: "server", "client", "time_cli"
# and "echo_cli", respectively.
#
# It uses various standard libraries, and the copy of Stevens'
# library "libunp.a" in ~cse533/Stevens/unpv13e_solaris2.10 .
#
# It also picks up the thread-safe version of "readline.c"
# from Stevens' directory "threads" and uses it when building
# the executable "server".
#
# It is set up, for illustrative purposes, to enable you to use
# the Stevens code in the ~cse533/Stevens/unpv13e_solaris2.10/lib
# subdirectory (where, for example, the file "unp.h" is located)
# without your needing to maintain your own, local copies of that
# code, and without your needing to include such code in the
# submissions of your assignments.
#
# Modify it as needed, and include it with your submission.
CC = gcc
LIBS = -lresolv -lnsl -lpthread\
/home/hector/Documents/network_programming/unpv13e/libunp.a\
FLAGS = -g -O2
CFLAGS = ${FLAGS} -I/home/hector/Documents/unpv13e/lib
all: client server echo_cli time_cli
time_cli: time_cli.o
${CC} ${FLAGS} -o time_cli time_cli.o ${LIBS}
time_cli.o: time_cli.c
${CC} ${CFLAGS} -c time_cli.c
echo_cli: echo_cli.o
${CC} ${FLAGS} -o echo_cli echo_cli.o ${LIBS}
echo_cli.o: echo_cli.c
${CC} ${CFLAGS} -c echo_cli.c
# server uses the thread-safe version of readline.c
server: tcpechotimesrv.o readline.o
${CC} ${FLAGS} -o server tcpechotimesrv.o readline.o ${LIBS}
tcpechotimesrv.o: tcpechotimesrv.c
${CC} ${CFLAGS} -c tcpechotimesrv.c
client: tcpechotimecli.o
${CC} ${FLAGS} -o client tcpechotimecli.o ${LIBS}
tcpechotimecli.o: tcpechotimecli.c
${CC} ${CFLAGS} -c tcpechotimecli.c
# pick up the thread-safe version of readline.c from directory "threads"
readline.o: /home/hector/Documents/unpv13e/threads/readline.c
${CC} ${CFLAGS} -c /home/hector/Documents/unpv13e/threads/readline.c
clean:
rm echo_cli echo_cli.o server tcpechotimesrv.o client tcpechotimecli.o time_cli time_cli.o readline.o *~