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)
9 lib_libfrr_la_SOURCES = \
26 lib/explicit_bzero.c \
38 lib/grammar_sandbox.c \
72 lib/northbound_cli.c \
86 lib/routemap_northbound.c \
113 lib/yang_translator.c \
114 lib/yang_wrappers.c \
118 lib/zlog_5424_cli.c \
121 lib/printf/printf-pos.c \
122 lib/printf/vfprintf.c \
125 lib/routing_nb_config.c \
128 nodist_lib_libfrr_la_SOURCES = \
129 yang/frr-filter.yang.c \
130 yang/frr-interface.yang.c \
131 yang/frr-route-map.yang.c \
132 yang/frr-route-types.yang.c \
133 yang/frr-vrf.yang.c \
134 yang/frr-routing.yang.c \
135 yang/frr-nexthop.yang.c \
136 yang/ietf/ietf-routing-types.yang.c \
137 yang/ietf/ietf-interfaces.yang.c \
138 yang/ietf/ietf-bgp-types.yang.c \
139 yang/frr-module-translator.yang.c \
151 lib/nexthop_group.c \
160 # can be loaded as DSO - always include for vtysh
161 vtysh_scan += lib/agentx.c
164 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
165 lib_libfrr_la_SOURCES += lib/db.c
172 lib/nexthop_group.c \
173 lib/northbound_cli.c \
178 lib/zlog_5424_cli.c \
181 pkginclude_HEADERS += \
191 lib/command_graph.h \
192 lib/command_match.h \
202 lib/freebsd-queue.h \
240 lib/nexthop_group.h \
241 lib/nexthop_group_private.h \
243 lib/northbound_cli.h \
244 lib/northbound_db.h \
246 lib/openbsd-queue.h \
269 lib/srcdest_table.h \
289 lib/yang_translator.h \
290 lib/yang_wrappers.h \
300 lib/assert/assert.h \
304 nodist_pkginclude_HEADERS += \
312 lib/printf/printfcommon.h \
313 lib/printf/printflocal.h \
316 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
317 # linking: If we're linking libfrr statically into daemons, we *must* remove
318 # libfrr from modules because modules will always link it in dynamically and
319 # thus 2 copies of libfrr will be loaded... hilarity ensues.
321 # Not linking libfrr into modules should generally work fine because the
322 # executable refers to libfrr either way and the dynamic linker should make
323 # libfrr available to modules. If some OS platform has a dynamic linker that
324 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
325 # it's not linked into daemons statically.
331 lib_LTLIBRARIES += lib/libfrrsnmp.la
334 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
335 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
336 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
337 lib_libfrrsnmp_la_SOURCES = \
347 lib_LTLIBRARIES += lib/libfrrcares.la
348 pkginclude_HEADERS += lib/resolver.h
349 vtysh_scan += lib/resolver.c
352 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
353 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
354 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
355 lib_libfrrcares_la_SOURCES = \
363 lib_LTLIBRARIES += lib/libfrrzmq.la
364 pkginclude_HEADERS += lib/frr_zmq.h
367 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
368 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
369 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
370 lib_libfrrzmq_la_SOURCES = \
375 # Tail-f's ConfD support
378 module_LTLIBRARIES += lib/confd.la
381 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
382 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
383 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
384 lib_confd_la_SOURCES = lib/northbound_confd.c
390 module_LTLIBRARIES += lib/sysrepo.la
393 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
394 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
395 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
396 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
399 # gRPC northbound plugin
402 module_LTLIBRARIES += lib/grpc.la
405 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
406 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
407 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
408 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
414 lib/grammar_sandbox \
418 noinst_PROGRAMS += lib/clippy
422 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
426 lib_grammar_sandbox_SOURCES = \
427 lib/grammar_sandbox_main.c
428 lib_grammar_sandbox_LDADD = \
431 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
432 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
433 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
434 # no $(SAN_FLAGS) here
435 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
436 lib_clippy_SOURCES = \
439 lib/command_graph.c \
441 lib/command_parse.y \
452 # (global) clippy rules for all directories
454 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
455 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
456 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
459 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
461 SUFFIXES += _clippy.c
463 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
465 # xrelfo, the ELF xref extractor
467 AM_V_XRELFO = $(am__v_XRELFO_$(V))
468 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
469 am__v_XRELFO_0 = @echo " XRELFO " $@;
472 XRELFO_FLAGS = -Wlog-format -Wlog-args
476 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
478 # dependencies added in python/makefile.py
480 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^
484 -rm -rf $(xrefs) frr.xref
485 clean-local: clean-xref
487 ## automake's "ylwrap" is a great piece of GNU software... not.
489 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
491 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
494 # generated sources & extra foo
498 lib/command_parse.h \
501 lib/route_types.txt \
509 ## force route_types.h
510 $(lib_clippy_OBJECTS): lib/route_types.h
511 $(lib_libfrr_la_OBJECTS): lib/route_types.h
513 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
515 lib/command_lex.h: lib/command_lex.c
516 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
517 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
518 lib/command_lex.lo: lib/command_parse.h
519 lib/command_parse.lo: lib/command_lex.h
520 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
521 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
522 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
523 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
525 DISTCLEANFILES += lib/command_lex.h \
527 lib/command_parse.h \
533 rt_enabled += --enabled babeld
536 rt_enabled += --enabled bfdd
539 rt_enabled += --enabled bgpd
541 rt_enabled += --enabled bgpd-vnc
545 rt_enabled += --enabled eigrpd
548 rt_enabled += --enabled isisd
551 rt_enabled += --enabled fabricd
554 rt_enabled += --enabled ldpd
557 rt_enabled += --enabled nhrpd
560 rt_enabled += --enabled ospfd
563 rt_enabled += --enabled ospf6d
566 rt_enabled += --enabled pbrd
569 rt_enabled += --enabled pimd
572 rt_enabled += --enabled ripd
575 rt_enabled += --enabled ripngd
578 rt_enabled += --enabled sharpd
581 rt_enabled += --enabled zebra
584 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
585 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
586 DISTCLEANFILES += lib/route_types.h
589 # bit of a trick here to always have up-to-date git stamps without triggering
590 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
591 # but if we use that on gitversion.h it'll ripple through the .c file deps.
592 # (even if gitversion.h's file timestamp doesn't change, make will think it
593 # did, because of .PHONY...)
595 PHONY_GITVERSION=lib/gitversion.h.tmp
596 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
597 GITH=lib/gitversion.h
598 lib/gitversion.h.tmp: $(top_srcdir)/.git
599 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
600 lib/gitversion.h: lib/gitversion.h.tmp
601 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
604 PHONY_GITVERSION=lib/gitversion.h
608 .PHONY: $(PHONY_GITVERSION)