-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (22 loc) · 688 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (22 loc) · 688 Bytes
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
# Makefile for echo client and server
CXX= g++ $(CCFLAGS)
ECHO-SERVER= echo-server.o server.o message.o
ECHO-CLIENT= echo-client.o client.o
OBJS = $(ECHO-SERVER) $(ECHO-CLIENT)
LIBS=
CCFLAGS= -g
all: echo-server echo-client
echo-server:$(ECHO-SERVER)
$(CXX) -o server $(ECHO-SERVER) $(LIBS)
echo-client:$(ECHO-CLIENT)
$(CXX) -o client $(ECHO-CLIENT) $(LIBS)
clean:
rm -f $(OBJS) $(OBJS:.o=.d)
realclean:
rm -f $(OBJS) $(OBJS:.o=.d) server client
# These lines ensure that dependencies are handled automatically.
%.d: %.cc
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
include $(OBJS:.o=.d)