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 \
43 lib/grammar_sandbox.c \
77 lib/northbound_cli.c \
91 lib/routemap_northbound.c \
100 lib/srcdest_table.c \
118 lib/yang_translator.c \
119 lib/yang_wrappers.c \
123 lib/zlog_5424_cli.c \
126 lib/printf/printf-pos.c \
127 lib/printf/vfprintf.c \
130 lib/routing_nb_config.c \
134 nodist_lib_libfrr_la_SOURCES = \
135 yang/frr-affinity-map.yang.c \
136 yang/frr-filter.yang.c \
137 yang/frr-interface.yang.c \
138 yang/frr-route-map.yang.c \
139 yang/frr-route-types.yang.c \
140 yang/frr-vrf.yang.c \
141 yang/frr-routing.yang.c \
142 yang/frr-nexthop.yang.c \
143 yang/ietf/ietf-routing-types.yang.c \
144 yang/ietf/ietf-interfaces.yang.c \
145 yang/ietf/ietf-bgp-types.yang.c \
146 yang/frr-module-translator.yang.c \
150 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
151 lib_libfrr_la_SOURCES += lib/db.c
155 lib/affinitymap_cli.c \
159 lib/nexthop_group.c \
160 lib/northbound_cli.c \
166 lib/zlog_5424_cli.c \
169 pkginclude_HEADERS += \
182 lib/command_graph.h \
183 lib/command_match.h \
193 lib/freebsd-queue.h \
231 lib/nexthop_group.h \
232 lib/nexthop_group_private.h \
234 lib/northbound_cli.h \
235 lib/northbound_db.h \
237 lib/openbsd-queue.h \
260 lib/srcdest_table.h \
280 lib/yang_translator.h \
281 lib/yang_wrappers.h \
292 lib/assert/assert.h \
296 nodist_pkginclude_HEADERS += \
304 lib/printf/printfcommon.h \
305 lib/printf/printflocal.h \
308 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
309 # linking: If we're linking libfrr statically into daemons, we *must* remove
310 # libfrr from modules because modules will always link it in dynamically and
311 # thus 2 copies of libfrr will be loaded... hilarity ensues.
313 # Not linking libfrr into modules should generally work fine because the
314 # executable refers to libfrr either way and the dynamic linker should make
315 # libfrr available to modules. If some OS platform has a dynamic linker that
316 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
317 # it's not linked into daemons statically.
323 lib_LTLIBRARIES += lib/libfrrsnmp.la
326 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
327 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
328 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
329 lib_libfrrsnmp_la_SOURCES = \
339 lib_LTLIBRARIES += lib/libfrrcares.la
340 pkginclude_HEADERS += lib/resolver.h
343 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
344 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
345 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
346 lib_libfrrcares_la_SOURCES = \
354 lib_LTLIBRARIES += lib/libfrrzmq.la
355 pkginclude_HEADERS += lib/frr_zmq.h
358 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
359 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
360 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
361 lib_libfrrzmq_la_SOURCES = \
366 # Tail-f's ConfD support
369 module_LTLIBRARIES += lib/confd.la
372 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
373 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
374 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
375 lib_confd_la_SOURCES = lib/northbound_confd.c
381 module_LTLIBRARIES += lib/sysrepo.la
384 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
385 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
386 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
387 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
390 # gRPC northbound plugin
393 module_LTLIBRARIES += lib/grpc.la
396 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
397 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
398 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
399 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
405 lib/grammar_sandbox \
409 noinst_PROGRAMS += lib/clippy
413 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
417 lib_grammar_sandbox_SOURCES = \
418 lib/grammar_sandbox_main.c
419 lib_grammar_sandbox_LDADD = \
422 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
423 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
424 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
425 # no $(SAN_FLAGS) here
426 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
427 lib_clippy_SOURCES = \
430 lib/command_graph.c \
432 lib/command_parse.y \
443 # (global) clippy rules for all directories
445 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
446 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
447 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
450 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
452 SUFFIXES += _clippy.c
454 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
456 # xrelfo, the ELF xref extractor
458 AM_V_XRELFO = $(am__v_XRELFO_$(V))
459 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
460 am__v_XRELFO_0 = @echo " XRELFO " $@;
463 XRELFO_FLAGS = -Wlog-format -Wlog-args
467 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
469 # dependencies added in python/makefile.py
471 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
475 -rm -rf $(xrefs) frr.xref
476 clean-local: clean-xref
478 CLEANFILES += vtysh/vtysh_cmd.c
479 vtysh/vtysh_cmd.c: frr.xref
480 @test -f $@ || rm -f frr.xref || true
481 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
483 ## automake's "ylwrap" is a great piece of GNU software... not.
485 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
487 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
490 # generated sources & extra foo
494 lib/command_parse.h \
497 lib/route_types.txt \
505 ## force route_types.h
506 $(lib_clippy_OBJECTS): lib/route_types.h
507 $(lib_libfrr_la_OBJECTS): lib/route_types.h
509 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
511 lib/command_lex.h: lib/command_lex.c
512 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
513 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
514 lib/command_lex.lo: lib/command_parse.h
515 lib/command_parse.lo: lib/command_lex.h
516 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
517 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
518 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
519 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
521 DISTCLEANFILES += lib/command_lex.h \
523 lib/command_parse.h \
529 rt_enabled += --enabled babeld
532 rt_enabled += --enabled bfdd
535 rt_enabled += --enabled bgpd
537 rt_enabled += --enabled bgpd-vnc
541 rt_enabled += --enabled eigrpd
544 rt_enabled += --enabled isisd
547 rt_enabled += --enabled fabricd
550 rt_enabled += --enabled ldpd
553 rt_enabled += --enabled nhrpd
556 rt_enabled += --enabled ospfd
559 rt_enabled += --enabled ospf6d
562 rt_enabled += --enabled pbrd
565 rt_enabled += --enabled pimd
568 rt_enabled += --enabled ripd
571 rt_enabled += --enabled ripngd
574 rt_enabled += --enabled sharpd
577 rt_enabled += --enabled zebra
580 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
582 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
583 DISTCLEANFILES += lib/route_types.h
586 # bit of a trick here to always have up-to-date git stamps without triggering
587 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
588 # but if we use that on gitversion.h it'll ripple through the .c file deps.
589 # (even if gitversion.h's file timestamp doesn't change, make will think it
590 # did, because of .PHONY...)
592 PHONY_GITVERSION=lib/gitversion.h.tmp
593 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
594 GITH=lib/gitversion.h
595 lib/gitversion.h.tmp: $(top_srcdir)/.git
597 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
598 lib/gitversion.h: lib/gitversion.h.tmp
599 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
602 PHONY_GITVERSION=lib/gitversion.h
606 .PHONY: $(PHONY_GITVERSION)