4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
6 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBM)
8 lib_libfrr_la_SOURCES = \
34 lib/grammar_sandbox.c \
68 lib/northbound_cli.c \
82 lib/routemap_northbound.c \
108 lib/yang_translator.c \
109 lib/yang_wrappers.c \
113 lib/printf/printf-pos.c \
114 lib/printf/vfprintf.c \
117 lib/routing_nb_config.c \
120 nodist_lib_libfrr_la_SOURCES = \
121 yang/frr-filter.yang.c \
122 yang/frr-interface.yang.c \
123 yang/frr-route-map.yang.c \
124 yang/frr-route-types.yang.c \
125 yang/frr-vrf.yang.c \
126 yang/frr-routing.yang.c \
127 yang/frr-nexthop.yang.c \
128 yang/ietf/ietf-routing-types.yang.c \
129 yang/ietf/ietf-interfaces.yang.c \
130 yang/ietf/ietf-bgp-types.yang.c \
131 yang/frr-module-translator.yang.c \
132 yang/frr-nexthop.yang.c \
143 lib/nexthop_group.c \
150 # can be loaded as DSO - always include for vtysh
151 vtysh_scan += lib/agentx.c
154 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
155 lib_libfrr_la_SOURCES += lib/db.c
162 lib/nexthop_group.c \
163 lib/northbound_cli.c \
169 pkginclude_HEADERS += \
178 lib/command_graph.h \
179 lib/command_match.h \
188 lib/freebsd-queue.h \
226 lib/nexthop_group.h \
227 lib/nexthop_group_private.h \
229 lib/northbound_cli.h \
230 lib/northbound_db.h \
232 lib/openbsd-queue.h \
254 lib/srcdest_table.h \
274 lib/yang_translator.h \
275 lib/yang_wrappers.h \
286 nodist_pkginclude_HEADERS += \
294 lib/printf/printfcommon.h \
295 lib/printf/printflocal.h \
298 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
299 # linking: If we're linking libfrr statically into daemons, we *must* remove
300 # libfrr from modules because modules will always link it in dynamically and
301 # thus 2 copies of libfrr will be loaded... hilarity ensues.
303 # Not linking libfrr into modules should generally work fine because the
304 # executable refers to libfrr either way and the dynamic linker should make
305 # libfrr available to modules. If some OS platform has a dynamic linker that
306 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
307 # it's not linked into daemons statically.
313 lib_LTLIBRARIES += lib/libfrrsnmp.la
316 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
317 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
318 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
319 lib_libfrrsnmp_la_SOURCES = \
328 lib_LTLIBRARIES += lib/libfrrcares.la
329 pkginclude_HEADERS += lib/resolver.h
332 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
333 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
334 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
335 lib_libfrrcares_la_SOURCES = \
343 lib_LTLIBRARIES += lib/libfrrzmq.la
344 pkginclude_HEADERS += lib/frr_zmq.h
347 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
348 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
349 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
350 lib_libfrrzmq_la_SOURCES = \
355 # Tail-f's ConfD support
358 module_LTLIBRARIES += lib/confd.la
361 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
362 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
363 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
364 lib_confd_la_SOURCES = lib/northbound_confd.c
370 module_LTLIBRARIES += lib/sysrepo.la
373 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
374 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
375 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
376 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
379 # gRPC northbound plugin
382 module_LTLIBRARIES += lib/grpc.la
385 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
386 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
387 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
388 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
394 lib/grammar_sandbox \
398 noinst_PROGRAMS += lib/clippy
402 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
406 lib_grammar_sandbox_SOURCES = \
407 lib/grammar_sandbox_main.c
408 lib_grammar_sandbox_LDADD = \
411 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
412 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
413 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
414 lib_clippy_LDFLAGS = -export-dynamic
415 lib_clippy_SOURCES = \
418 lib/command_graph.c \
420 lib/command_parse.y \
431 # (global) clippy rules for all directories
433 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
434 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
435 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
438 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
440 SUFFIXES += _clippy.c
442 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
444 # xrelfo, the ELF xref extractor
446 AM_V_XRELFO = $(am__v_XRELFO_$(V))
447 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
448 am__v_XRELFO_0 = @echo " XRELFO " $@;
452 XRELFO_FLAGS = -Wlog-format -Wlog-args
459 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(XRELFO_FLAGS) -o $@ $<
461 # dependencies added in python/makefile.py
463 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^
467 -rm -rf $(xrefs) frr.xref
468 clean-local: clean-xref
470 ## automake's "ylwrap" is a great piece of GNU software... not.
472 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
474 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
477 # generated sources & extra foo
481 lib/command_parse.h \
484 lib/route_types.txt \
492 ## force route_types.h
493 $(lib_clippy_OBJECTS): lib/route_types.h
494 $(lib_libfrr_la_OBJECTS): lib/route_types.h
496 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
498 lib/command_lex.h: lib/command_lex.c
499 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
500 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
501 lib/command_lex.lo: lib/command_parse.h
502 lib/command_parse.lo: lib/command_lex.h
503 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
504 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
505 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
506 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
511 rt_enabled += --enabled babeld
514 rt_enabled += --enabled bfdd
517 rt_enabled += --enabled bgpd
519 rt_enabled += --enabled bgpd-vnc
523 rt_enabled += --enabled eigrpd
526 rt_enabled += --enabled isisd
529 rt_enabled += --enabled fabricd
532 rt_enabled += --enabled ldpd
535 rt_enabled += --enabled nhrpd
538 rt_enabled += --enabled ospfd
541 rt_enabled += --enabled ospf6d
544 rt_enabled += --enabled pbrd
547 rt_enabled += --enabled pimd
550 rt_enabled += --enabled ripd
553 rt_enabled += --enabled ripngd
556 rt_enabled += --enabled sharpd
559 rt_enabled += --enabled zebra
562 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
563 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
564 DISTCLEANFILES += lib/route_types.h
567 # bit of a trick here to always have up-to-date git stamps without triggering
568 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
569 # but if we use that on gitversion.h it'll ripple through the .c file deps.
570 # (even if gitversion.h's file timestamp doesn't change, make will think it
571 # did, because of .PHONY...)
573 PHONY_GITVERSION=lib/gitversion.h.tmp
574 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
575 GITH=lib/gitversion.h
576 lib/gitversion.h.tmp: $(top_srcdir)/.git
577 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
578 lib/gitversion.h: lib/gitversion.h.tmp
579 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
582 PHONY_GITVERSION=lib/gitversion.h
586 .PHONY: $(PHONY_GITVERSION)