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 11# Makefile for echo client and server
22
3- CXX = g++ $(CCFLAGS )
3+ CXX = g++ $(CXXFLAGS )
44
55ECHO-SERVER = echo-server.o server.o
66ECHO-CLIENT = echo-client.o client.o
77OBJS = $(ECHO-SERVER ) $(ECHO-CLIENT )
88
99LIBS =
1010
11- CCFLAGS = -g
11+ CXXFLAGS = -g
1212
13- all : echo- server echo- client
13+ all : server client
1414
15- echo- server :$(ECHO-SERVER )
15+ server :$(ECHO-SERVER )
1616 $(CXX ) -o server $(ECHO-SERVER ) $(LIBS )
1717
18- echo- client :$(ECHO-CLIENT )
18+ client :$(ECHO-CLIENT )
1919 $(CXX ) -o client $(ECHO-CLIENT ) $(LIBS )
2020
2121clean :
@@ -24,11 +24,7 @@ clean:
2424realclean :
2525 rm -f $(OBJS ) $(OBJS:.o=.d ) server client
2626
27+ % .o : % .cc
28+ $(CXX ) -c -o $@ -MD -MP ${CPPFLAGS} ${CXXFLAGS} $<
2729
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