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 = \
29 lib/grammar_sandbox.c \
58 lib/northbound_cli.c \
95 lib/yang_translator.c \
99 lib/printf/printf-pos.c \
100 lib/printf/vfprintf.c \
104 nodist_lib_libfrr_la_SOURCES = \
105 yang/frr-interface.yang.c \
106 yang/frr-route-types.yang.c \
107 yang/frr-module-translator.yang.c \
111 $(top_srcdir)/lib/distribute.c \
112 $(top_srcdir)/lib/filter.c \
113 $(top_srcdir)/lib/if.c \
114 $(top_srcdir)/lib/if_rmap.c \
115 $(top_srcdir)/lib/keychain.c \
116 $(top_srcdir)/lib/logicalrouter.c \
117 $(top_srcdir)/lib/nexthop_group.c \
118 $(top_srcdir)/lib/plist.c \
119 $(top_srcdir)/lib/routemap.c \
120 $(top_srcdir)/lib/vrf.c \
121 $(top_srcdir)/lib/vty.c \
123 # can be loaded as DSO - always include for vtysh
124 vtysh_scan += $(top_srcdir)/lib/agentx.c
127 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
128 lib_libfrr_la_SOURCES += lib/db.c
131 lib/if_clippy.c: $(CLIPPY_DEPS)
132 lib/if.lo: lib/if_clippy.c
133 lib/plist_clippy.c: $(CLIPPY_DEPS)
134 lib/plist.lo: lib/plist_clippy.c
135 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
136 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
137 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
138 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
139 lib/vty_clippy.c: $(CLIPPY_DEPS)
140 lib/vty.lo: lib/vty_clippy.c
141 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
142 lib/log_vty.lo: lib/log_vty_clippy.c
144 pkginclude_HEADERS += \
153 lib/command_graph.h \
154 lib/command_match.h \
162 lib/freebsd-queue.h \
194 lib/nexthop_group.h \
195 lib/nexthop_group_private.h \
197 lib/northbound_cli.h \
198 lib/northbound_db.h \
200 lib/openbsd-queue.h \
222 lib/srcdest_table.h \
239 lib/yang_translator.h \
240 lib/yang_wrappers.h \
244 lib/logicalrouter.h \
249 nodist_pkginclude_HEADERS += \
258 lib/printf/printfcommon.h \
259 lib/printf/printflocal.h \
262 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
263 # linking: If we're linking libfrr statically into daemons, we *must* remove
264 # libfrr from modules because modules will always link it in dynamically and
265 # thus 2 copies of libfrr will be loaded... hilarity ensues.
267 # Not linking libfrr into modules should generally work fine because the
268 # executable refers to libfrr either way and the dynamic linker should make
269 # libfrr available to modules. If some OS platform has a dynamic linker that
270 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
271 # it's not linked into daemons statically.
277 lib_LTLIBRARIES += lib/libfrrsnmp.la
280 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
281 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
282 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
283 lib_libfrrsnmp_la_SOURCES = \
292 lib_LTLIBRARIES += lib/libfrrcares.la
293 pkginclude_HEADERS += lib/resolver.h
296 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
297 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
298 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
299 lib_libfrrcares_la_SOURCES = \
307 lib_LTLIBRARIES += lib/libfrrzmq.la
308 pkginclude_HEADERS += lib/frr_zmq.h
311 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
312 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
313 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
314 lib_libfrrzmq_la_SOURCES = \
319 # Tail-f's ConfD support
322 module_LTLIBRARIES += lib/confd.la
325 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
326 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
327 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
328 lib_confd_la_SOURCES = lib/northbound_confd.c
334 module_LTLIBRARIES += lib/sysrepo.la
337 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
338 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
339 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
340 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
343 # gRPC northbound plugin
346 module_LTLIBRARIES += lib/grpc.la
349 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
350 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
351 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
352 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
358 lib/grammar_sandbox \
362 noinst_PROGRAMS += lib/clippy
366 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
370 lib_grammar_sandbox_SOURCES = \
371 lib/grammar_sandbox_main.c
372 lib_grammar_sandbox_LDADD = \
375 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
376 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
377 lib_clippy_LDADD = $(PYTHON_LIBS)
378 lib_clippy_LDFLAGS = -export-dynamic
379 lib_clippy_SOURCES = \
381 lib/command_graph.c \
383 lib/command_parse.y \
391 # (global) clippy rules for all directories
393 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
394 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
395 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
398 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
400 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
402 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
404 ## automake's "ylwrap" is a great piece of GNU software... not.
406 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
408 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
411 # generated sources & extra foo
415 lib/command_parse.h \
418 lib/route_types.txt \
426 ## force route_types.h
427 $(lib_clippy_OBJECTS): lib/route_types.h
428 $(lib_libfrr_la_OBJECTS): lib/route_types.h
430 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
432 lib/command_lex.h: lib/command_lex.c
433 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
434 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
435 lib/command_lex.lo: lib/command_parse.h
436 lib/command_parse.lo: lib/command_lex.h
437 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
438 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
439 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
440 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
442 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
443 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
444 DISTCLEANFILES += lib/route_types.h
447 # bit of a trick here to always have up-to-date git stamps without triggering
448 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
449 # but if we use that on gitversion.h it'll ripple through the .c file deps.
450 # (even if gitversion.h's file timestamp doesn't change, make will think it
451 # did, because of .PHONY...)
453 PHONY_GITVERSION=lib/gitversion.h.tmp
454 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
455 GITH=lib/gitversion.h
456 lib/gitversion.h.tmp: $(top_srcdir)/.git
457 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
458 lib/gitversion.h: lib/gitversion.h.tmp
459 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
462 PHONY_GITVERSION=lib/gitversion.h
466 .PHONY: $(PHONY_GITVERSION)