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/libfrrzmq.la
293 pkginclude_HEADERS += lib/frr_zmq.h
296 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
297 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
298 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
299 lib_libfrrzmq_la_SOURCES = \
304 # Tail-f's ConfD support
307 module_LTLIBRARIES += lib/confd.la
310 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
311 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
312 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
313 lib_confd_la_SOURCES = lib/northbound_confd.c
319 module_LTLIBRARIES += lib/sysrepo.la
322 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
323 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
324 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
325 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
328 # gRPC northbound plugin
331 module_LTLIBRARIES += lib/grpc.la
334 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
335 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
336 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
337 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
343 lib/grammar_sandbox \
347 noinst_PROGRAMS += lib/clippy
351 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
355 lib_grammar_sandbox_SOURCES = \
356 lib/grammar_sandbox_main.c
357 lib_grammar_sandbox_LDADD = \
360 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
361 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
362 lib_clippy_LDADD = $(PYTHON_LIBS)
363 lib_clippy_LDFLAGS = -export-dynamic
364 lib_clippy_SOURCES = \
366 lib/command_graph.c \
368 lib/command_parse.y \
376 # (global) clippy rules for all directories
378 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
379 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
380 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
383 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
385 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
387 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
389 ## automake's "ylwrap" is a great piece of GNU software... not.
391 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
393 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
396 # generated sources & extra foo
400 lib/command_parse.h \
403 lib/route_types.txt \
411 ## force route_types.h
412 $(lib_clippy_OBJECTS): lib/route_types.h
413 $(lib_libfrr_la_OBJECTS): lib/route_types.h
415 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
417 lib/command_lex.h: lib/command_lex.c
418 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
419 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
420 lib/command_lex.lo: lib/command_parse.h
421 lib/command_parse.lo: lib/command_lex.h
422 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
423 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
424 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
425 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
427 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
428 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
429 DISTCLEANFILES += lib/route_types.h
432 # bit of a trick here to always have up-to-date git stamps without triggering
433 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
434 # but if we use that on gitversion.h it'll ripple through the .c file deps.
435 # (even if gitversion.h's file timestamp doesn't change, make will think it
436 # did, because of .PHONY...)
438 PHONY_GITVERSION=lib/gitversion.h.tmp
439 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
440 GITH=lib/gitversion.h
441 lib/gitversion.h.tmp: $(top_srcdir)/.git
442 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
443 lib/gitversion.h: lib/gitversion.h.tmp
444 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
447 PHONY_GITVERSION=lib/gitversion.h
451 .PHONY: $(PHONY_GITVERSION)