1 CC := gcc
2 CFLAGS := -O2 -Wall -Werror -g -Iinclude
3 KCFLAGS := $(CFLAGS) -D__KERNEL__ -DMODULE -I/usr/src/linux/include
4
5 PARAPIN_PATH := ../parapin
6
7 VPATH := $(PARAPIN_PATH) include
8
9
10 # Objects needed by librpc (user-level rpc control library)
11 LIBRPCOBJS := librpc/parapin.o librpc/librpc.o librpc/rpc_lowlevel.o
12
13 # Example programs using the librpc library
14 LIBRPC_EXAMPLES := \
15 librpc_examples/rpctorture \
16 librpc_examples/rpcsend \
17 librpc_examples/rpctransceive
18
19 # Object files needed by RPCD - the RPC Daemon - other than librpc
20 RPCDOBJS := rpcd/rpcd.o rpcd/afa_fragmentation.o
21 # Object files needed by the user library for talking to RPCD
22 RPCD_APIOBJS := librpcd_api/realradio.o librpcd_api/rpcd_api.o
23 # Object files needed by both of the above
24 RPCD_SHAREDOBJS := rpcd_shared/udpsend.o rpcd_shared/util.o \
25 rpcd_shared/network.o
26
27 # Example programs that use the RPCD API to talk to the RPC
28 LIBRPCD_API_EXAMPLES := \
29 librpcd_api_examples/apitest \
30 librpcd_api_examples/radiotest \
31 librpcd_api_examples/lossrate
32 # fragtest, fragsend, fragrecv? should we compile those?
33
34 # krpc - the RPC kernel module
35 KRPC_OBJS := krpc/kparapin.o krpc/krpc_lowlevel.o krpc/kafa_fragmentation.o \
36 krpc/rpc-km.o
37
38 KRPC_EXAMPLES := \
39 krpc_examples/select_test \
40 krpc_examples/klossrate \
41 krpc_examples/krpctorture \
42 krpc_examples/kpathloss \
43 krpc_examples/augmented
44
45 ## target definitions
46 KRPC := krpc/krpc.o
47 #default: librpc/librpc.a \
48 # $(LIBRPC_EXAMPLES) \
49 # rpcd/rpcd \
50 # librpcd_api/librpcd_api.a \
51 # $(LIBRPCD_API_EXAMPLES) \
52 # $(KRPC) \
53 # $(KRPC_EXAMPLES)
54
55 default: \
56 $(KRPC) \
57 $(KRPC_EXAMPLES)
58
59 ## target definitions for released version - uncomment for release
60 ## and comment out the above target definitions
61 #KRPC := krpc.o
62 #PARAPIN_PATH := parapin
63 #default: $(KRPC) $(KRPC_EXAMPLES)
64
65 ##########################################################################
66
67 ### librpc
68
69 librpc/librpc.a: $(LIBRPCOBJS) rpc.h parapin.h rpc_lowlevel.h
70 ar -cr librpc/librpc.a $(LIBRPCOBJS)
71
72 librpc/librpc.o: librpc/librpc.c rpc.h rpc_lowlevel.h parapin.h
73 $(CC) $(CFLAGS) -I$(PARAPIN_PATH) -c librpc/librpc.c -o librpc/librpc.o
74
75 librpc/rpc_lowlevel.o: shared/rpc_lowlevel.c parapin.h rpc_lowlevel.h
76 $(CC) $(CFLAGS) -I$(PARAPIN_PATH) -c shared/rpc_lowlevel.c -o librpc/rpc_lowlevel.o
77
78 librpc/parapin.o: $(PARAPIN_PATH)/parapin.c parapin.h parapin-linux.h
79 $(CC) $(CFLAGS) -c -DPARAPIN_LINUX $(PARAPIN_PATH)/parapin.c -o librpc/parapin.o
80
81 ## librpc_examples
82
83 librpc_examples/%: librpc_examples/%.c librpc/librpc.a rpc.h
84 $(CC) $(CFLAGS) $< -o $@ -Llibrpc -lrpc
85
86 ## rpcd
87
88 rpcd/rpcd: $(RPCD_SHAREDOBJS) $(RPCDOBJS) librpc/librpc.a
89 $(CC) $(CFLAGS) -o rpcd/rpcd $(RPCD_SHAREDOBJS) $(RPCDOBJS) -Llibrpc -lrpc
90
91 rpcd/afa_fragmentation.o: shared/afa_fragmentation.c afa_fragmentation.h rpcd.h
92 $(CC) $(CFLAGS) -c shared/afa_fragmentation.c -o rpcd/afa_fragmentation.o
93
94 rpcd/%.o: rpcd/%.c rpcd_api.h rpcd.h rpc.h afa_fragmentation.h
95 $(CC) $(CFLAGS) -c $< -o $@
96
97 rpcd_shared/%.o: rpcd_shared/%.c rpcd_api.h rpcd.h
98 $(CC) $(CFLAGS) -c $< -o $@
99
100 ## rpcd API
101
102 librpcd_api/librpcd_api.a: $(RPCD_SHAREDOBJS) $(RPCD_APIOBJS)
103 ar -cr librpcd_api/librpcd_api.a $(RPCD_SHAREDOBJS) $(RPCD_APIOBJS)
104
105 librpcd_api/%.o: librpcd_api/%.c rpcd_api.h rpcd.h
106 $(CC) $(CFLAGS) -c $< -o $@
107
108 ## example programs that use the rpcd API
109
110 librpcd_api_examples/%: librpcd_api_examples/%.c librpcd_api/librpcd_api.a rpcd_api.h
111 $(CC) $(CFLAGS) -g -o $@ $< -Llibrpcd_api -lrpcd_api
112
113 # RPC kernel module: krpc
114
115 $(KRPC): $(KRPC_OBJS)
116 ld -i -o $(KRPC) $(KRPC_OBJS)
117
118 krpc/kparapin.o: $(PARAPIN_PATH)/parapin.c parapin.h parapin-linux.h
119 $(CC) $(KCFLAGS) -c -DPARAPIN_LINUX $(PARAPIN_PATH)/parapin.c -o krpc/kparapin.o
120
121 krpc/krpc_lowlevel.o: shared/rpc_lowlevel.c parapin.h rpc_lowlevel.h
122 $(CC) $(KCFLAGS) -I$(PARAPIN_PATH) -c shared/rpc_lowlevel.c -o krpc/krpc_lowlevel.o
123
124 krpc/kafa_fragmentation.o: shared/afa_fragmentation.c afa_fragmentation.h krpc.h
125 $(CC) $(KCFLAGS) -c shared/afa_fragmentation.c -o krpc/kafa_fragmentation.o
126
127 krpc/%.o: krpc/%.c rpc_lowlevel.h krpc.h
128 $(CC) $(KCFLAGS) -I$(PARAPIN_PATH) -c $< -o $@
129
130 krpc_examples/%: krpc_examples/%.c
131 $(CC) $(CFLAGS) -g -o $@ $<
132
133
134
135 #### Other utility targets
136
137 clean:
138 rm -f *.[oa] */*.[oa] \
139 rpcd/rpcd $(LIBRPC_EXAMPLES) $(LIBRPCD_API_EXAMPLES) \
140 $(KRPC_EXAMPLES)
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.