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 = \
30 lib/grammar_sandbox.c \
59 lib/northbound_cli.c \
95 lib/yang_translator.c \
98 lib/printf/printf-pos.c \
99 lib/printf/vfprintf.c \
103 nodist_lib_libfrr_la_SOURCES = \
104 yang/frr-interface.yang.c \
105 yang/frr-route-types.yang.c \
106 yang/frr-module-translator.yang.c \
110 $(top_srcdir)/lib/distribute.c \
111 $(top_srcdir)/lib/filter.c \
112 $(top_srcdir)/lib/if.c \
113 $(top_srcdir)/lib/if_rmap.c \
114 $(top_srcdir)/lib/keychain.c \
115 $(top_srcdir)/lib/nexthop_group.c \
116 $(top_srcdir)/lib/plist.c \
117 $(top_srcdir)/lib/routemap.c \
118 $(top_srcdir)/lib/vrf.c \
119 $(top_srcdir)/lib/vty.c \
121 # can be loaded as DSO - always include for vtysh
122 vtysh_scan += $(top_srcdir)/lib/agentx.c
125 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
126 lib_libfrr_la_SOURCES += lib/db.c
129 lib/if_clippy.c: $(CLIPPY_DEPS)
130 lib/if.lo: lib/if_clippy.c
131 lib/plist_clippy.c: $(CLIPPY_DEPS)
132 lib/plist.lo: lib/plist_clippy.c
133 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
134 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
135 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
136 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
137 lib/vty_clippy.c: $(CLIPPY_DEPS)
138 lib/vty.lo: lib/vty_clippy.c
139 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
140 lib/log_vty.lo: lib/log_vty_clippy.c
142 pkginclude_HEADERS += \
151 lib/command_graph.h \
152 lib/command_match.h \
160 lib/freebsd-queue.h \
193 lib/nexthop_group.h \
194 lib/nexthop_group_private.h \
196 lib/northbound_cli.h \
197 lib/northbound_db.h \
199 lib/openbsd-queue.h \
220 lib/srcdest_table.h \
237 lib/yang_translator.h \
238 lib/yang_wrappers.h \
246 nodist_pkginclude_HEADERS += \
255 lib/printf/printfcommon.h \
256 lib/printf/printflocal.h \
259 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
260 # linking: If we're linking libfrr statically into daemons, we *must* remove
261 # libfrr from modules because modules will always link it in dynamically and
262 # thus 2 copies of libfrr will be loaded... hilarity ensues.
264 # Not linking libfrr into modules should generally work fine because the
265 # executable refers to libfrr either way and the dynamic linker should make
266 # libfrr available to modules. If some OS platform has a dynamic linker that
267 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
268 # it's not linked into daemons statically.
274 lib_LTLIBRARIES += lib/libfrrsnmp.la
277 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
278 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
279 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
280 lib_libfrrsnmp_la_SOURCES = \
289 lib_LTLIBRARIES += lib/libfrrcares.la
290 pkginclude_HEADERS += lib/resolver.h
293 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
294 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
295 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
296 lib_libfrrcares_la_SOURCES = \
304 lib_LTLIBRARIES += lib/libfrrzmq.la
305 pkginclude_HEADERS += lib/frr_zmq.h
308 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
309 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
310 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
311 lib_libfrrzmq_la_SOURCES = \
316 # Tail-f's ConfD support
319 module_LTLIBRARIES += lib/confd.la
322 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
323 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
324 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
325 lib_confd_la_SOURCES = lib/northbound_confd.c
331 module_LTLIBRARIES += lib/sysrepo.la
334 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
335 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
336 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
337 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
340 # gRPC northbound plugin
343 module_LTLIBRARIES += lib/grpc.la
346 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
347 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
348 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
349 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
355 lib/grammar_sandbox \
359 noinst_PROGRAMS += lib/clippy
363 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
367 lib_grammar_sandbox_SOURCES = \
368 lib/grammar_sandbox_main.c
369 lib_grammar_sandbox_LDADD = \
372 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
373 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
374 lib_clippy_LDADD = $(PYTHON_LIBS)
375 lib_clippy_LDFLAGS = -export-dynamic
376 lib_clippy_SOURCES = \
378 lib/command_graph.c \
380 lib/command_parse.y \
388 # (global) clippy rules for all directories
390 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
391 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
392 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
395 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
397 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
399 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
401 ## automake's "ylwrap" is a great piece of GNU software... not.
403 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
405 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
408 # generated sources & extra foo
412 lib/command_parse.h \
415 lib/route_types.txt \
423 ## force route_types.h
424 $(lib_clippy_OBJECTS): lib/route_types.h
425 $(lib_libfrr_la_OBJECTS): lib/route_types.h
427 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
429 lib/command_lex.h: lib/command_lex.c
430 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
431 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
432 lib/command_lex.lo: lib/command_parse.h
433 lib/command_parse.lo: lib/command_lex.h
434 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
435 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
436 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
437 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
439 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
440 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
441 DISTCLEANFILES += lib/route_types.h
444 # bit of a trick here to always have up-to-date git stamps without triggering
445 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
446 # but if we use that on gitversion.h it'll ripple through the .c file deps.
447 # (even if gitversion.h's file timestamp doesn't change, make will think it
448 # did, because of .PHONY...)
450 PHONY_GITVERSION=lib/gitversion.h.tmp
451 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
452 GITH=lib/gitversion.h
453 lib/gitversion.h.tmp: $(top_srcdir)/.git
454 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
455 lib/gitversion.h: lib/gitversion.h.tmp
456 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
459 PHONY_GITVERSION=lib/gitversion.h
463 .PHONY: $(PHONY_GITVERSION)