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 = \
12 lib/affinitymap_cli.c \
13 lib/affinitymap_northbound.c \
31 lib/explicit_bzero.c \
41 lib/grammar_sandbox.c \
66 lib/mgmt_be_client.c \
67 lib/mgmt_fe_client.c \
79 lib/northbound_cli.c \
93 lib/routemap_northbound.c \
102 lib/srcdest_table.c \
120 lib/yang_translator.c \
121 lib/yang_wrappers.c \
125 lib/zlog_5424_cli.c \
128 lib/printf/printf-pos.c \
129 lib/printf/vfprintf.c \
132 lib/routing_nb_config.c \
136 nodist_lib_libfrr_la_SOURCES = \
137 yang/frr-affinity-map.yang.c \
138 yang/frr-filter.yang.c \
139 yang/frr-interface.yang.c \
140 yang/frr-route-map.yang.c \
141 yang/frr-route-types.yang.c \
142 yang/frr-vrf.yang.c \
143 yang/frr-routing.yang.c \
144 yang/frr-nexthop.yang.c \
145 yang/ietf/ietf-routing-types.yang.c \
146 yang/ietf/ietf-interfaces.yang.c \
147 yang/ietf/ietf-bgp-types.yang.c \
148 yang/frr-module-translator.yang.c \
151 # Add logic to build mgmt.proto
152 lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
164 lib_libfrr_la_SOURCES += \
169 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
170 lib_libfrr_la_SOURCES += lib/db.c
174 lib/affinitymap_cli.c \
179 lib/nexthop_group.c \
180 lib/northbound_cli.c \
186 lib/zlog_5424_cli.c \
189 pkginclude_HEADERS += \
202 lib/command_graph.h \
203 lib/command_match.h \
213 lib/freebsd-queue.h \
246 lib/mgmt_be_client.h \
247 lib/mgmt_fe_client.h \
256 lib/nexthop_group.h \
257 lib/nexthop_group_private.h \
259 lib/northbound_cli.h \
260 lib/northbound_db.h \
262 lib/openbsd-queue.h \
285 lib/srcdest_table.h \
305 lib/yang_translator.h \
306 lib/yang_wrappers.h \
317 lib/assert/assert.h \
321 nodist_pkginclude_HEADERS += \
329 lib/printf/printfcommon.h \
330 lib/printf/printflocal.h \
333 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
334 # linking: If we're linking libfrr statically into daemons, we *must* remove
335 # libfrr from modules because modules will always link it in dynamically and
336 # thus 2 copies of libfrr will be loaded... hilarity ensues.
338 # Not linking libfrr into modules should generally work fine because the
339 # executable refers to libfrr either way and the dynamic linker should make
340 # libfrr available to modules. If some OS platform has a dynamic linker that
341 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
342 # it's not linked into daemons statically.
348 lib_LTLIBRARIES += lib/libfrrsnmp.la
351 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
352 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
353 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
354 lib_libfrrsnmp_la_SOURCES = \
364 lib_LTLIBRARIES += lib/libfrrcares.la
365 pkginclude_HEADERS += lib/resolver.h
368 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
369 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
370 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
371 lib_libfrrcares_la_SOURCES = \
379 lib_LTLIBRARIES += lib/libfrrzmq.la
380 pkginclude_HEADERS += lib/frr_zmq.h
383 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
384 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
385 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
386 lib_libfrrzmq_la_SOURCES = \
391 # Tail-f's ConfD support
394 module_LTLIBRARIES += lib/confd.la
397 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
398 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
399 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
400 lib_confd_la_SOURCES = lib/northbound_confd.c
406 module_LTLIBRARIES += lib/sysrepo.la
409 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
410 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
411 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
412 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
415 # gRPC northbound plugin
418 module_LTLIBRARIES += lib/grpc.la
421 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
422 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
423 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
424 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
430 lib/grammar_sandbox \
434 noinst_PROGRAMS += lib/clippy
438 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
442 lib_grammar_sandbox_SOURCES = \
443 lib/grammar_sandbox_main.c
444 lib_grammar_sandbox_LDADD = \
447 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
448 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
449 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
450 # no $(SAN_FLAGS) here
451 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
452 lib_clippy_SOURCES = \
455 lib/command_graph.c \
457 lib/command_parse.y \
468 # (global) clippy rules for all directories
470 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
471 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
472 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
475 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
477 SUFFIXES += _clippy.c
479 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
481 # xrelfo, the ELF xref extractor
483 AM_V_XRELFO = $(am__v_XRELFO_$(V))
484 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
485 am__v_XRELFO_0 = @echo " XRELFO " $@;
488 XRELFO_FLAGS = -Wlog-format -Wlog-args
492 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
494 # dependencies added in python/makefile.py
496 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
500 -rm -rf $(xrefs) frr.xref
501 clean-local: clean-xref
503 CLEANFILES += vtysh/vtysh_cmd.c
504 vtysh/vtysh_cmd.c: frr.xref
505 @test -f $@ || rm -f frr.xref || true
506 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
508 ## automake's "ylwrap" is a great piece of GNU software... not.
510 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
512 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
515 # generated sources & extra foo
519 lib/command_parse.h \
522 lib/route_types.txt \
530 ## force route_types.h
531 $(lib_clippy_OBJECTS): lib/route_types.h
532 $(lib_libfrr_la_OBJECTS): lib/route_types.h
534 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
536 lib/command_lex.h: lib/command_lex.c
537 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
538 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
539 lib/command_lex.lo: lib/command_parse.h
540 lib/command_parse.lo: lib/command_lex.h
541 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
542 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
543 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
544 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
546 DISTCLEANFILES += lib/command_lex.h \
548 lib/command_parse.h \
554 rt_enabled += --enabled babeld
557 rt_enabled += --enabled bfdd
560 rt_enabled += --enabled bgpd
562 rt_enabled += --enabled bgpd-vnc
566 rt_enabled += --enabled eigrpd
569 rt_enabled += --enabled isisd
572 rt_enabled += --enabled fabricd
575 rt_enabled += --enabled ldpd
578 rt_enabled += --enabled nhrpd
581 rt_enabled += --enabled ospfd
584 rt_enabled += --enabled ospf6d
587 rt_enabled += --enabled pbrd
590 rt_enabled += --enabled pimd
593 rt_enabled += --enabled ripd
596 rt_enabled += --enabled ripngd
599 rt_enabled += --enabled sharpd
602 rt_enabled += --enabled zebra
605 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
607 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
608 DISTCLEANFILES += lib/route_types.h
611 # bit of a trick here to always have up-to-date git stamps without triggering
612 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
613 # but if we use that on gitversion.h it'll ripple through the .c file deps.
614 # (even if gitversion.h's file timestamp doesn't change, make will think it
615 # did, because of .PHONY...)
617 PHONY_GITVERSION=lib/gitversion.h.tmp
618 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
619 GITH=lib/gitversion.h
620 lib/gitversion.h.tmp: $(top_srcdir)/.git
622 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
623 lib/gitversion.h: lib/gitversion.h.tmp
624 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
627 PHONY_GITVERSION=lib/gitversion.h
631 .PHONY: $(PHONY_GITVERSION)