1)我无法理解第14,15,29-37行。他们的意思是什么?
2)第27行生成的文件“dir.h”也包含在rls_clnt.c和rls_svc.c中。我需要在第5行和第7行指定“dir.h”吗?
1 CLIENT = dir_client
2 SERVER = dir_server
3
4 SOURCES_CLNT.c = rls_clnt.c
5 SOURCES_CLNT.h =
6 SOURCES_SVC.c = rls_svc.c
7 SOURCES_SVC.h =
8 SOURCES.x = dir.x
9
10 TARGETS_SVC.c = dir_svc.c dir_xdr.c
11 TARGETS_CLNT.c = dir_clnt.c dir_xdr.c
12 TARGETS = dir.h dir_xdr.c dir_clnt.c dir_svc.c
13
14 OBJECTS_CLNT = $(SOURCES_CLNT.c:%.c=%.o) $(TARGETS_CLNT.c:%.c=%.o)
15 OBJECTS_SVC = $(SOURCES_SVC.c:%.c=%.o) $(TARGETS_SVC.c:%.c=%.o)
16 # Compiler flags
17
18 CFLAGS += -g
19 LDLIBS += -lnsl
20 RPCGENFLAGS =
21
22 # Targets
23
24 all : $(CLIENT) $(SERVER)
25
26 $(TARGETS) : $(SOURCES.x)
27 rpcgen $(RPCGENFLAGS) $(SOURCES.x)
28
29 $(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) $(TARGETS_CLNT.c)
30
31 $(OBJECTS_SVC) : $(SOURCES_SVC.c) $(SOURCES_SVC.h) $(TARGETS_SVC.c)
32
33 $(CLIENT) : $(OBJECTS_CLNT)
34 $(LINK.c) -o $(CLIENT) $(OBJECTS_CLNT) $(LDLIBS)
35
36 $(SERVER) : $(OBJECTS_SVC)
37 $(LINK.c) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)
38
39 clean:
40 $(RM) core $(TARGETS) $(OBJECTS_CLNT) $(OBJECTS_SVC) $(CLIENT) $(SERVER)
〜