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 = \
31 lib/grammar_sandbox.c \
61 lib/northbound_cli.c \
98 lib/yang_translator.c \
101 lib/printf/printf-pos.c \
102 lib/printf/vfprintf.c \
106 nodist_lib_libfrr_la_SOURCES = \
107 yang/frr-interface.yang.c \
108 yang/frr-route-types.yang.c \
109 yang/ietf/ietf-routing-types.yang.c \
110 yang/frr-module-translator.yang.c \
114 $(top_srcdir)/lib/distribute.c \
115 $(top_srcdir)/lib/filter.c \
116 $(top_srcdir)/lib/if.c \
117 $(top_srcdir)/lib/if_rmap.c \
118 $(top_srcdir)/lib/keychain.c \
119 $(top_srcdir)/lib/lib_vty.c \
120 $(top_srcdir)/lib/nexthop_group.c \
121 $(top_srcdir)/lib/plist.c \
122 $(top_srcdir)/lib/routemap.c \
123 $(top_srcdir)/lib/vrf.c \
124 $(top_srcdir)/lib/vty.c \
126 # can be loaded as DSO - always include for vtysh
127 vtysh_scan += $(top_srcdir)/lib/agentx.c
130 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
131 lib_libfrr_la_SOURCES += lib/db.c
134 lib/if_clippy.c: $(CLIPPY_DEPS)
135 lib/if.lo: lib/if_clippy.c
136 lib/plist_clippy.c: $(CLIPPY_DEPS)
137 lib/plist.lo: lib/plist_clippy.c
138 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
139 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
140 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
141 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
142 lib/vty_clippy.c: $(CLIPPY_DEPS)
143 lib/vty.lo: lib/vty_clippy.c
144 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
145 lib/log_vty.lo: lib/log_vty_clippy.c
147 pkginclude_HEADERS += \
156 lib/command_graph.h \
157 lib/command_match.h \
166 lib/freebsd-queue.h \
200 lib/nexthop_group.h \
201 lib/nexthop_group_private.h \
203 lib/northbound_cli.h \
204 lib/northbound_db.h \
206 lib/openbsd-queue.h \
228 lib/srcdest_table.h \
245 lib/yang_translator.h \
246 lib/yang_wrappers.h \
254 nodist_pkginclude_HEADERS += \
263 lib/printf/printfcommon.h \
264 lib/printf/printflocal.h \
267 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
268 # linking: If we're linking libfrr statically into daemons, we *must* remove
269 # libfrr from modules because modules will always link it in dynamically and
270 # thus 2 copies of libfrr will be loaded... hilarity ensues.
272 # Not linking libfrr into modules should generally work fine because the
273 # executable refers to libfrr either way and the dynamic linker should make
274 # libfrr available to modules. If some OS platform has a dynamic linker that
275 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
276 # it's not linked into daemons statically.
282 lib_LTLIBRARIES += lib/libfrrsnmp.la
285 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
286 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
287 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
288 lib_libfrrsnmp_la_SOURCES = \
297 lib_LTLIBRARIES += lib/libfrrcares.la
298 pkginclude_HEADERS += lib/resolver.h
301 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
302 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
303 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
304 lib_libfrrcares_la_SOURCES = \
312 lib_LTLIBRARIES += lib/libfrrzmq.la
313 pkginclude_HEADERS += lib/frr_zmq.h
316 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
317 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
318 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
319 lib_libfrrzmq_la_SOURCES = \
324 # Tail-f's ConfD support
327 module_LTLIBRARIES += lib/confd.la
330 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
331 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
332 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
333 lib_confd_la_SOURCES = lib/northbound_confd.c
339 module_LTLIBRARIES += lib/sysrepo.la
342 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
343 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
344 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
345 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
348 # gRPC northbound plugin
351 module_LTLIBRARIES += lib/grpc.la
354 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
355 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
356 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
357 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
363 lib/grammar_sandbox \
367 noinst_PROGRAMS += lib/clippy
371 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
375 lib_grammar_sandbox_SOURCES = \
376 lib/grammar_sandbox_main.c
377 lib_grammar_sandbox_LDADD = \
380 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
381 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
382 lib_clippy_LDADD = $(PYTHON_LIBS)
383 lib_clippy_LDFLAGS = -export-dynamic
384 lib_clippy_SOURCES = \
386 lib/command_graph.c \
388 lib/command_parse.y \
396 # (global) clippy rules for all directories
398 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
399 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
400 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
403 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
405 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
407 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
409 ## automake's "ylwrap" is a great piece of GNU software... not.
411 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
413 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
416 # generated sources & extra foo
420 lib/command_parse.h \
423 lib/route_types.txt \
431 ## force route_types.h
432 $(lib_clippy_OBJECTS): lib/route_types.h
433 $(lib_libfrr_la_OBJECTS): lib/route_types.h
435 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
437 lib/command_lex.h: lib/command_lex.c
438 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
439 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
440 lib/command_lex.lo: lib/command_parse.h
441 lib/command_parse.lo: lib/command_lex.h
442 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
443 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
444 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
445 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
447 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
448 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
449 DISTCLEANFILES += lib/route_types.h
452 # bit of a trick here to always have up-to-date git stamps without triggering
453 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
454 # but if we use that on gitversion.h it'll ripple through the .c file deps.
455 # (even if gitversion.h's file timestamp doesn't change, make will think it
456 # did, because of .PHONY...)
458 PHONY_GITVERSION=lib/gitversion.h.tmp
459 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
460 GITH=lib/gitversion.h
461 lib/gitversion.h.tmp: $(top_srcdir)/.git
462 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
463 lib/gitversion.h: lib/gitversion.h.tmp
464 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
467 PHONY_GITVERSION=lib/gitversion.h
471 .PHONY: $(PHONY_GITVERSION)