]>
Commit | Line | Data |
---|---|---|
4a121f99 DL |
1 | # |
2 | # libfrr | |
3 | # | |
4 | lib_LTLIBRARIES += lib/libfrr.la | |
42efb0d4 | 5 | lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version |
1c2facd1 | 6 | lib_libfrr_la_LIBADD = @LIBCAP@ $(UNWIND_LIBS) -lyang |
4a121f99 DL |
7 | |
8 | lib_libfrr_la_SOURCES = \ | |
8e1f6512 | 9 | lib/agg_table.c \ |
4a121f99 DL |
10 | lib/bfd.c \ |
11 | lib/buffer.c \ | |
12 | lib/checksum.c \ | |
13 | lib/command.c \ | |
14 | lib/command_graph.c \ | |
15 | lib/command_lex.l \ | |
16 | lib/command_match.c \ | |
17 | lib/command_parse.y \ | |
18 | lib/csv.c \ | |
aea03ad6 | 19 | lib/debug.c \ |
4a121f99 DL |
20 | lib/distribute.c \ |
21 | lib/event_counter.c \ | |
3155489a | 22 | lib/ferr.c \ |
4a121f99 DL |
23 | lib/filter.c \ |
24 | lib/frr_pthread.c \ | |
fe011935 | 25 | lib/frrstr.c \ |
4a121f99 DL |
26 | lib/getopt.c \ |
27 | lib/getopt1.c \ | |
28 | lib/grammar_sandbox.c \ | |
29 | lib/graph.c \ | |
30 | lib/hash.c \ | |
31 | lib/hook.c \ | |
32 | lib/if.c \ | |
33 | lib/if_rmap.c \ | |
34 | lib/imsg-buffer.c \ | |
35 | lib/imsg.c \ | |
36 | lib/jhash.c \ | |
37 | lib/json.c \ | |
38 | lib/keychain.c \ | |
b66d022e | 39 | lib/lib_errors.c \ |
4a121f99 DL |
40 | lib/libfrr.c \ |
41 | lib/linklist.c \ | |
42 | lib/log.c \ | |
43 | lib/md5.c \ | |
44 | lib/memory.c \ | |
45 | lib/memory_vty.c \ | |
46 | lib/module.c \ | |
036fdaad | 47 | lib/mpls.c \ |
4a121f99 DL |
48 | lib/network.c \ |
49 | lib/nexthop.c \ | |
e26aedbe PG |
50 | lib/netns_linux.c \ |
51 | lib/netns_other.c \ | |
7ee30f28 | 52 | lib/nexthop_group.c \ |
1c2facd1 RW |
53 | lib/northbound.c \ |
54 | lib/northbound_cli.c \ | |
55 | lib/northbound_db.c \ | |
4a121f99 DL |
56 | lib/openbsd-tree.c \ |
57 | lib/pid_output.c \ | |
58 | lib/plist.c \ | |
59 | lib/pqueue.c \ | |
60 | lib/prefix.c \ | |
61 | lib/privs.c \ | |
62 | lib/ptm_lib.c \ | |
63 | lib/qobj.c \ | |
5318d896 | 64 | lib/ringbuf.c \ |
4a121f99 | 65 | lib/routemap.c \ |
31bfa062 | 66 | lib/sbuf.c \ |
4a121f99 DL |
67 | lib/sha256.c \ |
68 | lib/sigevent.c \ | |
69 | lib/skiplist.c \ | |
70 | lib/sockopt.c \ | |
71 | lib/sockunion.c \ | |
72 | lib/spf_backoff.c \ | |
73 | lib/srcdest_table.c \ | |
74 | lib/stream.c \ | |
75 | lib/strlcat.c \ | |
76 | lib/strlcpy.c \ | |
77 | lib/systemd.c \ | |
78 | lib/table.c \ | |
79 | lib/termtable.c \ | |
80 | lib/thread.c \ | |
81 | lib/vector.c \ | |
82 | lib/vrf.c \ | |
83 | lib/vty.c \ | |
84 | lib/wheel.c \ | |
85 | lib/workqueue.c \ | |
1c2facd1 RW |
86 | lib/yang.c \ |
87 | lib/yang_translator.c \ | |
88 | lib/yang_wrappers.c \ | |
4a121f99 | 89 | lib/zclient.c \ |
e26aedbe | 90 | lib/logicalrouter.c \ |
634949ae | 91 | lib/lua.c \ |
4a121f99 DL |
92 | # end |
93 | ||
74dc19a2 DL |
94 | vtysh_scan += \ |
95 | $(top_srcdir)/lib/distribute.c \ | |
96 | $(top_srcdir)/lib/filter.c \ | |
97 | $(top_srcdir)/lib/if.c \ | |
98 | $(top_srcdir)/lib/if_rmap.c \ | |
99 | $(top_srcdir)/lib/keychain.c \ | |
100 | $(top_srcdir)/lib/logicalrouter.c \ | |
101 | $(top_srcdir)/lib/nexthop_group.c \ | |
102 | $(top_srcdir)/lib/plist.c \ | |
103 | $(top_srcdir)/lib/routemap.c \ | |
104 | $(top_srcdir)/lib/vrf.c \ | |
105 | $(top_srcdir)/lib/vty.c \ | |
106 | # end | |
107 | # can be loaded as DSO - always include for vtysh | |
108 | vtysh_scan += $(top_srcdir)/lib/agentx.c | |
109 | ||
1c2facd1 RW |
110 | if SQLITE3 |
111 | lib_libfrr_la_LIBADD += -lsqlite3 | |
112 | lib_libfrr_la_SOURCES += lib/db.c | |
113 | endif | |
114 | ||
f1b32b2e | 115 | lib/plist_clippy.c: $(CLIPPY_DEPS) |
4a121f99 | 116 | lib/plist.lo: lib/plist_clippy.c |
dba32923 DS |
117 | lib/nexthop_group_clippy.c: $(CLIPPY_DEPS) |
118 | lib/nexthop_group.lo: lib/nexthop_group_clippy.c | |
1c2facd1 RW |
119 | lib/northbound_cli_clippy.c: $(CLIPPY_DEPS) |
120 | lib/northbound_cli.lo: lib/northbound_cli_clippy.c | |
4a121f99 DL |
121 | |
122 | pkginclude_HEADERS += \ | |
8e1f6512 | 123 | lib/agg_table.h \ |
4a121f99 DL |
124 | lib/bfd.h \ |
125 | lib/bitfield.h \ | |
126 | lib/buffer.h \ | |
127 | lib/checksum.h \ | |
128 | lib/command.h \ | |
129 | lib/command_graph.h \ | |
130 | lib/command_match.h \ | |
de1a880c | 131 | lib/compiler.h \ |
4a121f99 | 132 | lib/csv.h \ |
1c2facd1 | 133 | lib/db.h \ |
aea03ad6 | 134 | lib/debug.h \ |
4a121f99 DL |
135 | lib/distribute.h \ |
136 | lib/event_counter.h \ | |
3155489a | 137 | lib/ferr.h \ |
4a121f99 DL |
138 | lib/fifo.h \ |
139 | lib/filter.h \ | |
cd85bc2e | 140 | lib/freebsd-queue.h \ |
4a121f99 DL |
141 | lib/frr_pthread.h \ |
142 | lib/frratomic.h \ | |
fe011935 | 143 | lib/frrstr.h \ |
4a121f99 DL |
144 | lib/getopt.h \ |
145 | lib/graph.h \ | |
146 | lib/hash.h \ | |
147 | lib/hook.h \ | |
148 | lib/if.h \ | |
149 | lib/if_rmap.h \ | |
150 | lib/imsg.h \ | |
151 | lib/ipaddr.h \ | |
152 | lib/jhash.h \ | |
153 | lib/json.h \ | |
154 | lib/keychain.h \ | |
b66d022e | 155 | lib/lib_errors.h \ |
4a121f99 DL |
156 | lib/libfrr.h \ |
157 | lib/libospf.h \ | |
158 | lib/linklist.h \ | |
159 | lib/log.h \ | |
160 | lib/md5.h \ | |
161 | lib/memory.h \ | |
162 | lib/memory_vty.h \ | |
163 | lib/module.h \ | |
164 | lib/monotime.h \ | |
165 | lib/mpls.h \ | |
166 | lib/network.h \ | |
167 | lib/nexthop.h \ | |
7ee30f28 | 168 | lib/nexthop_group.h \ |
1c2facd1 RW |
169 | lib/northbound.h \ |
170 | lib/northbound_cli.h \ | |
171 | lib/northbound_db.h \ | |
4a121f99 DL |
172 | lib/ns.h \ |
173 | lib/openbsd-queue.h \ | |
174 | lib/openbsd-tree.h \ | |
175 | lib/plist.h \ | |
176 | lib/pqueue.h \ | |
177 | lib/prefix.h \ | |
178 | lib/privs.h \ | |
179 | lib/ptm_lib.h \ | |
6833ae01 | 180 | lib/pw.h \ |
4a121f99 | 181 | lib/qobj.h \ |
cd85bc2e | 182 | lib/queue.h \ |
5318d896 | 183 | lib/ringbuf.h \ |
4a121f99 | 184 | lib/routemap.h \ |
31bfa062 | 185 | lib/sbuf.h \ |
4a121f99 DL |
186 | lib/sha256.h \ |
187 | lib/sigevent.h \ | |
188 | lib/skiplist.h \ | |
98ea5be8 | 189 | lib/smux.h \ |
4a121f99 DL |
190 | lib/sockopt.h \ |
191 | lib/sockunion.h \ | |
192 | lib/spf_backoff.h \ | |
193 | lib/srcdest_table.h \ | |
194 | lib/stream.h \ | |
195 | lib/systemd.h \ | |
196 | lib/table.h \ | |
197 | lib/termtable.h \ | |
198 | lib/thread.h \ | |
199 | lib/vector.h \ | |
4a121f99 DL |
200 | lib/vlan.h \ |
201 | lib/vrf.h \ | |
202 | lib/vrf_int.h \ | |
203 | lib/vty.h \ | |
204 | lib/vxlan.h \ | |
205 | lib/wheel.h \ | |
206 | lib/workqueue.h \ | |
1c2facd1 RW |
207 | lib/yang.h \ |
208 | lib/yang_translator.h \ | |
209 | lib/yang_wrappers.h \ | |
4a121f99 DL |
210 | lib/zassert.h \ |
211 | lib/zclient.h \ | |
212 | lib/zebra.h \ | |
e26aedbe | 213 | lib/logicalrouter.h \ |
634949ae | 214 | lib/lua.h \ |
0031a6bb | 215 | lib/pbr.h \ |
4a121f99 DL |
216 | # end |
217 | ||
58f8a9ec | 218 | |
70d27c5b DL |
219 | nodist_pkginclude_HEADERS += \ |
220 | lib/route_types.h \ | |
221 | lib/version.h \ | |
222 | # end | |
223 | ||
4a121f99 DL |
224 | noinst_HEADERS += \ |
225 | lib/clippy.h \ | |
226 | lib/log_int.h \ | |
227 | lib/plist_int.h \ | |
228 | #end | |
229 | ||
d6e76257 DL |
230 | # General note about module and module helper library (libfrrsnmp, libfrrzmq) |
231 | # linking: If we're linking libfrr statically into daemons, we *must* remove | |
232 | # libfrr from modules because modules will always link it in dynamically and | |
233 | # thus 2 copies of libfrr will be loaded... hilarity ensues. | |
234 | # | |
235 | # Not linking libfrr into modules should generally work fine because the | |
236 | # executable refers to libfrr either way and the dynamic linker should make | |
237 | # libfrr available to modules. If some OS platform has a dynamic linker that | |
238 | # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_ | |
239 | # it's not linked into daemons statically. | |
240 | ||
4a121f99 DL |
241 | # |
242 | # SNMP support | |
243 | # | |
244 | if SNMP | |
245 | lib_LTLIBRARIES += lib/libfrrsnmp.la | |
246 | endif | |
247 | ||
7aad1594 | 248 | lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99 |
4a121f99 | 249 | lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0 |
d6e76257 | 250 | lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS) |
4a121f99 DL |
251 | lib_libfrrsnmp_la_SOURCES = \ |
252 | lib/agentx.c \ | |
4a121f99 DL |
253 | lib/snmp.c \ |
254 | # end | |
255 | ||
b6116506 DL |
256 | # |
257 | # ZeroMQ support | |
258 | # | |
259 | if ZEROMQ | |
260 | lib_LTLIBRARIES += lib/libfrrzmq.la | |
261 | pkginclude_HEADERS += lib/frr_zmq.h | |
262 | endif | |
263 | ||
264 | lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS) | |
265 | lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0 | |
d6e76257 | 266 | lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS) |
b6116506 DL |
267 | lib_libfrrzmq_la_SOURCES = \ |
268 | lib/frr_zmq.c \ | |
269 | #end | |
270 | ||
4a121f99 DL |
271 | # |
272 | # CLI utilities | |
273 | # | |
274 | noinst_PROGRAMS += \ | |
4a121f99 DL |
275 | lib/grammar_sandbox \ |
276 | # end | |
277 | ||
89727c8d DL |
278 | if BUILD_CLIPPY |
279 | noinst_PROGRAMS += lib/clippy | |
280 | else | |
281 | $(HOSTTOOLS)lib/clippy: | |
282 | @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy | |
283 | endif | |
284 | ||
4a121f99 DL |
285 | lib_grammar_sandbox_SOURCES = \ |
286 | lib/grammar_sandbox_main.c | |
287 | lib_grammar_sandbox_LDADD = \ | |
288 | lib/libfrr.la | |
289 | ||
dbac691d DL |
290 | lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY |
291 | lib_clippy_CFLAGS = $(PYTHON_CFLAGS) | |
4a121f99 | 292 | lib_clippy_LDADD = $(PYTHON_LIBS) |
dbac691d | 293 | lib_clippy_LDFLAGS = -export-dynamic |
4a121f99 DL |
294 | lib_clippy_SOURCES = \ |
295 | lib/clippy.c \ | |
296 | lib/command_graph.c \ | |
297 | lib/command_lex.l \ | |
298 | lib/command_parse.y \ | |
299 | lib/command_py.c \ | |
300 | lib/defun_lex.l \ | |
301 | lib/graph.c \ | |
302 | lib/memory.c \ | |
303 | lib/vector.c \ | |
304 | # end | |
305 | ||
aad24c5b DL |
306 | # (global) clippy rules for all directories |
307 | ||
308 | AM_V_CLIPPY = $(am__v_CLIPPY_$(V)) | |
309 | am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY)) | |
310 | am__v_CLIPPY_0 = @echo " CLIPPY " $@; | |
311 | am__v_CLIPPY_1 = | |
312 | ||
313 | CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py | |
314 | ||
315 | SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h | |
316 | .c_clippy.c: | |
317 | @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \ | |
318 | $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; } | |
319 | $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $< | |
320 | ||
321 | ## automake's "ylwrap" is a great piece of GNU software... not. | |
322 | .l.c: | |
323 | $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $< | |
324 | .y.c: | |
325 | $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $< | |
4a121f99 DL |
326 | |
327 | # | |
328 | # generated sources & extra foo | |
329 | # | |
330 | EXTRA_DIST += \ | |
331 | lib/command_lex.h \ | |
70d27c5b | 332 | lib/command_parse.h \ |
4a121f99 | 333 | lib/gitversion.pl \ |
4a121f99 DL |
334 | lib/route_types.pl \ |
335 | lib/route_types.txt \ | |
336 | # end | |
337 | ||
338 | BUILT_SOURCES += \ | |
4a121f99 DL |
339 | lib/gitversion.h \ |
340 | lib/route_types.h \ | |
341 | # end | |
342 | ||
f1b32b2e DL |
343 | ## force route_types.h |
344 | $(lib_clippy_OBJECTS): lib/route_types.h | |
345 | $(lib_libfrr_la_OBJECTS): lib/route_types.h | |
346 | ||
4a121f99 DL |
347 | AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@ |
348 | ||
349 | lib/command_lex.h: lib/command_lex.c | |
350 | @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi | |
351 | @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi | |
f1b32b2e | 352 | lib/command_lex.lo: lib/command_parse.h |
4a121f99 | 353 | lib/command_parse.lo: lib/command_lex.h |
f1b32b2e | 354 | lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h |
4a121f99 DL |
355 | lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h |
356 | ||
357 | lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl | |
358 | @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@ | |
67cf020d | 359 | DISTCLEANFILES += lib/route_types.h |
4a121f99 DL |
360 | |
361 | if GIT_VERSION | |
362 | # bit of a trick here to always have up-to-date git stamps without triggering | |
363 | # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always, | |
364 | # but if we use that on gitversion.h it'll ripple through the .c file deps. | |
365 | # (even if gitversion.h's file timestamp doesn't change, make will think it | |
366 | # did, because of .PHONY...) | |
367 | ||
9e53b315 | 368 | PHONY_GITVERSION=lib/gitversion.h.tmp |
4a121f99 DL |
369 | .SILENT: lib/gitversion.h lib/gitversion.h.tmp |
370 | GITH=lib/gitversion.h | |
371 | lib/gitversion.h.tmp: $(top_srcdir)/.git | |
372 | @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp | |
373 | lib/gitversion.h: lib/gitversion.h.tmp | |
bd402424 | 374 | { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH} |
4a121f99 DL |
375 | |
376 | else | |
9e53b315 | 377 | PHONY_GITVERSION=lib/gitversion.h |
4a121f99 DL |
378 | lib/gitversion.h: |
379 | true | |
380 | endif | |
9e53b315 | 381 | .PHONY: $(PHONY_GITVERSION) |