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)
8 lib_libfrr_la_SOURCES = \
28 lib/grammar_sandbox.c \
89 $(top_srcdir)/lib/distribute.c \
90 $(top_srcdir)/lib/filter.c \
91 $(top_srcdir)/lib/if.c \
92 $(top_srcdir)/lib/if_rmap.c \
93 $(top_srcdir)/lib/keychain.c \
94 $(top_srcdir)/lib/logicalrouter.c \
95 $(top_srcdir)/lib/nexthop_group.c \
96 $(top_srcdir)/lib/plist.c \
97 $(top_srcdir)/lib/routemap.c \
98 $(top_srcdir)/lib/vrf.c \
99 $(top_srcdir)/lib/vty.c \
101 # can be loaded as DSO - always include for vtysh
102 vtysh_scan += $(top_srcdir)/lib/agentx.c
104 lib/plist_clippy.c: $(CLIPPY_DEPS)
105 lib/plist.lo: lib/plist_clippy.c
106 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
107 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
109 pkginclude_HEADERS += \
116 lib/command_graph.h \
117 lib/command_match.h \
122 lib/event_counter.h \
126 lib/freebsd-queue.h \
154 lib/nexthop_group.h \
156 lib/openbsd-queue.h \
176 lib/srcdest_table.h \
193 lib/logicalrouter.h \
199 nodist_pkginclude_HEADERS += \
210 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
211 # linking: If we're linking libfrr statically into daemons, we *must* remove
212 # libfrr from modules because modules will always link it in dynamically and
213 # thus 2 copies of libfrr will be loaded... hilarity ensues.
215 # Not linking libfrr into modules should generally work fine because the
216 # executable refers to libfrr either way and the dynamic linker should make
217 # libfrr available to modules. If some OS platform has a dynamic linker that
218 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
219 # it's not linked into daemons statically.
225 lib_LTLIBRARIES += lib/libfrrsnmp.la
228 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
229 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
230 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
231 lib_libfrrsnmp_la_SOURCES = \
240 lib_LTLIBRARIES += lib/libfrrzmq.la
241 pkginclude_HEADERS += lib/frr_zmq.h
244 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
245 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
246 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
247 lib_libfrrzmq_la_SOURCES = \
255 lib/grammar_sandbox \
259 noinst_PROGRAMS += lib/clippy
261 $(HOSTTOOLS)lib/clippy:
262 @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
265 lib_grammar_sandbox_SOURCES = \
266 lib/grammar_sandbox_main.c
267 lib_grammar_sandbox_LDADD = \
270 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
271 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
272 lib_clippy_LDADD = $(PYTHON_LIBS)
273 lib_clippy_LDFLAGS = -export-dynamic
274 lib_clippy_SOURCES = \
276 lib/command_graph.c \
278 lib/command_parse.y \
286 # (global) clippy rules for all directories
288 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
289 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
290 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
293 CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
295 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h
297 @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
298 $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
299 $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
301 ## automake's "ylwrap" is a great piece of GNU software... not.
303 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
305 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
308 # generated sources & extra foo
312 lib/command_parse.h \
315 lib/route_types.txt \
323 ## force route_types.h
324 $(lib_clippy_OBJECTS): lib/route_types.h
325 $(lib_libfrr_la_OBJECTS): lib/route_types.h
327 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
329 lib/command_lex.h: lib/command_lex.c
330 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
331 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
332 lib/command_lex.lo: lib/command_parse.h
333 lib/command_parse.lo: lib/command_lex.h
334 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
335 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
337 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
338 @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
339 DISTCLEANFILES += lib/route_types.h
342 # bit of a trick here to always have up-to-date git stamps without triggering
343 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
344 # but if we use that on gitversion.h it'll ripple through the .c file deps.
345 # (even if gitversion.h's file timestamp doesn't change, make will think it
346 # did, because of .PHONY...)
348 PHONY_GITVERSION=lib/gitversion.h.tmp
349 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
350 GITH=lib/gitversion.h
351 lib/gitversion.h.tmp: $(top_srcdir)/.git
352 @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
353 lib/gitversion.h: lib/gitversion.h.tmp
354 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
357 PHONY_GITVERSION=lib/gitversion.h
361 .PHONY: $(PHONY_GITVERSION)