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) -lyang
8 lib_libfrr_la_SOURCES = \
28 lib/grammar_sandbox.c \
55 lib/northbound_cli.c \
88 lib/yang_translator.c \
95 nodist_lib_libfrr_la_SOURCES = \
96 yang/frr-interface.yang.c \
97 yang/frr-route-types.yang.c \
98 yang/frr-module-translator.yang.c \
102 $(top_srcdir)/lib/distribute.c \
103 $(top_srcdir)/lib/filter.c \
104 $(top_srcdir)/lib/if.c \
105 $(top_srcdir)/lib/if_rmap.c \
106 $(top_srcdir)/lib/keychain.c \
107 $(top_srcdir)/lib/logicalrouter.c \
108 $(top_srcdir)/lib/nexthop_group.c \
109 $(top_srcdir)/lib/plist.c \
110 $(top_srcdir)/lib/routemap.c \
111 $(top_srcdir)/lib/vrf.c \
112 $(top_srcdir)/lib/vty.c \
114 # can be loaded as DSO - always include for vtysh
115 vtysh_scan += $(top_srcdir)/lib/agentx.c
118 lib_libfrr_la_LIBADD += -lsqlite3
119 lib_libfrr_la_SOURCES += lib/db.c
122 lib/if_clippy.c: $(CLIPPY_DEPS)
123 lib/if.lo: lib/if_clippy.c
124 lib/plist_clippy.c: $(CLIPPY_DEPS)
125 lib/plist.lo: lib/plist_clippy.c
126 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
127 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
128 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
129 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
131 pkginclude_HEADERS += \
138 lib/command_graph.h \
139 lib/command_match.h \
145 lib/event_counter.h \
149 lib/freebsd-queue.h \
178 lib/nexthop_group.h \
180 lib/northbound_cli.h \
181 lib/northbound_db.h \
183 lib/openbsd-queue.h \
203 lib/srcdest_table.h \
218 lib/yang_translator.h \
219 lib/yang_wrappers.h \
223 lib/logicalrouter.h \
229 nodist_pkginclude_HEADERS += \
240 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
241 # linking: If we're linking libfrr statically into daemons, we *must* remove
242 # libfrr from modules because modules will always link it in dynamically and
243 # thus 2 copies of libfrr will be loaded... hilarity ensues.
245 # Not linking libfrr into modules should generally work fine because the
246 # executable refers to libfrr either way and the dynamic linker should make
247 # libfrr available to modules. If some OS platform has a dynamic linker that
248 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
249 # it's not linked into daemons statically.
255 lib_LTLIBRARIES += lib/libfrrsnmp.la
258 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
259 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
260 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
261 lib_libfrrsnmp_la_SOURCES = \
270 lib_LTLIBRARIES += lib/libfrrzmq.la
271 pkginclude_HEADERS += lib/frr_zmq.h
274 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
275 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
276 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
277 lib_libfrrzmq_la_SOURCES = \
282 # Tail-f's ConfD support
285 module_LTLIBRARIES += lib/confd.la
288 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
289 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
290 lib_confd_la_LIBADD = lib/libfrr.la -lconfd
291 lib_confd_la_SOURCES = lib/northbound_confd.c
297 module_LTLIBRARIES += lib/sysrepo.la
300 lib_sysrepo_la_CFLAGS = $(WERROR)
301 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
302 lib_sysrepo_la_LIBADD = lib/libfrr.la -lsysrepo
303 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
309 lib/grammar_sandbox \
313 noinst_PROGRAMS += lib/clippy
315 $(HOSTTOOLS)lib/clippy:
316 @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
319 lib_grammar_sandbox_SOURCES = \
320 lib/grammar_sandbox_main.c
321 lib_grammar_sandbox_LDADD = \
324 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
325 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
326 lib_clippy_LDADD = $(PYTHON_LIBS)
327 lib_clippy_LDFLAGS = -export-dynamic
328 lib_clippy_SOURCES = \
330 lib/command_graph.c \
332 lib/command_parse.y \
340 # (global) clippy rules for all directories
342 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
343 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
344 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
347 CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
349 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h
351 @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
352 $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
353 $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
355 ## automake's "ylwrap" is a great piece of GNU software... not.
357 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
359 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
362 # generated sources & extra foo
366 lib/command_parse.h \
369 lib/route_types.txt \
377 ## force route_types.h
378 $(lib_clippy_OBJECTS): lib/route_types.h
379 $(lib_libfrr_la_OBJECTS): lib/route_types.h
381 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
383 lib/command_lex.h: lib/command_lex.c
384 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
385 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
386 lib/command_lex.lo: lib/command_parse.h
387 lib/command_parse.lo: lib/command_lex.h
388 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
389 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
391 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
392 @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
393 DISTCLEANFILES += lib/route_types.h
396 # bit of a trick here to always have up-to-date git stamps without triggering
397 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
398 # but if we use that on gitversion.h it'll ripple through the .c file deps.
399 # (even if gitversion.h's file timestamp doesn't change, make will think it
400 # did, because of .PHONY...)
402 PHONY_GITVERSION=lib/gitversion.h.tmp
403 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
404 GITH=lib/gitversion.h
405 lib/gitversion.h.tmp: $(top_srcdir)/.git
406 @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
407 lib/gitversion.h: lib/gitversion.h.tmp
408 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
411 PHONY_GITVERSION=lib/gitversion.h
415 .PHONY: $(PHONY_GITVERSION)