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 \
42 lib/grammar_sandbox.c \
67 lib/mgmt_be_client.c \
68 lib/mgmt_fe_client.c \
80 lib/northbound_cli.c \
94 lib/routemap_northbound.c \
103 lib/segment_routing.c \
104 lib/srcdest_table.c \
122 lib/yang_translator.c \
123 lib/yang_wrappers.c \
127 lib/zlog_5424_cli.c \
130 lib/printf/printf-pos.c \
131 lib/printf/vfprintf.c \
134 lib/routing_nb_config.c \
138 nodist_lib_libfrr_la_SOURCES = \
139 yang/frr-affinity-map.yang.c \
140 yang/frr-filter.yang.c \
141 yang/frr-interface.yang.c \
142 yang/frr-route-map.yang.c \
143 yang/frr-route-types.yang.c \
144 yang/frr-vrf.yang.c \
145 yang/frr-routing.yang.c \
146 yang/frr-nexthop.yang.c \
147 yang/ietf/ietf-routing-types.yang.c \
148 yang/ietf/ietf-interfaces.yang.c \
149 yang/ietf/ietf-bgp-types.yang.c \
150 yang/frr-module-translator.yang.c \
153 # Add logic to build mgmt.proto
154 lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
166 lib_libfrr_la_SOURCES += \
171 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
172 lib_libfrr_la_SOURCES += lib/db.c
176 lib/affinitymap_cli.c \
181 lib/nexthop_group.c \
182 lib/northbound_cli.c \
188 lib/zlog_5424_cli.c \
191 pkginclude_HEADERS += \
204 lib/command_graph.h \
205 lib/command_match.h \
216 lib/freebsd-queue.h \
249 lib/mgmt_be_client.h \
250 lib/mgmt_fe_client.h \
259 lib/nexthop_group.h \
260 lib/nexthop_group_private.h \
262 lib/northbound_cli.h \
263 lib/northbound_db.h \
265 lib/openbsd-queue.h \
288 lib/segment_routing.h \
289 lib/srcdest_table.h \
309 lib/yang_translator.h \
310 lib/yang_wrappers.h \
321 lib/assert/assert.h \
325 nodist_pkginclude_HEADERS += \
333 lib/printf/printfcommon.h \
334 lib/printf/printflocal.h \
337 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
338 # linking: If we're linking libfrr statically into daemons, we *must* remove
339 # libfrr from modules because modules will always link it in dynamically and
340 # thus 2 copies of libfrr will be loaded... hilarity ensues.
342 # Not linking libfrr into modules should generally work fine because the
343 # executable refers to libfrr either way and the dynamic linker should make
344 # libfrr available to modules. If some OS platform has a dynamic linker that
345 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
346 # it's not linked into daemons statically.
352 lib_LTLIBRARIES += lib/libfrrsnmp.la
355 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
356 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
357 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
358 lib_libfrrsnmp_la_SOURCES = \
368 lib_LTLIBRARIES += lib/libfrrcares.la
369 pkginclude_HEADERS += lib/resolver.h
372 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
373 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
374 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
375 lib_libfrrcares_la_SOURCES = \
383 lib_LTLIBRARIES += lib/libfrrzmq.la
384 pkginclude_HEADERS += lib/frr_zmq.h
387 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
388 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
389 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
390 lib_libfrrzmq_la_SOURCES = \
395 # Tail-f's ConfD support
398 module_LTLIBRARIES += lib/confd.la
401 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
402 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
403 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
404 lib_confd_la_SOURCES = lib/northbound_confd.c
410 module_LTLIBRARIES += lib/sysrepo.la
413 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
414 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
415 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
416 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
419 # gRPC northbound plugin
422 module_LTLIBRARIES += lib/grpc.la
425 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
426 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
427 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
428 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
434 lib/grammar_sandbox \
438 noinst_PROGRAMS += lib/clippy
442 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
446 lib_grammar_sandbox_SOURCES = \
447 lib/grammar_sandbox_main.c
448 lib_grammar_sandbox_LDADD = \
451 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
452 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
453 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
454 # no $(SAN_FLAGS) here
455 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
456 lib_clippy_SOURCES = \
459 lib/command_graph.c \
461 lib/command_parse.y \
472 # (global) clippy rules for all directories
474 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
475 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
476 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
479 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
481 SUFFIXES += _clippy.c
483 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
485 # xrelfo, the ELF xref extractor
487 AM_V_XRELFO = $(am__v_XRELFO_$(V))
488 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
489 am__v_XRELFO_0 = @echo " XRELFO " $@;
492 XRELFO_FLAGS = -Wlog-format -Wlog-args
496 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
498 # dependencies added in python/makefile.py
500 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
504 -rm -rf $(xrefs) frr.xref
505 clean-local: clean-xref
507 CLEANFILES += vtysh/vtysh_cmd.c
508 vtysh/vtysh_cmd.c: frr.xref
509 @test -f $@ || rm -f frr.xref || true
510 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
512 ## automake's "ylwrap" is a great piece of GNU software... not.
514 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
516 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
519 # generated sources & extra foo
523 lib/command_parse.h \
526 lib/route_types.txt \
534 ## force route_types.h
535 $(lib_clippy_OBJECTS): lib/route_types.h
536 $(lib_libfrr_la_OBJECTS): lib/route_types.h
538 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
540 lib/command_lex.h: lib/command_lex.c
541 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
542 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
543 lib/command_lex.lo: lib/command_parse.h
544 lib/command_parse.lo: lib/command_lex.h
545 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
546 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
547 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
548 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
550 DISTCLEANFILES += lib/command_lex.h \
552 lib/command_parse.h \
558 rt_enabled += --enabled babeld
561 rt_enabled += --enabled bfdd
564 rt_enabled += --enabled bgpd
566 rt_enabled += --enabled bgpd-vnc
570 rt_enabled += --enabled eigrpd
573 rt_enabled += --enabled isisd
576 rt_enabled += --enabled fabricd
579 rt_enabled += --enabled ldpd
582 rt_enabled += --enabled nhrpd
585 rt_enabled += --enabled ospfd
588 rt_enabled += --enabled ospf6d
591 rt_enabled += --enabled pbrd
594 rt_enabled += --enabled pimd
597 rt_enabled += --enabled ripd
600 rt_enabled += --enabled ripngd
603 rt_enabled += --enabled sharpd
606 rt_enabled += --enabled zebra
609 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
611 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
612 DISTCLEANFILES += lib/route_types.h
615 # bit of a trick here to always have up-to-date git stamps without triggering
616 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
617 # but if we use that on gitversion.h it'll ripple through the .c file deps.
618 # (even if gitversion.h's file timestamp doesn't change, make will think it
619 # did, because of .PHONY...)
621 PHONY_GITVERSION=lib/gitversion.h.tmp
622 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
623 GITH=lib/gitversion.h
624 lib/gitversion.h.tmp: $(top_srcdir)/.git
626 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
627 lib/gitversion.h: lib/gitversion.h.tmp
628 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
631 PHONY_GITVERSION=lib/gitversion.h
635 .PHONY: $(PHONY_GITVERSION)