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 \
113 nodist_lib_libfrr_la_SOURCES = \
114 yang/frr-filter.yang.c \
115 yang/frr-interface.yang.c \
116 yang/frr-route-map.yang.c \
117 yang/frr-route-types.yang.c \
118 yang/frr-vrf.yang.c \
119 yang/frr-routing.yang.c \
120 yang/ietf/ietf-routing-types.yang.c \
121 yang/ietf/ietf-interfaces.yang.c \
122 yang/frr-module-translator.yang.c \
123 yang/frr-nexthop.yang.c \
124 yang/frr-igmp.yang.c \
125 yang/frr-pim.yang.c \
126 yang/frr-pim-rp.yang.c \
137 lib/nexthop_group.c \
144 # can be loaded as DSO - always include for vtysh
145 vtysh_scan += lib/agentx.c
148 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
149 lib_libfrr_la_SOURCES += lib/db.c
156 lib/nexthop_group.c \
157 lib/northbound_cli.c \
163 pkginclude_HEADERS += \
172 lib/command_graph.h \
173 lib/command_match.h \
182 lib/freebsd-queue.h \
216 lib/nexthop_group.h \
217 lib/nexthop_group_private.h \
219 lib/northbound_cli.h \
220 lib/northbound_db.h \
222 lib/openbsd-queue.h \
244 lib/srcdest_table.h \
261 lib/yang_translator.h \
262 lib/yang_wrappers.h \
272 nodist_pkginclude_HEADERS += \
280 lib/printf/printfcommon.h \
281 lib/printf/printflocal.h \
284 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
285 # linking: If we're linking libfrr statically into daemons, we *must* remove
286 # libfrr from modules because modules will always link it in dynamically and
287 # thus 2 copies of libfrr will be loaded... hilarity ensues.
289 # Not linking libfrr into modules should generally work fine because the
290 # executable refers to libfrr either way and the dynamic linker should make
291 # libfrr available to modules. If some OS platform has a dynamic linker that
292 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
293 # it's not linked into daemons statically.
299 lib_LTLIBRARIES += lib/libfrrsnmp.la
302 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
303 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
304 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
305 lib_libfrrsnmp_la_SOURCES = \
314 lib_LTLIBRARIES += lib/libfrrcares.la
315 pkginclude_HEADERS += lib/resolver.h
318 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
319 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
320 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
321 lib_libfrrcares_la_SOURCES = \
329 lib_LTLIBRARIES += lib/libfrrzmq.la
330 pkginclude_HEADERS += lib/frr_zmq.h
333 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
334 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
335 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
336 lib_libfrrzmq_la_SOURCES = \
341 # Tail-f's ConfD support
344 module_LTLIBRARIES += lib/confd.la
347 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
348 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
349 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
350 lib_confd_la_SOURCES = lib/northbound_confd.c
356 module_LTLIBRARIES += lib/sysrepo.la
359 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
360 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
361 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
362 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
365 # gRPC northbound plugin
368 module_LTLIBRARIES += lib/grpc.la
371 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
372 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
373 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
374 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
380 lib/grammar_sandbox \
384 noinst_PROGRAMS += lib/clippy
388 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
392 lib_grammar_sandbox_SOURCES = \
393 lib/grammar_sandbox_main.c
394 lib_grammar_sandbox_LDADD = \
397 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
398 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
399 lib_clippy_LDADD = $(PYTHON_LIBS)
400 lib_clippy_LDFLAGS = -export-dynamic
401 lib_clippy_SOURCES = \
403 lib/command_graph.c \
405 lib/command_parse.y \
413 # (global) clippy rules for all directories
415 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
416 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
417 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
420 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
422 SUFFIXES += _clippy.c
424 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
426 ## automake's "ylwrap" is a great piece of GNU software... not.
428 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
430 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
433 # generated sources & extra foo
437 lib/command_parse.h \
440 lib/route_types.txt \
448 ## force route_types.h
449 $(lib_clippy_OBJECTS): lib/route_types.h
450 $(lib_libfrr_la_OBJECTS): lib/route_types.h
452 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
454 lib/command_lex.h: lib/command_lex.c
455 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
456 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
457 lib/command_lex.lo: lib/command_parse.h
458 lib/command_parse.lo: lib/command_lex.h
459 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
460 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
461 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
462 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
464 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
465 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
466 DISTCLEANFILES += lib/route_types.h
469 # bit of a trick here to always have up-to-date git stamps without triggering
470 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
471 # but if we use that on gitversion.h it'll ripple through the .c file deps.
472 # (even if gitversion.h's file timestamp doesn't change, make will think it
473 # did, because of .PHONY...)
475 PHONY_GITVERSION=lib/gitversion.h.tmp
476 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
477 GITH=lib/gitversion.h
478 lib/gitversion.h.tmp: $(top_srcdir)/.git
479 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
480 lib/gitversion.h: lib/gitversion.h.tmp
481 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
484 PHONY_GITVERSION=lib/gitversion.h
488 .PHONY: $(PHONY_GITVERSION)