]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #13386 from donaldsharp/bgp_received_routes
[mirror_frr.git] / lib / subdir.am
1 #
2 # libfrr
3 #
4
5 lib_LTLIBRARIES += lib/libfrr.la
6 lib_libfrr_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0 -Xlinker -e_libfrr_version
7 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBCRYPT) $(LIBDL) $(LIBM)
8
9 lib_libfrr_la_SOURCES = \
10 lib/admin_group.c \
11 lib/affinitymap.c \
12 lib/affinitymap_cli.c \
13 lib/affinitymap_northbound.c \
14 lib/agg_table.c \
15 lib/atomlist.c \
16 lib/asn.c \
17 lib/base64.c \
18 lib/bfd.c \
19 lib/buffer.c \
20 lib/checksum.c \
21 lib/command.c \
22 lib/command_graph.c \
23 lib/command_lex.l \
24 lib/command_match.c \
25 lib/command_parse.y \
26 lib/cspf.c \
27 lib/csv.c \
28 lib/debug.c \
29 lib/defaults.c \
30 lib/distribute.c \
31 lib/explicit_bzero.c \
32 lib/ferr.c \
33 lib/filter.c \
34 lib/filter_cli.c \
35 lib/filter_nb.c \
36 lib/flex_algo.c \
37 lib/frrcu.c \
38 lib/frrlua.c \
39 lib/frrscript.c \
40 lib/frr_pthread.c \
41 lib/frrstr.c \
42 lib/grammar_sandbox.c \
43 lib/graph.c \
44 lib/hash.c \
45 lib/hook.c \
46 lib/id_alloc.c \
47 lib/if.c \
48 lib/if_rmap.c \
49 lib/imsg-buffer.c \
50 lib/imsg.c \
51 lib/iso.c \
52 lib/jhash.c \
53 lib/json.c \
54 lib/keychain.c \
55 lib/ldp_sync.c \
56 lib/lib_errors.c \
57 lib/lib_vty.c \
58 lib/libfrr.c \
59 lib/libfrr_trace.c \
60 lib/linklist.c \
61 lib/link_state.c \
62 lib/log.c \
63 lib/log_filter.c \
64 lib/log_vty.c \
65 lib/md5.c \
66 lib/memory.c \
67 lib/mgmt_be_client.c \
68 lib/mgmt_fe_client.c \
69 lib/mgmt_msg.c \
70 lib/mlag.c \
71 lib/module.c \
72 lib/mpls.c \
73 lib/srv6.c \
74 lib/network.c \
75 lib/nexthop.c \
76 lib/netns_linux.c \
77 lib/netns_other.c \
78 lib/nexthop_group.c \
79 lib/northbound.c \
80 lib/northbound_cli.c \
81 lib/northbound_db.c \
82 lib/ntop.c \
83 lib/openbsd-tree.c \
84 lib/pid_output.c \
85 lib/plist.c \
86 lib/prefix.c \
87 lib/privs.c \
88 lib/ptm_lib.c \
89 lib/pullwr.c \
90 lib/qobj.c \
91 lib/ringbuf.c \
92 lib/routemap.c \
93 lib/routemap_cli.c \
94 lib/routemap_northbound.c \
95 lib/sbuf.c \
96 lib/seqlock.c \
97 lib/sha256.c \
98 lib/sigevent.c \
99 lib/skiplist.c \
100 lib/sockopt.c \
101 lib/sockunion.c \
102 lib/spf_backoff.c \
103 lib/segment_routing.c \
104 lib/srcdest_table.c \
105 lib/stream.c \
106 lib/strformat.c \
107 lib/strlcat.c \
108 lib/strlcpy.c \
109 lib/systemd.c \
110 lib/table.c \
111 lib/termtable.c \
112 lib/event.c \
113 lib/typerb.c \
114 lib/typesafe.c \
115 lib/vector.c \
116 lib/vrf.c \
117 lib/vty.c \
118 lib/wheel.c \
119 lib/workqueue.c \
120 lib/xref.c \
121 lib/yang.c \
122 lib/yang_translator.c \
123 lib/yang_wrappers.c \
124 lib/zclient.c \
125 lib/zlog.c \
126 lib/zlog_5424.c \
127 lib/zlog_5424_cli.c \
128 lib/zlog_live.c \
129 lib/zlog_targets.c \
130 lib/printf/printf-pos.c \
131 lib/printf/vfprintf.c \
132 lib/printf/glue.c \
133 lib/routing_nb.c \
134 lib/routing_nb_config.c \
135 lib/tc.c \
136 # end
137
138 nodist_lib_libfrr_la_SOURCES = \
139 yang/frr-affinity-map.yang.c \
140 yang/frr-filter.yang.c \
141 yang/frr-if-rmap.yang.c \
142 yang/frr-interface.yang.c \
143 yang/frr-route-map.yang.c \
144 yang/frr-route-types.yang.c \
145 yang/frr-vrf.yang.c \
146 yang/frr-routing.yang.c \
147 yang/frr-nexthop.yang.c \
148 yang/ietf/ietf-routing-types.yang.c \
149 yang/ietf/ietf-interfaces.yang.c \
150 yang/ietf/ietf-bgp-types.yang.c \
151 yang/frr-module-translator.yang.c \
152 # end
153
154 # Add logic to build mgmt.proto
155 lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
156
157 BUILT_SOURCES += \
158 lib/mgmt.pb-c.c \
159 lib/mgmt.pb-c.h \
160 # end
161
162 CLEANFILES += \
163 lib/mgmt.pb-c.h \
164 lib/mgmt.pb-c.c \
165 # end
166
167 lib_libfrr_la_SOURCES += \
168 lib/mgmt.pb-c.c \
169 #end
170
171 if SQLITE3
172 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
173 lib_libfrr_la_SOURCES += lib/db.c
174 endif
175
176 clippy_scan += \
177 lib/affinitymap_cli.c \
178 lib/if.c \
179 lib/filter_cli.c \
180 lib/if_rmap.c \
181 lib/log_vty.c \
182 lib/nexthop_group.c \
183 lib/northbound_cli.c \
184 lib/plist.c \
185 lib/routemap.c \
186 lib/routemap_cli.c \
187 lib/event.c \
188 lib/vty.c \
189 lib/zlog_5424_cli.c \
190 # end
191
192 pkginclude_HEADERS += \
193 lib/admin_group.h \
194 lib/affinitymap.h \
195 lib/agg_table.h \
196 lib/asn.h \
197 lib/atomlist.h \
198 lib/base64.h \
199 lib/bfd.h \
200 lib/bitfield.h \
201 lib/buffer.h \
202 lib/checksum.h \
203 lib/mlag.h \
204 lib/command.h \
205 lib/command_graph.h \
206 lib/command_match.h \
207 lib/compiler.h \
208 lib/cspf.h \
209 lib/csv.h \
210 lib/db.h \
211 lib/debug.h \
212 lib/defaults.h \
213 lib/distribute.h \
214 lib/ferr.h \
215 lib/filter.h \
216 lib/flex_algo.h \
217 lib/freebsd-queue.h \
218 lib/frrlua.h \
219 lib/frrscript.h \
220 lib/frr_pthread.h \
221 lib/frratomic.h \
222 lib/frrcu.h \
223 lib/frrstr.h \
224 lib/graph.h \
225 lib/hash.h \
226 lib/hook.h \
227 lib/iana_afi.h \
228 lib/id_alloc.h \
229 lib/if.h \
230 lib/if_rmap.h \
231 lib/imsg.h \
232 lib/ipaddr.h \
233 lib/iso.h \
234 lib/jhash.h \
235 lib/json.h \
236 lib/keychain.h \
237 lib/ldp_sync.h \
238 lib/lib_errors.h \
239 lib/lib_vty.h \
240 lib/libfrr.h \
241 lib/libfrr_trace.h \
242 lib/libospf.h \
243 lib/linklist.h \
244 lib/link_state.h \
245 lib/log.h \
246 lib/log_vty.h \
247 lib/md5.h \
248 lib/memory.h \
249 lib/mgmt.pb-c.h \
250 lib/mgmt_be_client.h \
251 lib/mgmt_fe_client.h \
252 lib/mgmt_msg.h \
253 lib/mgmt_pb.h \
254 lib/module.h \
255 lib/monotime.h \
256 lib/mpls.h \
257 lib/srv6.h \
258 lib/network.h \
259 lib/nexthop.h \
260 lib/nexthop_group.h \
261 lib/nexthop_group_private.h \
262 lib/northbound.h \
263 lib/northbound_cli.h \
264 lib/northbound_db.h \
265 lib/ns.h \
266 lib/openbsd-queue.h \
267 lib/openbsd-tree.h \
268 lib/plist.h \
269 lib/prefix.h \
270 lib/printfrr.h \
271 lib/privs.h \
272 lib/ptm_lib.h \
273 lib/pullwr.h \
274 lib/pw.h \
275 lib/qobj.h \
276 lib/queue.h \
277 lib/ringbuf.h \
278 lib/routemap.h \
279 lib/route_opaque.h \
280 lib/sbuf.h \
281 lib/seqlock.h \
282 lib/sha256.h \
283 lib/sigevent.h \
284 lib/skiplist.h \
285 lib/smux.h \
286 lib/sockopt.h \
287 lib/sockunion.h \
288 lib/spf_backoff.h \
289 lib/segment_routing.h \
290 lib/srcdest_table.h \
291 lib/srte.h \
292 lib/stream.h \
293 lib/systemd.h \
294 lib/table.h \
295 lib/termtable.h \
296 lib/frrevent.h \
297 lib/trace.h \
298 lib/typerb.h \
299 lib/typesafe.h \
300 lib/vector.h \
301 lib/vlan.h \
302 lib/vrf.h \
303 lib/vrf_int.h \
304 lib/vty.h \
305 lib/vxlan.h \
306 lib/wheel.h \
307 lib/workqueue.h \
308 lib/xref.h \
309 lib/yang.h \
310 lib/yang_translator.h \
311 lib/yang_wrappers.h \
312 lib/zclient.h \
313 lib/zebra.h \
314 lib/zlog.h \
315 lib/zlog_5424.h \
316 lib/zlog_live.h \
317 lib/zlog_targets.h \
318 lib/pbr.h \
319 lib/tc.h \
320 lib/routing_nb.h \
321 \
322 lib/assert/assert.h \
323 # end
324
325
326 nodist_pkginclude_HEADERS += \
327 lib/route_types.h \
328 lib/version.h \
329 # end
330
331 noinst_HEADERS += \
332 lib/clippy.h \
333 lib/plist_int.h \
334 lib/printf/printfcommon.h \
335 lib/printf/printflocal.h \
336 #end
337
338 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
339 # linking: If we're linking libfrr statically into daemons, we *must* remove
340 # libfrr from modules because modules will always link it in dynamically and
341 # thus 2 copies of libfrr will be loaded... hilarity ensues.
342 #
343 # Not linking libfrr into modules should generally work fine because the
344 # executable refers to libfrr either way and the dynamic linker should make
345 # libfrr available to modules. If some OS platform has a dynamic linker that
346 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
347 # it's not linked into daemons statically.
348
349 #
350 # SNMP support
351 #
352 if SNMP
353 lib_LTLIBRARIES += lib/libfrrsnmp.la
354 endif
355
356 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
357 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
358 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
359 lib_libfrrsnmp_la_SOURCES = \
360 lib/agentx.c \
361 lib/snmp.c \
362 # end
363
364
365 #
366 # c-ares support
367 #
368 if CARES
369 lib_LTLIBRARIES += lib/libfrrcares.la
370 pkginclude_HEADERS += lib/resolver.h
371 endif
372
373 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
374 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
375 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
376 lib_libfrrcares_la_SOURCES = \
377 lib/resolver.c \
378 #end
379
380 #
381 # ZeroMQ support
382 #
383 if ZEROMQ
384 lib_LTLIBRARIES += lib/libfrrzmq.la
385 pkginclude_HEADERS += lib/frr_zmq.h
386 endif
387
388 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
389 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
390 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
391 lib_libfrrzmq_la_SOURCES = \
392 lib/frr_zmq.c \
393 #end
394
395 #
396 # Tail-f's ConfD support
397 #
398 if CONFD
399 module_LTLIBRARIES += lib/confd.la
400 endif
401
402 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
403 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
404 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
405 lib_confd_la_SOURCES = lib/northbound_confd.c
406
407 #
408 # Sysrepo support
409 #
410 if SYSREPO
411 module_LTLIBRARIES += lib/sysrepo.la
412 endif
413
414 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
415 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
416 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
417 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
418
419 #
420 # gRPC northbound plugin
421 #
422 if GRPC
423 module_LTLIBRARIES += lib/grpc.la
424 endif
425
426 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
427 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
428 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
429 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
430
431 #
432 # CLI utilities
433 #
434 noinst_PROGRAMS += \
435 lib/grammar_sandbox \
436 # end
437
438 if BUILD_CLIPPY
439 noinst_PROGRAMS += lib/clippy
440 else
441 if HOSTTOOLS_CLIPPY
442 $(CLIPPY):
443 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
444 endif
445 endif
446
447 lib_grammar_sandbox_SOURCES = \
448 lib/grammar_sandbox_main.c
449 lib_grammar_sandbox_LDADD = \
450 lib/libfrr.la
451
452 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
453 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
454 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
455 # no $(SAN_FLAGS) here
456 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
457 lib_clippy_SOURCES = \
458 lib/jhash.c \
459 lib/clippy.c \
460 lib/command_graph.c \
461 lib/command_lex.l \
462 lib/command_parse.y \
463 lib/command_py.c \
464 lib/defun_lex.l \
465 lib/elf_py.c \
466 lib/graph.c \
467 lib/libfrr_trace.c \
468 lib/memory.c \
469 lib/typesafe.c \
470 lib/vector.c \
471 # end
472
473 # (global) clippy rules for all directories
474
475 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
476 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
477 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
478 am__v_CLIPPY_1 =
479
480 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
481
482 SUFFIXES += _clippy.c
483 .c_clippy.c:
484 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
485
486 # xrelfo, the ELF xref extractor
487
488 AM_V_XRELFO = $(am__v_XRELFO_$(V))
489 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
490 am__v_XRELFO_0 = @echo " XRELFO " $@;
491 am__v_XRELFO_1 =
492
493 XRELFO_FLAGS = -Wlog-format -Wlog-args
494
495 SUFFIXES += .xref
496 %.xref: % $(CLIPPY)
497 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
498
499 # dependencies added in python/makefile.py
500 frr.xref:
501 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
502 all-am: frr.xref
503
504 clean-xref:
505 -rm -rf $(xrefs) frr.xref
506 clean-local: clean-xref
507
508 CLEANFILES += vtysh/vtysh_cmd.c
509 vtysh/vtysh_cmd.c: frr.xref
510 @test -f $@ || rm -f frr.xref || true
511 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
512
513 ## automake's "ylwrap" is a great piece of GNU software... not.
514 .l.c:
515 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
516 .y.c:
517 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
518
519 #
520 # generated sources & extra foo
521 #
522 EXTRA_DIST += \
523 lib/command_lex.h \
524 lib/command_parse.h \
525 lib/gitversion.pl \
526 lib/route_types.pl \
527 lib/route_types.txt \
528 # end
529
530 BUILT_SOURCES += \
531 lib/gitversion.h \
532 lib/route_types.h \
533 # end
534
535 ## force route_types.h
536 $(lib_clippy_OBJECTS): lib/route_types.h
537 $(lib_libfrr_la_OBJECTS): lib/route_types.h
538
539 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
540
541 lib/command_lex.h: lib/command_lex.c
542 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
543 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
544 lib/command_lex.lo: lib/command_parse.h
545 lib/command_parse.lo: lib/command_lex.h
546 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
547 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
548 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
549 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
550
551 DISTCLEANFILES += lib/command_lex.h \
552 lib/command_lex.c \
553 lib/command_parse.h \
554 lib/command_parse.c
555
556 rt_enabled =
557
558 if BABELD
559 rt_enabled += --enabled babeld
560 endif
561 if BFDD
562 rt_enabled += --enabled bfdd
563 endif
564 if BGPD
565 rt_enabled += --enabled bgpd
566 if ENABLE_BGP_VNC
567 rt_enabled += --enabled bgpd-vnc
568 endif
569 endif
570 if EIGRPD
571 rt_enabled += --enabled eigrpd
572 endif
573 if ISISD
574 rt_enabled += --enabled isisd
575 endif
576 if FABRICD
577 rt_enabled += --enabled fabricd
578 endif
579 if LDPD
580 rt_enabled += --enabled ldpd
581 endif
582 if NHRPD
583 rt_enabled += --enabled nhrpd
584 endif
585 if OSPFD
586 rt_enabled += --enabled ospfd
587 endif
588 if OSPF6D
589 rt_enabled += --enabled ospf6d
590 endif
591 if PBRD
592 rt_enabled += --enabled pbrd
593 endif
594 if PIMD
595 rt_enabled += --enabled pimd
596 endif
597 if RIPD
598 rt_enabled += --enabled ripd
599 endif
600 if RIPNGD
601 rt_enabled += --enabled ripngd
602 endif
603 if SHARPD
604 rt_enabled += --enabled sharpd
605 endif
606 if ZEBRA
607 rt_enabled += --enabled zebra
608 endif
609
610 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
611 @$(MKDIR_P) lib
612 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
613 DISTCLEANFILES += lib/route_types.h
614
615 if GIT_VERSION
616 # bit of a trick here to always have up-to-date git stamps without triggering
617 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
618 # but if we use that on gitversion.h it'll ripple through the .c file deps.
619 # (even if gitversion.h's file timestamp doesn't change, make will think it
620 # did, because of .PHONY...)
621
622 PHONY_GITVERSION=lib/gitversion.h.tmp
623 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
624 GITH=lib/gitversion.h
625 lib/gitversion.h.tmp: $(top_srcdir)/.git
626 @$(MKDIR_P) lib
627 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
628 lib/gitversion.h: lib/gitversion.h.tmp
629 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
630
631 else
632 PHONY_GITVERSION=lib/gitversion.h
633 lib/gitversion.h:
634 true
635 endif
636 .PHONY: $(PHONY_GITVERSION)