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) $(LIBM)
8 lib_libfrr_la_SOURCES = \
33 lib/grammar_sandbox.c \
64 lib/northbound_cli.c \
78 lib/routemap_northbound.c \
103 lib/yang_translator.c \
104 lib/yang_wrappers.c \
108 lib/printf/printf-pos.c \
109 lib/printf/vfprintf.c \
112 lib/routing_nb_config.c \
115 nodist_lib_libfrr_la_SOURCES = \
116 yang/frr-filter.yang.c \
117 yang/frr-interface.yang.c \
118 yang/frr-route-map.yang.c \
119 yang/frr-route-types.yang.c \
120 yang/frr-vrf.yang.c \
121 yang/frr-routing.yang.c \
122 yang/frr-nexthop.yang.c \
123 yang/ietf/ietf-routing-types.yang.c \
124 yang/ietf/ietf-interfaces.yang.c \
125 yang/frr-module-translator.yang.c \
126 yang/frr-nexthop.yang.c \
127 yang/frr-igmp.yang.c \
128 yang/frr-pim.yang.c \
129 yang/frr-pim-rp.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 \
219 lib/nexthop_group.h \
220 lib/nexthop_group_private.h \
222 lib/northbound_cli.h \
223 lib/northbound_db.h \
225 lib/openbsd-queue.h \
247 lib/srcdest_table.h \
264 lib/yang_translator.h \
265 lib/yang_wrappers.h \
276 nodist_pkginclude_HEADERS += \
284 lib/printf/printfcommon.h \
285 lib/printf/printflocal.h \
288 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
289 # linking: If we're linking libfrr statically into daemons, we *must* remove
290 # libfrr from modules because modules will always link it in dynamically and
291 # thus 2 copies of libfrr will be loaded... hilarity ensues.
293 # Not linking libfrr into modules should generally work fine because the
294 # executable refers to libfrr either way and the dynamic linker should make
295 # libfrr available to modules. If some OS platform has a dynamic linker that
296 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
297 # it's not linked into daemons statically.
303 lib_LTLIBRARIES += lib/libfrrsnmp.la
306 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
307 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
308 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
309 lib_libfrrsnmp_la_SOURCES = \
318 lib_LTLIBRARIES += lib/libfrrcares.la
319 pkginclude_HEADERS += lib/resolver.h
322 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
323 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
324 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
325 lib_libfrrcares_la_SOURCES = \
333 lib_LTLIBRARIES += lib/libfrrzmq.la
334 pkginclude_HEADERS += lib/frr_zmq.h
337 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
338 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
339 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
340 lib_libfrrzmq_la_SOURCES = \
345 # Tail-f's ConfD support
348 module_LTLIBRARIES += lib/confd.la
351 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
352 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
353 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
354 lib_confd_la_SOURCES = lib/northbound_confd.c
360 module_LTLIBRARIES += lib/sysrepo.la
363 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
364 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
365 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
366 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
369 # gRPC northbound plugin
372 module_LTLIBRARIES += lib/grpc.la
375 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
376 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
377 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
378 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
384 lib/grammar_sandbox \
388 noinst_PROGRAMS += lib/clippy
392 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
396 lib_grammar_sandbox_SOURCES = \
397 lib/grammar_sandbox_main.c
398 lib_grammar_sandbox_LDADD = \
401 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
402 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
403 lib_clippy_LDADD = $(PYTHON_LIBS)
404 lib_clippy_LDFLAGS = -export-dynamic
405 lib_clippy_SOURCES = \
407 lib/command_graph.c \
409 lib/command_parse.y \
417 # (global) clippy rules for all directories
419 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
420 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
421 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
424 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
426 SUFFIXES += _clippy.c
428 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
430 ## automake's "ylwrap" is a great piece of GNU software... not.
432 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
434 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
437 # generated sources & extra foo
441 lib/command_parse.h \
444 lib/route_types.txt \
452 ## force route_types.h
453 $(lib_clippy_OBJECTS): lib/route_types.h
454 $(lib_libfrr_la_OBJECTS): lib/route_types.h
456 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
458 lib/command_lex.h: lib/command_lex.c
459 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
460 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
461 lib/command_lex.lo: lib/command_parse.h
462 lib/command_parse.lo: lib/command_lex.h
463 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
464 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
465 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
466 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
468 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
469 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
470 DISTCLEANFILES += lib/route_types.h
473 # bit of a trick here to always have up-to-date git stamps without triggering
474 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
475 # but if we use that on gitversion.h it'll ripple through the .c file deps.
476 # (even if gitversion.h's file timestamp doesn't change, make will think it
477 # did, because of .PHONY...)
479 PHONY_GITVERSION=lib/gitversion.h.tmp
480 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
481 GITH=lib/gitversion.h
482 lib/gitversion.h.tmp: $(top_srcdir)/.git
483 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
484 lib/gitversion.h: lib/gitversion.h.tmp
485 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
488 PHONY_GITVERSION=lib/gitversion.h
492 .PHONY: $(PHONY_GITVERSION)