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 = \
33 lib/grammar_sandbox.c \
65 lib/northbound_cli.c \
79 lib/routemap_northbound.c \
105 lib/yang_translator.c \
106 lib/yang_wrappers.c \
110 lib/printf/printf-pos.c \
111 lib/printf/vfprintf.c \
114 lib/routing_nb_config.c \
117 nodist_lib_libfrr_la_SOURCES = \
118 yang/frr-filter.yang.c \
119 yang/frr-interface.yang.c \
120 yang/frr-route-map.yang.c \
121 yang/frr-route-types.yang.c \
122 yang/frr-vrf.yang.c \
123 yang/frr-routing.yang.c \
124 yang/frr-nexthop.yang.c \
125 yang/ietf/ietf-routing-types.yang.c \
126 yang/ietf/ietf-interfaces.yang.c \
127 yang/ietf/ietf-bgp-types.yang.c \
128 yang/frr-module-translator.yang.c \
129 yang/frr-nexthop.yang.c \
140 lib/nexthop_group.c \
147 # can be loaded as DSO - always include for vtysh
148 vtysh_scan += lib/agentx.c
151 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
152 lib_libfrr_la_SOURCES += lib/db.c
159 lib/nexthop_group.c \
160 lib/northbound_cli.c \
166 pkginclude_HEADERS += \
175 lib/command_graph.h \
176 lib/command_match.h \
185 lib/freebsd-queue.h \
220 lib/nexthop_group.h \
221 lib/nexthop_group_private.h \
223 lib/northbound_cli.h \
224 lib/northbound_db.h \
226 lib/openbsd-queue.h \
248 lib/srcdest_table.h \
267 lib/yang_translator.h \
268 lib/yang_wrappers.h \
279 nodist_pkginclude_HEADERS += \
287 lib/printf/printfcommon.h \
288 lib/printf/printflocal.h \
291 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
292 # linking: If we're linking libfrr statically into daemons, we *must* remove
293 # libfrr from modules because modules will always link it in dynamically and
294 # thus 2 copies of libfrr will be loaded... hilarity ensues.
296 # Not linking libfrr into modules should generally work fine because the
297 # executable refers to libfrr either way and the dynamic linker should make
298 # libfrr available to modules. If some OS platform has a dynamic linker that
299 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
300 # it's not linked into daemons statically.
306 lib_LTLIBRARIES += lib/libfrrsnmp.la
309 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
310 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
311 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
312 lib_libfrrsnmp_la_SOURCES = \
321 lib_LTLIBRARIES += lib/libfrrcares.la
322 pkginclude_HEADERS += lib/resolver.h
325 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
326 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
327 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
328 lib_libfrrcares_la_SOURCES = \
336 lib_LTLIBRARIES += lib/libfrrzmq.la
337 pkginclude_HEADERS += lib/frr_zmq.h
340 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
341 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
342 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
343 lib_libfrrzmq_la_SOURCES = \
348 # Tail-f's ConfD support
351 module_LTLIBRARIES += lib/confd.la
354 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
355 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
356 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
357 lib_confd_la_SOURCES = lib/northbound_confd.c
363 module_LTLIBRARIES += lib/sysrepo.la
366 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
367 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
368 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
369 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
372 # gRPC northbound plugin
375 module_LTLIBRARIES += lib/grpc.la
378 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
379 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
380 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
381 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
387 lib/grammar_sandbox \
391 noinst_PROGRAMS += lib/clippy
395 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
399 lib_grammar_sandbox_SOURCES = \
400 lib/grammar_sandbox_main.c
401 lib_grammar_sandbox_LDADD = \
404 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
405 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
406 lib_clippy_LDADD = $(PYTHON_LIBS)
407 lib_clippy_LDFLAGS = -export-dynamic
408 lib_clippy_SOURCES = \
410 lib/command_graph.c \
412 lib/command_parse.y \
420 # (global) clippy rules for all directories
422 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
423 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
424 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
427 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
429 SUFFIXES += _clippy.c
431 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
433 ## automake's "ylwrap" is a great piece of GNU software... not.
435 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
437 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
440 # generated sources & extra foo
444 lib/command_parse.h \
447 lib/route_types.txt \
455 ## force route_types.h
456 $(lib_clippy_OBJECTS): lib/route_types.h
457 $(lib_libfrr_la_OBJECTS): lib/route_types.h
459 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
461 lib/command_lex.h: lib/command_lex.c
462 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
463 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
464 lib/command_lex.lo: lib/command_parse.h
465 lib/command_parse.lo: lib/command_lex.h
466 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
467 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
468 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
469 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
471 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
472 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
473 DISTCLEANFILES += lib/route_types.h
476 # bit of a trick here to always have up-to-date git stamps without triggering
477 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
478 # but if we use that on gitversion.h it'll ripple through the .c file deps.
479 # (even if gitversion.h's file timestamp doesn't change, make will think it
480 # did, because of .PHONY...)
482 PHONY_GITVERSION=lib/gitversion.h.tmp
483 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
484 GITH=lib/gitversion.h
485 lib/gitversion.h.tmp: $(top_srcdir)/.git
486 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
487 lib/gitversion.h: lib/gitversion.h.tmp
488 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
491 PHONY_GITVERSION=lib/gitversion.h
495 .PHONY: $(PHONY_GITVERSION)