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)
8 lib_libfrr_la_SOURCES = \
29 lib/grammar_sandbox.c \
57 lib/northbound_cli.c \
93 lib/yang_translator.c \
99 nodist_lib_libfrr_la_SOURCES = \
100 yang/frr-interface.yang.c \
101 yang/frr-route-types.yang.c \
102 yang/frr-module-translator.yang.c \
106 $(top_srcdir)/lib/distribute.c \
107 $(top_srcdir)/lib/filter.c \
108 $(top_srcdir)/lib/if.c \
109 $(top_srcdir)/lib/if_rmap.c \
110 $(top_srcdir)/lib/keychain.c \
111 $(top_srcdir)/lib/logicalrouter.c \
112 $(top_srcdir)/lib/nexthop_group.c \
113 $(top_srcdir)/lib/plist.c \
114 $(top_srcdir)/lib/routemap.c \
115 $(top_srcdir)/lib/vrf.c \
116 $(top_srcdir)/lib/vty.c \
118 # can be loaded as DSO - always include for vtysh
119 vtysh_scan += $(top_srcdir)/lib/agentx.c
122 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
123 lib_libfrr_la_SOURCES += lib/db.c
126 lib/if_clippy.c: $(CLIPPY_DEPS)
127 lib/if.lo: lib/if_clippy.c
128 lib/plist_clippy.c: $(CLIPPY_DEPS)
129 lib/plist.lo: lib/plist_clippy.c
130 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
131 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
132 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
133 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
134 lib/vty_clippy.c: $(CLIPPY_DEPS)
135 lib/vty.lo: lib/vty_clippy.c
137 pkginclude_HEADERS += \
146 lib/command_graph.h \
147 lib/command_match.h \
155 lib/freebsd-queue.h \
185 lib/nexthop_group.h \
187 lib/northbound_cli.h \
188 lib/northbound_db.h \
190 lib/openbsd-queue.h \
211 lib/srcdest_table.h \
228 lib/yang_translator.h \
229 lib/yang_wrappers.h \
233 lib/logicalrouter.h \
238 nodist_pkginclude_HEADERS += \
249 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
250 # linking: If we're linking libfrr statically into daemons, we *must* remove
251 # libfrr from modules because modules will always link it in dynamically and
252 # thus 2 copies of libfrr will be loaded... hilarity ensues.
254 # Not linking libfrr into modules should generally work fine because the
255 # executable refers to libfrr either way and the dynamic linker should make
256 # libfrr available to modules. If some OS platform has a dynamic linker that
257 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
258 # it's not linked into daemons statically.
264 lib_LTLIBRARIES += lib/libfrrsnmp.la
267 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
268 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
269 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
270 lib_libfrrsnmp_la_SOURCES = \
279 lib_LTLIBRARIES += lib/libfrrzmq.la
280 pkginclude_HEADERS += lib/frr_zmq.h
283 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
284 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
285 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
286 lib_libfrrzmq_la_SOURCES = \
291 # Tail-f's ConfD support
294 module_LTLIBRARIES += lib/confd.la
297 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
298 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
299 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
300 lib_confd_la_SOURCES = lib/northbound_confd.c
306 module_LTLIBRARIES += lib/sysrepo.la
309 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
310 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
311 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
312 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
315 # gRPC northbound plugin
318 module_LTLIBRARIES += lib/grpc.la
321 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
322 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
323 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
324 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
330 lib/grammar_sandbox \
334 noinst_PROGRAMS += lib/clippy
336 $(HOSTTOOLS)lib/clippy:
337 @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
340 lib_grammar_sandbox_SOURCES = \
341 lib/grammar_sandbox_main.c
342 lib_grammar_sandbox_LDADD = \
345 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
346 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
347 lib_clippy_LDADD = $(PYTHON_LIBS)
348 lib_clippy_LDFLAGS = -export-dynamic
349 lib_clippy_SOURCES = \
351 lib/command_graph.c \
353 lib/command_parse.y \
361 # (global) clippy rules for all directories
363 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
364 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
365 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
368 CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
370 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
372 @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
373 $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
374 $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
376 ## automake's "ylwrap" is a great piece of GNU software... not.
378 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
380 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
383 # generated sources & extra foo
387 lib/command_parse.h \
390 lib/route_types.txt \
398 ## force route_types.h
399 $(lib_clippy_OBJECTS): lib/route_types.h
400 $(lib_libfrr_la_OBJECTS): lib/route_types.h
402 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
404 lib/command_lex.h: lib/command_lex.c
405 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
406 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
407 lib/command_lex.lo: lib/command_parse.h
408 lib/command_parse.lo: lib/command_lex.h
409 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
410 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
411 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
412 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
414 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
415 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
416 DISTCLEANFILES += lib/route_types.h
419 # bit of a trick here to always have up-to-date git stamps without triggering
420 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
421 # but if we use that on gitversion.h it'll ripple through the .c file deps.
422 # (even if gitversion.h's file timestamp doesn't change, make will think it
423 # did, because of .PHONY...)
425 PHONY_GITVERSION=lib/gitversion.h.tmp
426 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
427 GITH=lib/gitversion.h
428 lib/gitversion.h.tmp: $(top_srcdir)/.git
429 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
430 lib/gitversion.h: lib/gitversion.h.tmp
431 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
434 PHONY_GITVERSION=lib/gitversion.h
438 .PHONY: $(PHONY_GITVERSION)