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 \
62 lib/northbound_cli.c \
76 lib/routemap_northbound.c \
101 lib/yang_translator.c \
102 lib/yang_wrappers.c \
106 lib/printf/printf-pos.c \
107 lib/printf/vfprintf.c \
111 nodist_lib_libfrr_la_SOURCES = \
112 yang/frr-filter.yang.c \
113 yang/frr-interface.yang.c \
114 yang/frr-route-map.yang.c \
115 yang/frr-route-types.yang.c \
116 yang/frr-vrf.yang.c \
117 yang/frr-routing.yang.c \
118 yang/ietf/ietf-routing-types.yang.c \
119 yang/ietf/ietf-interfaces.yang.c \
120 yang/frr-module-translator.yang.c \
121 yang/frr-nexthop.yang.c \
122 yang/frr-igmp.yang.c \
126 $(top_srcdir)/lib/distribute.c \
127 $(top_srcdir)/lib/filter.c \
128 $(top_srcdir)/lib/if.c \
129 $(top_srcdir)/lib/if_rmap.c \
130 $(top_srcdir)/lib/keychain.c \
131 $(top_srcdir)/lib/lib_vty.c \
132 $(top_srcdir)/lib/nexthop_group.c \
133 $(top_srcdir)/lib/plist.c \
134 $(top_srcdir)/lib/routemap.c \
135 $(top_srcdir)/lib/routemap_cli.c \
136 $(top_srcdir)/lib/vrf.c \
137 $(top_srcdir)/lib/vty.c \
139 # can be loaded as DSO - always include for vtysh
140 vtysh_scan += $(top_srcdir)/lib/agentx.c
143 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
144 lib_libfrr_la_SOURCES += lib/db.c
147 lib/if_clippy.c: $(CLIPPY_DEPS)
148 lib/if.lo: lib/if_clippy.c
149 lib/plist_clippy.c: $(CLIPPY_DEPS)
150 lib/plist.lo: lib/plist_clippy.c
151 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
152 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
153 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
154 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
155 lib/routemap_cli_clippy.c: $(CLIPPY_DEPS)
156 lib/routemap_cli.lo: lib/routemap_cli_clippy.c
157 lib/vty_clippy.c: $(CLIPPY_DEPS)
158 lib/vty.lo: lib/vty_clippy.c
159 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
160 lib/log_vty.lo: lib/log_vty_clippy.c
162 pkginclude_HEADERS += \
171 lib/command_graph.h \
172 lib/command_match.h \
181 lib/freebsd-queue.h \
215 lib/nexthop_group.h \
216 lib/nexthop_group_private.h \
218 lib/northbound_cli.h \
219 lib/northbound_db.h \
221 lib/openbsd-queue.h \
243 lib/srcdest_table.h \
260 lib/yang_translator.h \
261 lib/yang_wrappers.h \
271 nodist_pkginclude_HEADERS += \
279 lib/printf/printfcommon.h \
280 lib/printf/printflocal.h \
283 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
284 # linking: If we're linking libfrr statically into daemons, we *must* remove
285 # libfrr from modules because modules will always link it in dynamically and
286 # thus 2 copies of libfrr will be loaded... hilarity ensues.
288 # Not linking libfrr into modules should generally work fine because the
289 # executable refers to libfrr either way and the dynamic linker should make
290 # libfrr available to modules. If some OS platform has a dynamic linker that
291 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
292 # it's not linked into daemons statically.
298 lib_LTLIBRARIES += lib/libfrrsnmp.la
301 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
302 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
303 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
304 lib_libfrrsnmp_la_SOURCES = \
313 lib_LTLIBRARIES += lib/libfrrcares.la
314 pkginclude_HEADERS += lib/resolver.h
317 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
318 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
319 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
320 lib_libfrrcares_la_SOURCES = \
328 lib_LTLIBRARIES += lib/libfrrzmq.la
329 pkginclude_HEADERS += lib/frr_zmq.h
332 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
333 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
334 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
335 lib_libfrrzmq_la_SOURCES = \
340 # Tail-f's ConfD support
343 module_LTLIBRARIES += lib/confd.la
346 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
347 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
348 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
349 lib_confd_la_SOURCES = lib/northbound_confd.c
355 module_LTLIBRARIES += lib/sysrepo.la
358 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
359 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
360 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
361 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
364 # gRPC northbound plugin
367 module_LTLIBRARIES += lib/grpc.la
370 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
371 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
372 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
373 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
379 lib/grammar_sandbox \
383 noinst_PROGRAMS += lib/clippy
387 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
391 lib_grammar_sandbox_SOURCES = \
392 lib/grammar_sandbox_main.c
393 lib_grammar_sandbox_LDADD = \
396 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
397 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
398 lib_clippy_LDADD = $(PYTHON_LIBS)
399 lib_clippy_LDFLAGS = -export-dynamic
400 lib_clippy_SOURCES = \
402 lib/command_graph.c \
404 lib/command_parse.y \
412 # (global) clippy rules for all directories
414 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
415 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
416 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
419 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
421 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
423 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
425 ## automake's "ylwrap" is a great piece of GNU software... not.
427 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
429 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
432 # generated sources & extra foo
436 lib/command_parse.h \
439 lib/route_types.txt \
447 ## force route_types.h
448 $(lib_clippy_OBJECTS): lib/route_types.h
449 $(lib_libfrr_la_OBJECTS): lib/route_types.h
451 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
453 lib/command_lex.h: lib/command_lex.c
454 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
455 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
456 lib/command_lex.lo: lib/command_parse.h
457 lib/command_parse.lo: lib/command_lex.h
458 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
459 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
460 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
461 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
463 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
464 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
465 DISTCLEANFILES += lib/route_types.h
468 # bit of a trick here to always have up-to-date git stamps without triggering
469 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
470 # but if we use that on gitversion.h it'll ripple through the .c file deps.
471 # (even if gitversion.h's file timestamp doesn't change, make will think it
472 # did, because of .PHONY...)
474 PHONY_GITVERSION=lib/gitversion.h.tmp
475 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
476 GITH=lib/gitversion.h
477 lib/gitversion.h.tmp: $(top_srcdir)/.git
478 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
479 lib/gitversion.h: lib/gitversion.h.tmp
480 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
483 PHONY_GITVERSION=lib/gitversion.h
487 .PHONY: $(PHONY_GITVERSION)