4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
6 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBM)
8 lib_libfrr_la_SOURCES = \
34 lib/grammar_sandbox.c \
68 lib/northbound_cli.c \
82 lib/routemap_northbound.c \
109 lib/yang_translator.c \
110 lib/yang_wrappers.c \
114 lib/printf/printf-pos.c \
115 lib/printf/vfprintf.c \
118 lib/routing_nb_config.c \
121 nodist_lib_libfrr_la_SOURCES = \
122 yang/frr-filter.yang.c \
123 yang/frr-interface.yang.c \
124 yang/frr-route-map.yang.c \
125 yang/frr-route-types.yang.c \
126 yang/frr-vrf.yang.c \
127 yang/frr-routing.yang.c \
128 yang/frr-nexthop.yang.c \
129 yang/ietf/ietf-routing-types.yang.c \
130 yang/ietf/ietf-interfaces.yang.c \
131 yang/ietf/ietf-bgp-types.yang.c \
132 yang/frr-module-translator.yang.c \
133 yang/frr-nexthop.yang.c \
145 lib/nexthop_group.c \
155 # can be loaded as DSO - always include for vtysh
156 vtysh_scan += lib/agentx.c
159 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
160 lib_libfrr_la_SOURCES += lib/db.c
167 lib/nexthop_group.c \
168 lib/northbound_cli.c \
174 pkginclude_HEADERS += \
183 lib/command_graph.h \
184 lib/command_match.h \
193 lib/freebsd-queue.h \
231 lib/nexthop_group.h \
232 lib/nexthop_group_private.h \
234 lib/northbound_cli.h \
235 lib/northbound_db.h \
237 lib/openbsd-queue.h \
260 lib/srcdest_table.h \
280 lib/yang_translator.h \
281 lib/yang_wrappers.h \
289 lib/assert/assert.h \
293 nodist_pkginclude_HEADERS += \
301 lib/printf/printfcommon.h \
302 lib/printf/printflocal.h \
305 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
306 # linking: If we're linking libfrr statically into daemons, we *must* remove
307 # libfrr from modules because modules will always link it in dynamically and
308 # thus 2 copies of libfrr will be loaded... hilarity ensues.
310 # Not linking libfrr into modules should generally work fine because the
311 # executable refers to libfrr either way and the dynamic linker should make
312 # libfrr available to modules. If some OS platform has a dynamic linker that
313 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
314 # it's not linked into daemons statically.
320 lib_LTLIBRARIES += lib/libfrrsnmp.la
323 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
324 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
325 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
326 lib_libfrrsnmp_la_SOURCES = \
335 lib_LTLIBRARIES += lib/libfrrcares.la
336 pkginclude_HEADERS += lib/resolver.h
339 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
340 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
341 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
342 lib_libfrrcares_la_SOURCES = \
350 lib_LTLIBRARIES += lib/libfrrzmq.la
351 pkginclude_HEADERS += lib/frr_zmq.h
354 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
355 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
356 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
357 lib_libfrrzmq_la_SOURCES = \
362 # Tail-f's ConfD support
365 module_LTLIBRARIES += lib/confd.la
368 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
369 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
370 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
371 lib_confd_la_SOURCES = lib/northbound_confd.c
377 module_LTLIBRARIES += lib/sysrepo.la
380 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
381 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
382 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
383 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
386 # gRPC northbound plugin
389 module_LTLIBRARIES += lib/grpc.la
392 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
393 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
394 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
395 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
401 lib/grammar_sandbox \
405 noinst_PROGRAMS += lib/clippy
409 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
413 lib_grammar_sandbox_SOURCES = \
414 lib/grammar_sandbox_main.c
415 lib_grammar_sandbox_LDADD = \
418 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
419 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
420 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
421 lib_clippy_LDFLAGS = -export-dynamic
422 lib_clippy_SOURCES = \
425 lib/command_graph.c \
427 lib/command_parse.y \
438 # (global) clippy rules for all directories
440 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
441 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
442 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
445 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
447 SUFFIXES += _clippy.c
449 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
451 # xrelfo, the ELF xref extractor
453 AM_V_XRELFO = $(am__v_XRELFO_$(V))
454 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
455 am__v_XRELFO_0 = @echo " XRELFO " $@;
459 XRELFO_FLAGS = -Wlog-format -Wlog-args
466 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(XRELFO_FLAGS) -o $@ $<
468 # dependencies added in python/makefile.py
470 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^
474 -rm -rf $(xrefs) frr.xref
475 clean-local: clean-xref
477 ## automake's "ylwrap" is a great piece of GNU software... not.
479 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
481 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
484 # generated sources & extra foo
488 lib/command_parse.h \
491 lib/route_types.txt \
499 ## force route_types.h
500 $(lib_clippy_OBJECTS): lib/route_types.h
501 $(lib_libfrr_la_OBJECTS): lib/route_types.h
503 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
505 lib/command_lex.h: lib/command_lex.c
506 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
507 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
508 lib/command_lex.lo: lib/command_parse.h
509 lib/command_parse.lo: lib/command_lex.h
510 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
511 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
512 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
513 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
518 rt_enabled += --enabled babeld
521 rt_enabled += --enabled bfdd
524 rt_enabled += --enabled bgpd
526 rt_enabled += --enabled bgpd-vnc
530 rt_enabled += --enabled eigrpd
533 rt_enabled += --enabled isisd
536 rt_enabled += --enabled fabricd
539 rt_enabled += --enabled ldpd
542 rt_enabled += --enabled nhrpd
545 rt_enabled += --enabled ospfd
548 rt_enabled += --enabled ospf6d
551 rt_enabled += --enabled pbrd
554 rt_enabled += --enabled pimd
557 rt_enabled += --enabled ripd
560 rt_enabled += --enabled ripngd
563 rt_enabled += --enabled sharpd
566 rt_enabled += --enabled zebra
569 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
570 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
571 DISTCLEANFILES += lib/route_types.h
574 # bit of a trick here to always have up-to-date git stamps without triggering
575 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
576 # but if we use that on gitversion.h it'll ripple through the .c file deps.
577 # (even if gitversion.h's file timestamp doesn't change, make will think it
578 # did, because of .PHONY...)
580 PHONY_GITVERSION=lib/gitversion.h.tmp
581 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
582 GITH=lib/gitversion.h
583 lib/gitversion.h.tmp: $(top_srcdir)/.git
584 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
585 lib/gitversion.h: lib/gitversion.h.tmp
586 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
589 PHONY_GITVERSION=lib/gitversion.h
593 .PHONY: $(PHONY_GITVERSION)