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 \
65 lib/mgmt_be_client.c \
66 lib/mgmt_fe_client.c \
78 lib/northbound_cli.c \
92 lib/routemap_northbound.c \
101 lib/srcdest_table.c \
119 lib/yang_translator.c \
120 lib/yang_wrappers.c \
124 lib/zlog_5424_cli.c \
127 lib/printf/printf-pos.c \
128 lib/printf/vfprintf.c \
131 lib/routing_nb_config.c \
135 nodist_lib_libfrr_la_SOURCES = \
136 yang/frr-affinity-map.yang.c \
137 yang/frr-filter.yang.c \
138 yang/frr-interface.yang.c \
139 yang/frr-route-map.yang.c \
140 yang/frr-route-types.yang.c \
141 yang/frr-vrf.yang.c \
142 yang/frr-routing.yang.c \
143 yang/frr-nexthop.yang.c \
144 yang/ietf/ietf-routing-types.yang.c \
145 yang/ietf/ietf-interfaces.yang.c \
146 yang/ietf/ietf-bgp-types.yang.c \
147 yang/frr-module-translator.yang.c \
150 # Add logic to build mgmt.proto
151 lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
163 lib_libfrr_la_SOURCES += \
168 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
169 lib_libfrr_la_SOURCES += lib/db.c
173 lib/affinitymap_cli.c \
177 lib/nexthop_group.c \
178 lib/northbound_cli.c \
184 lib/zlog_5424_cli.c \
187 pkginclude_HEADERS += \
200 lib/command_graph.h \
201 lib/command_match.h \
211 lib/freebsd-queue.h \
243 lib/mgmt_be_client.h \
244 lib/mgmt_fe_client.h \
253 lib/nexthop_group.h \
254 lib/nexthop_group_private.h \
256 lib/northbound_cli.h \
257 lib/northbound_db.h \
259 lib/openbsd-queue.h \
282 lib/srcdest_table.h \
302 lib/yang_translator.h \
303 lib/yang_wrappers.h \
314 lib/assert/assert.h \
318 nodist_pkginclude_HEADERS += \
326 lib/printf/printfcommon.h \
327 lib/printf/printflocal.h \
330 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
331 # linking: If we're linking libfrr statically into daemons, we *must* remove
332 # libfrr from modules because modules will always link it in dynamically and
333 # thus 2 copies of libfrr will be loaded... hilarity ensues.
335 # Not linking libfrr into modules should generally work fine because the
336 # executable refers to libfrr either way and the dynamic linker should make
337 # libfrr available to modules. If some OS platform has a dynamic linker that
338 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
339 # it's not linked into daemons statically.
345 lib_LTLIBRARIES += lib/libfrrsnmp.la
348 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
349 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
350 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
351 lib_libfrrsnmp_la_SOURCES = \
361 lib_LTLIBRARIES += lib/libfrrcares.la
362 pkginclude_HEADERS += lib/resolver.h
365 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
366 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
367 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
368 lib_libfrrcares_la_SOURCES = \
376 lib_LTLIBRARIES += lib/libfrrzmq.la
377 pkginclude_HEADERS += lib/frr_zmq.h
380 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
381 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
382 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
383 lib_libfrrzmq_la_SOURCES = \
388 # Tail-f's ConfD support
391 module_LTLIBRARIES += lib/confd.la
394 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
395 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
396 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
397 lib_confd_la_SOURCES = lib/northbound_confd.c
403 module_LTLIBRARIES += lib/sysrepo.la
406 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
407 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
408 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
409 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
412 # gRPC northbound plugin
415 module_LTLIBRARIES += lib/grpc.la
418 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
419 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
420 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
421 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
427 lib/grammar_sandbox \
431 noinst_PROGRAMS += lib/clippy
435 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
439 lib_grammar_sandbox_SOURCES = \
440 lib/grammar_sandbox_main.c
441 lib_grammar_sandbox_LDADD = \
444 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
445 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
446 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
447 # no $(SAN_FLAGS) here
448 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
449 lib_clippy_SOURCES = \
452 lib/command_graph.c \
454 lib/command_parse.y \
465 # (global) clippy rules for all directories
467 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
468 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
469 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
472 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
474 SUFFIXES += _clippy.c
476 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
478 # xrelfo, the ELF xref extractor
480 AM_V_XRELFO = $(am__v_XRELFO_$(V))
481 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
482 am__v_XRELFO_0 = @echo " XRELFO " $@;
485 XRELFO_FLAGS = -Wlog-format -Wlog-args
489 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
491 # dependencies added in python/makefile.py
493 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
497 -rm -rf $(xrefs) frr.xref
498 clean-local: clean-xref
500 CLEANFILES += vtysh/vtysh_cmd.c
501 vtysh/vtysh_cmd.c: frr.xref
502 @test -f $@ || rm -f frr.xref || true
503 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
505 ## automake's "ylwrap" is a great piece of GNU software... not.
507 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
509 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
512 # generated sources & extra foo
516 lib/command_parse.h \
519 lib/route_types.txt \
527 ## force route_types.h
528 $(lib_clippy_OBJECTS): lib/route_types.h
529 $(lib_libfrr_la_OBJECTS): lib/route_types.h
531 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
533 lib/command_lex.h: lib/command_lex.c
534 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
535 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
536 lib/command_lex.lo: lib/command_parse.h
537 lib/command_parse.lo: lib/command_lex.h
538 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
539 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
540 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
541 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
543 DISTCLEANFILES += lib/command_lex.h \
545 lib/command_parse.h \
551 rt_enabled += --enabled babeld
554 rt_enabled += --enabled bfdd
557 rt_enabled += --enabled bgpd
559 rt_enabled += --enabled bgpd-vnc
563 rt_enabled += --enabled eigrpd
566 rt_enabled += --enabled isisd
569 rt_enabled += --enabled fabricd
572 rt_enabled += --enabled ldpd
575 rt_enabled += --enabled nhrpd
578 rt_enabled += --enabled ospfd
581 rt_enabled += --enabled ospf6d
584 rt_enabled += --enabled pbrd
587 rt_enabled += --enabled pimd
590 rt_enabled += --enabled ripd
593 rt_enabled += --enabled ripngd
596 rt_enabled += --enabled sharpd
599 rt_enabled += --enabled zebra
602 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
604 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
605 DISTCLEANFILES += lib/route_types.h
608 # bit of a trick here to always have up-to-date git stamps without triggering
609 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
610 # but if we use that on gitversion.h it'll ripple through the .c file deps.
611 # (even if gitversion.h's file timestamp doesn't change, make will think it
612 # did, because of .PHONY...)
614 PHONY_GITVERSION=lib/gitversion.h.tmp
615 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
616 GITH=lib/gitversion.h
617 lib/gitversion.h.tmp: $(top_srcdir)/.git
619 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
620 lib/gitversion.h: lib/gitversion.h.tmp
621 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
624 PHONY_GITVERSION=lib/gitversion.h
628 .PHONY: $(PHONY_GITVERSION)