-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.rpc
60 lines (40 loc) · 1.34 KB
/
Makefile.rpc
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
# This is a template Makefile generated by rpcgen
# Parameters
CLIENT = server
SERVER = rpc_server
LISTA = lista.o
LINES = lines.o
SOURCES_CLNT.c =
SOURCES_CLNT.h =
SOURCES_SVC.c =
SOURCES_SVC.h =
SOURCES.x = rpc.x
TARGETS_SVC.c = rpc_svc.c rpc_server.c
TARGETS_CLNT.c = rpc_clnt.c server.c
TARGETS = rpc.h rpc_clnt.c rpc_svc.c server.c rpc_server.c
OBJECTS_CLNT = $(SOURCES_CLNT.c:%.c=%.o) $(TARGETS_CLNT.c:%.c=%.o)
OBJECTS_SVC = $(SOURCES_SVC.c:%.c=%.o) $(TARGETS_SVC.c:%.c=%.o)
# Compiler flags
CC = gcc
CPPFLAGS += -D_REENTRANT
CFLAGS += -g -I/usr/include/tirpc
LDLIBS += -lnsl -lpthread -ldl -ltirpc
RPCGENFLAGS =
# Archivos generados por rpcgen
RPCGEN_OUTPUT = rpc.h rpc_xdr.c rpc_clnt.c rpc_svc.c
# Targets
all: $(LISTA) $(LINES) $(CLIENT) $(SERVER)
$(TARGETS) : $(SOURCES.x)
rpcgen $(RPCGENFLAGS) $(SOURCES.x)
$(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) $(TARGETS_CLNT.c)
$(OBJECTS_SVC) : $(SOURCES_SVC.c) $(SOURCES_SVC.h) $(TARGETS_SVC.c)
$(CLIENT) : $(OBJECTS_CLNT)
$(LINK.c) -o $(CLIENT) $(OBJECTS_CLNT) $(LDLIBS) $(LISTA) $(LINES)
$(SERVER) : $(OBJECTS_SVC)
$(LINK.c) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)
$(LISTA): lista.c
$(CC) -c -o lista.o lista.c $(CFLAGS)
$(LINES): lines.c
$(CC) -c -o lines.o lines.c $(CFLAGS)
clean:
$(RM) core $(TARGETS) $(OBJECTS_CLNT) $(OBJECTS_SVC) $(CLIENT) $(SERVER)