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/mgmt_be_client.c \
183 lib/mgmt_fe_client.c \
184 lib/nexthop_group.c \
185 lib/northbound_cli.c \
191 lib/zlog_5424_cli.c \
194 pkginclude_HEADERS += \
207 lib/command_graph.h \
208 lib/command_match.h \
219 lib/freebsd-queue.h \
252 lib/mgmt_be_client.h \
253 lib/mgmt_fe_client.h \
262 lib/nexthop_group.h \
263 lib/nexthop_group_private.h \
265 lib/northbound_cli.h \
266 lib/northbound_db.h \
268 lib/openbsd-queue.h \
291 lib/segment_routing.h \
292 lib/srcdest_table.h \
312 lib/yang_translator.h \
313 lib/yang_wrappers.h \
324 lib/assert/assert.h \
328 nodist_pkginclude_HEADERS += \
336 lib/printf/printfcommon.h \
337 lib/printf/printflocal.h \
340 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
341 # linking: If we're linking libfrr statically into daemons, we *must* remove
342 # libfrr from modules because modules will always link it in dynamically and
343 # thus 2 copies of libfrr will be loaded... hilarity ensues.
345 # Not linking libfrr into modules should generally work fine because the
346 # executable refers to libfrr either way and the dynamic linker should make
347 # libfrr available to modules. If some OS platform has a dynamic linker that
348 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
349 # it's not linked into daemons statically.
355 lib_LTLIBRARIES += lib/libfrrsnmp.la
358 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
359 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
360 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
361 lib_libfrrsnmp_la_SOURCES = \
371 lib_LTLIBRARIES += lib/libfrrcares.la
372 pkginclude_HEADERS += lib/resolver.h
375 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
376 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
377 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
378 lib_libfrrcares_la_SOURCES = \
386 lib_LTLIBRARIES += lib/libfrrzmq.la
387 pkginclude_HEADERS += lib/frr_zmq.h
390 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
391 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
392 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
393 lib_libfrrzmq_la_SOURCES = \
398 # Tail-f's ConfD support
401 module_LTLIBRARIES += lib/confd.la
404 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
405 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
406 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
407 lib_confd_la_SOURCES = lib/northbound_confd.c
413 module_LTLIBRARIES += lib/sysrepo.la
416 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
417 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
418 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
419 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
422 # gRPC northbound plugin
425 module_LTLIBRARIES += lib/grpc.la
428 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
429 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
430 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
431 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
437 lib/grammar_sandbox \
441 noinst_PROGRAMS += lib/clippy
445 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
449 lib_grammar_sandbox_SOURCES = \
450 lib/grammar_sandbox_main.c
451 lib_grammar_sandbox_LDADD = \
454 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
455 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
456 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
457 # no $(SAN_FLAGS) here
458 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
459 lib_clippy_SOURCES = \
462 lib/command_graph.c \
464 lib/command_parse.y \
475 # (global) clippy rules for all directories
477 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
478 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
479 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
482 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
484 SUFFIXES += _clippy.c
486 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
488 # xrelfo, the ELF xref extractor
490 AM_V_XRELFO = $(am__v_XRELFO_$(V))
491 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
492 am__v_XRELFO_0 = @echo " XRELFO " $@;
495 XRELFO_FLAGS = -Wlog-format -Wlog-args
499 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
501 # dependencies added in python/makefile.py
503 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
507 -rm -rf $(xrefs) frr.xref
508 clean-local: clean-xref
510 CLEANFILES += vtysh/vtysh_cmd.c
511 vtysh/vtysh_cmd.c: frr.xref
512 @test -f $@ || rm -f frr.xref || true
513 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
515 ## automake's "ylwrap" is a great piece of GNU software... not.
517 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
519 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
522 # generated sources & extra foo
526 lib/command_parse.h \
529 lib/route_types.txt \
537 ## force route_types.h
538 $(lib_clippy_OBJECTS): lib/route_types.h
539 $(lib_libfrr_la_OBJECTS): lib/route_types.h
541 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
543 lib/command_lex.h: lib/command_lex.c
544 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
545 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
546 lib/command_lex.lo: lib/command_parse.h
547 lib/command_parse.lo: lib/command_lex.h
548 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
549 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
550 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
551 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
553 DISTCLEANFILES += lib/command_lex.h \
555 lib/command_parse.h \
561 rt_enabled += --enabled babeld
564 rt_enabled += --enabled bfdd
567 rt_enabled += --enabled bgpd
569 rt_enabled += --enabled bgpd-vnc
573 rt_enabled += --enabled eigrpd
576 rt_enabled += --enabled isisd
579 rt_enabled += --enabled fabricd
582 rt_enabled += --enabled ldpd
585 rt_enabled += --enabled nhrpd
588 rt_enabled += --enabled ospfd
591 rt_enabled += --enabled ospf6d
594 rt_enabled += --enabled pbrd
597 rt_enabled += --enabled pimd
600 rt_enabled += --enabled ripd
603 rt_enabled += --enabled ripngd
606 rt_enabled += --enabled sharpd
609 rt_enabled += --enabled zebra
612 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
614 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
615 DISTCLEANFILES += lib/route_types.h
618 # bit of a trick here to always have up-to-date git stamps without triggering
619 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
620 # but if we use that on gitversion.h it'll ripple through the .c file deps.
621 # (even if gitversion.h's file timestamp doesn't change, make will think it
622 # did, because of .PHONY...)
624 PHONY_GITVERSION=lib/gitversion.h.tmp
625 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
626 GITH=lib/gitversion.h
627 lib/gitversion.h.tmp: $(top_srcdir)/.git
629 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
630 lib/gitversion.h: lib/gitversion.h.tmp
631 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
634 PHONY_GITVERSION=lib/gitversion.h
638 .PHONY: $(PHONY_GITVERSION)