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-if-rmap.yang.c \
142 yang/frr-interface.yang.c \
143 yang/frr-route-map.yang.c \
144 yang/frr-route-types.yang.c \
145 yang/frr-vrf.yang.c \
146 yang/frr-routing.yang.c \
147 yang/frr-nexthop.yang.c \
148 yang/ietf/ietf-routing-types.yang.c \
149 yang/ietf/ietf-interfaces.yang.c \
150 yang/ietf/ietf-bgp-types.yang.c \
151 yang/frr-module-translator.yang.c \
154 # Add logic to build mgmt.proto
155 lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
167 lib_libfrr_la_SOURCES += \
172 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
173 lib_libfrr_la_SOURCES += lib/db.c
177 lib/affinitymap_cli.c \
182 lib/nexthop_group.c \
183 lib/northbound_cli.c \
189 lib/zlog_5424_cli.c \
192 pkginclude_HEADERS += \
205 lib/command_graph.h \
206 lib/command_match.h \
217 lib/freebsd-queue.h \
250 lib/mgmt_be_client.h \
251 lib/mgmt_fe_client.h \
260 lib/nexthop_group.h \
261 lib/nexthop_group_private.h \
263 lib/northbound_cli.h \
264 lib/northbound_db.h \
266 lib/openbsd-queue.h \
289 lib/segment_routing.h \
290 lib/srcdest_table.h \
310 lib/yang_translator.h \
311 lib/yang_wrappers.h \
322 lib/assert/assert.h \
326 nodist_pkginclude_HEADERS += \
334 lib/printf/printfcommon.h \
335 lib/printf/printflocal.h \
338 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
339 # linking: If we're linking libfrr statically into daemons, we *must* remove
340 # libfrr from modules because modules will always link it in dynamically and
341 # thus 2 copies of libfrr will be loaded... hilarity ensues.
343 # Not linking libfrr into modules should generally work fine because the
344 # executable refers to libfrr either way and the dynamic linker should make
345 # libfrr available to modules. If some OS platform has a dynamic linker that
346 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
347 # it's not linked into daemons statically.
353 lib_LTLIBRARIES += lib/libfrrsnmp.la
356 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
357 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
358 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
359 lib_libfrrsnmp_la_SOURCES = \
369 lib_LTLIBRARIES += lib/libfrrcares.la
370 pkginclude_HEADERS += lib/resolver.h
373 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
374 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
375 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
376 lib_libfrrcares_la_SOURCES = \
384 lib_LTLIBRARIES += lib/libfrrzmq.la
385 pkginclude_HEADERS += lib/frr_zmq.h
388 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
389 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
390 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
391 lib_libfrrzmq_la_SOURCES = \
396 # Tail-f's ConfD support
399 module_LTLIBRARIES += lib/confd.la
402 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
403 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
404 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
405 lib_confd_la_SOURCES = lib/northbound_confd.c
411 module_LTLIBRARIES += lib/sysrepo.la
414 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
415 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
416 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
417 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
420 # gRPC northbound plugin
423 module_LTLIBRARIES += lib/grpc.la
426 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
427 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
428 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
429 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
435 lib/grammar_sandbox \
439 noinst_PROGRAMS += lib/clippy
443 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
447 lib_grammar_sandbox_SOURCES = \
448 lib/grammar_sandbox_main.c
449 lib_grammar_sandbox_LDADD = \
452 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
453 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
454 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
455 # no $(SAN_FLAGS) here
456 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
457 lib_clippy_SOURCES = \
460 lib/command_graph.c \
462 lib/command_parse.y \
473 # (global) clippy rules for all directories
475 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
476 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
477 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
480 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
482 SUFFIXES += _clippy.c
484 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
486 # xrelfo, the ELF xref extractor
488 AM_V_XRELFO = $(am__v_XRELFO_$(V))
489 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
490 am__v_XRELFO_0 = @echo " XRELFO " $@;
493 XRELFO_FLAGS = -Wlog-format -Wlog-args
497 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
499 # dependencies added in python/makefile.py
501 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
505 -rm -rf $(xrefs) frr.xref
506 clean-local: clean-xref
508 CLEANFILES += vtysh/vtysh_cmd.c
509 vtysh/vtysh_cmd.c: frr.xref
510 @test -f $@ || rm -f frr.xref || true
511 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
513 ## automake's "ylwrap" is a great piece of GNU software... not.
515 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
517 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
520 # generated sources & extra foo
524 lib/command_parse.h \
527 lib/route_types.txt \
535 ## force route_types.h
536 $(lib_clippy_OBJECTS): lib/route_types.h
537 $(lib_libfrr_la_OBJECTS): lib/route_types.h
539 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
541 lib/command_lex.h: lib/command_lex.c
542 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
543 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
544 lib/command_lex.lo: lib/command_parse.h
545 lib/command_parse.lo: lib/command_lex.h
546 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
547 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
548 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
549 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
551 DISTCLEANFILES += lib/command_lex.h \
553 lib/command_parse.h \
559 rt_enabled += --enabled babeld
562 rt_enabled += --enabled bfdd
565 rt_enabled += --enabled bgpd
567 rt_enabled += --enabled bgpd-vnc
571 rt_enabled += --enabled eigrpd
574 rt_enabled += --enabled isisd
577 rt_enabled += --enabled fabricd
580 rt_enabled += --enabled ldpd
583 rt_enabled += --enabled nhrpd
586 rt_enabled += --enabled ospfd
589 rt_enabled += --enabled ospf6d
592 rt_enabled += --enabled pbrd
595 rt_enabled += --enabled pimd
598 rt_enabled += --enabled ripd
601 rt_enabled += --enabled ripngd
604 rt_enabled += --enabled sharpd
607 rt_enabled += --enabled zebra
610 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
612 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
613 DISTCLEANFILES += lib/route_types.h
616 # bit of a trick here to always have up-to-date git stamps without triggering
617 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
618 # but if we use that on gitversion.h it'll ripple through the .c file deps.
619 # (even if gitversion.h's file timestamp doesn't change, make will think it
620 # did, because of .PHONY...)
622 PHONY_GITVERSION=lib/gitversion.h.tmp
623 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
624 GITH=lib/gitversion.h
625 lib/gitversion.h.tmp: $(top_srcdir)/.git
627 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
628 lib/gitversion.h: lib/gitversion.h.tmp
629 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
632 PHONY_GITVERSION=lib/gitversion.h
636 .PHONY: $(PHONY_GITVERSION)