File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1
1
# Makefile for echo client and server
2
2
3
- CXX = g++ $(CCFLAGS )
3
+ CXX = g++ $(CXXFLAGS )
4
4
5
5
ECHO-SERVER = echo-server.o server.o
6
6
ECHO-CLIENT = echo-client.o client.o
7
7
OBJS = $(ECHO-SERVER ) $(ECHO-CLIENT )
8
8
9
9
LIBS =
10
10
11
- CCFLAGS = -g
11
+ CXXFLAGS = -g
12
12
13
- all : echo- server echo- client
13
+ all : server client
14
14
15
- echo- server :$(ECHO-SERVER )
15
+ server :$(ECHO-SERVER )
16
16
$(CXX ) -o server $(ECHO-SERVER ) $(LIBS )
17
17
18
- echo- client :$(ECHO-CLIENT )
18
+ client :$(ECHO-CLIENT )
19
19
$(CXX ) -o client $(ECHO-CLIENT ) $(LIBS )
20
20
21
21
clean :
@@ -24,11 +24,7 @@ clean:
24
24
realclean :
25
25
rm -f $(OBJS ) $(OBJS:.o=.d ) server client
26
26
27
+ % .o : % .cc
28
+ $(CXX ) -c -o $@ -MD -MP ${CPPFLAGS} ${CXXFLAGS} $<
27
29
28
- # These lines ensure that dependencies are handled automatically.
29
- % .d : % .cc
30
- $(SHELL ) -ec ' $(CC) -M $(CPPFLAGS) $< \
31
- | sed ' \' ' s/\($*\)\.o[ :]*/\1.o $@ : /g' \' ' > $@; \
32
- [ -s $@ ] || rm -f $@ '
33
-
34
- include $(OBJS :.o=.d)
30
+ -include $(OBJS :.o=.d)
You can’t perform that action at this time.
0 commit comments