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 \
65 lib/northbound_cli.c \
79 lib/routemap_northbound.c \
104 lib/yang_translator.c \
105 lib/yang_wrappers.c \
109 lib/printf/printf-pos.c \
110 lib/printf/vfprintf.c \
113 lib/routing_nb_config.c \
116 nodist_lib_libfrr_la_SOURCES = \
117 yang/frr-filter.yang.c \
118 yang/frr-interface.yang.c \
119 yang/frr-route-map.yang.c \
120 yang/frr-route-types.yang.c \
121 yang/frr-vrf.yang.c \
122 yang/frr-routing.yang.c \
123 yang/frr-nexthop.yang.c \
124 yang/ietf/ietf-routing-types.yang.c \
125 yang/ietf/ietf-interfaces.yang.c \
126 yang/ietf/ietf-bgp-types.yang.c \
127 yang/frr-module-translator.yang.c \
128 yang/frr-nexthop.yang.c \
139 lib/nexthop_group.c \
146 # can be loaded as DSO - always include for vtysh
147 vtysh_scan += lib/agentx.c
150 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
151 lib_libfrr_la_SOURCES += lib/db.c
158 lib/nexthop_group.c \
159 lib/northbound_cli.c \
165 pkginclude_HEADERS += \
174 lib/command_graph.h \
175 lib/command_match.h \
184 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 \
265 lib/yang_translator.h \
266 lib/yang_wrappers.h \
277 nodist_pkginclude_HEADERS += \
285 lib/printf/printfcommon.h \
286 lib/printf/printflocal.h \
289 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
290 # linking: If we're linking libfrr statically into daemons, we *must* remove
291 # libfrr from modules because modules will always link it in dynamically and
292 # thus 2 copies of libfrr will be loaded... hilarity ensues.
294 # Not linking libfrr into modules should generally work fine because the
295 # executable refers to libfrr either way and the dynamic linker should make
296 # libfrr available to modules. If some OS platform has a dynamic linker that
297 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
298 # it's not linked into daemons statically.
304 lib_LTLIBRARIES += lib/libfrrsnmp.la
307 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
308 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
309 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
310 lib_libfrrsnmp_la_SOURCES = \
319 lib_LTLIBRARIES += lib/libfrrcares.la
320 pkginclude_HEADERS += lib/resolver.h
323 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
324 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
325 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
326 lib_libfrrcares_la_SOURCES = \
334 lib_LTLIBRARIES += lib/libfrrzmq.la
335 pkginclude_HEADERS += lib/frr_zmq.h
338 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
339 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
340 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
341 lib_libfrrzmq_la_SOURCES = \
346 # Tail-f's ConfD support
349 module_LTLIBRARIES += lib/confd.la
352 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
353 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
354 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
355 lib_confd_la_SOURCES = lib/northbound_confd.c
361 module_LTLIBRARIES += lib/sysrepo.la
364 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
365 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
366 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
367 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
370 # gRPC northbound plugin
373 module_LTLIBRARIES += lib/grpc.la
376 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
377 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
378 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
379 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
385 lib/grammar_sandbox \
389 noinst_PROGRAMS += lib/clippy
393 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
397 lib_grammar_sandbox_SOURCES = \
398 lib/grammar_sandbox_main.c
399 lib_grammar_sandbox_LDADD = \
402 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
403 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
404 lib_clippy_LDADD = $(PYTHON_LIBS)
405 lib_clippy_LDFLAGS = -export-dynamic
406 lib_clippy_SOURCES = \
408 lib/command_graph.c \
410 lib/command_parse.y \
418 # (global) clippy rules for all directories
420 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
421 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
422 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
425 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
427 SUFFIXES += _clippy.c
429 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
431 ## automake's "ylwrap" is a great piece of GNU software... not.
433 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
435 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
438 # generated sources & extra foo
442 lib/command_parse.h \
445 lib/route_types.txt \
453 ## force route_types.h
454 $(lib_clippy_OBJECTS): lib/route_types.h
455 $(lib_libfrr_la_OBJECTS): lib/route_types.h
457 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
459 lib/command_lex.h: lib/command_lex.c
460 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
461 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
462 lib/command_lex.lo: lib/command_parse.h
463 lib/command_parse.lo: lib/command_lex.h
464 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
465 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
466 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
467 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
469 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
470 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
471 DISTCLEANFILES += lib/route_types.h
474 # bit of a trick here to always have up-to-date git stamps without triggering
475 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
476 # but if we use that on gitversion.h it'll ripple through the .c file deps.
477 # (even if gitversion.h's file timestamp doesn't change, make will think it
478 # did, because of .PHONY...)
480 PHONY_GITVERSION=lib/gitversion.h.tmp
481 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
482 GITH=lib/gitversion.h
483 lib/gitversion.h.tmp: $(top_srcdir)/.git
484 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
485 lib/gitversion.h: lib/gitversion.h.tmp
486 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
489 PHONY_GITVERSION=lib/gitversion.h
493 .PHONY: $(PHONY_GITVERSION)