5 lib_LTLIBRARIES += lib/libfrr.la
6 lib_libfrr_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0 -Xlinker -e_libfrr_version
7 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBCRYPT) $(LIBDL) $(LIBM)
9 lib_libfrr_la_SOURCES = \
26 lib/explicit_bzero.c \
38 lib/grammar_sandbox.c \
72 lib/northbound_cli.c \
86 lib/routemap_northbound.c \
113 lib/yang_translator.c \
114 lib/yang_wrappers.c \
118 lib/zlog_5424_cli.c \
121 lib/printf/printf-pos.c \
122 lib/printf/vfprintf.c \
125 lib/routing_nb_config.c \
129 nodist_lib_libfrr_la_SOURCES = \
130 yang/frr-filter.yang.c \
131 yang/frr-interface.yang.c \
132 yang/frr-route-map.yang.c \
133 yang/frr-route-types.yang.c \
134 yang/frr-vrf.yang.c \
135 yang/frr-routing.yang.c \
136 yang/frr-nexthop.yang.c \
137 yang/ietf/ietf-routing-types.yang.c \
138 yang/ietf/ietf-interfaces.yang.c \
139 yang/ietf/ietf-bgp-types.yang.c \
140 yang/frr-module-translator.yang.c \
144 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
145 lib_libfrr_la_SOURCES += lib/db.c
152 lib/nexthop_group.c \
153 lib/northbound_cli.c \
158 lib/zlog_5424_cli.c \
161 pkginclude_HEADERS += \
171 lib/command_graph.h \
172 lib/command_match.h \
182 lib/freebsd-queue.h \
220 lib/nexthop_group.h \
221 lib/nexthop_group_private.h \
223 lib/northbound_cli.h \
224 lib/northbound_db.h \
226 lib/openbsd-queue.h \
250 lib/srcdest_table.h \
270 lib/yang_translator.h \
271 lib/yang_wrappers.h \
282 lib/assert/assert.h \
286 nodist_pkginclude_HEADERS += \
294 lib/printf/printfcommon.h \
295 lib/printf/printflocal.h \
298 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
299 # linking: If we're linking libfrr statically into daemons, we *must* remove
300 # libfrr from modules because modules will always link it in dynamically and
301 # thus 2 copies of libfrr will be loaded... hilarity ensues.
303 # Not linking libfrr into modules should generally work fine because the
304 # executable refers to libfrr either way and the dynamic linker should make
305 # libfrr available to modules. If some OS platform has a dynamic linker that
306 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
307 # it's not linked into daemons statically.
313 lib_LTLIBRARIES += lib/libfrrsnmp.la
316 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
317 lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
318 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
319 lib_libfrrsnmp_la_SOURCES = \
329 lib_LTLIBRARIES += lib/libfrrcares.la
330 pkginclude_HEADERS += lib/resolver.h
333 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
334 lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
335 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
336 lib_libfrrcares_la_SOURCES = \
344 lib_LTLIBRARIES += lib/libfrrzmq.la
345 pkginclude_HEADERS += lib/frr_zmq.h
348 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
349 lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
350 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
351 lib_libfrrzmq_la_SOURCES = \
356 # Tail-f's ConfD support
359 module_LTLIBRARIES += lib/confd.la
362 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
363 lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
364 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
365 lib_confd_la_SOURCES = lib/northbound_confd.c
371 module_LTLIBRARIES += lib/sysrepo.la
374 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
375 lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
376 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
377 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
380 # gRPC northbound plugin
383 module_LTLIBRARIES += lib/grpc.la
386 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
387 lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
388 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
389 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
395 lib/grammar_sandbox \
399 noinst_PROGRAMS += lib/clippy
403 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
407 lib_grammar_sandbox_SOURCES = \
408 lib/grammar_sandbox_main.c
409 lib_grammar_sandbox_LDADD = \
412 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
413 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
414 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
415 # no $(SAN_FLAGS) here
416 lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
417 lib_clippy_SOURCES = \
420 lib/command_graph.c \
422 lib/command_parse.y \
433 # (global) clippy rules for all directories
435 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
436 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
437 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
440 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
442 SUFFIXES += _clippy.c
444 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
446 # xrelfo, the ELF xref extractor
448 AM_V_XRELFO = $(am__v_XRELFO_$(V))
449 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
450 am__v_XRELFO_0 = @echo " XRELFO " $@;
453 XRELFO_FLAGS = -Wlog-format -Wlog-args
457 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
459 # dependencies added in python/makefile.py
461 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
465 -rm -rf $(xrefs) frr.xref
466 clean-local: clean-xref
468 CLEANFILES += vtysh/vtysh_cmd.c
469 vtysh/vtysh_cmd.c: frr.xref
470 @test -f $@ || rm -f frr.xref || true
471 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
473 ## automake's "ylwrap" is a great piece of GNU software... not.
475 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
477 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
480 # generated sources & extra foo
484 lib/command_parse.h \
487 lib/route_types.txt \
495 ## force route_types.h
496 $(lib_clippy_OBJECTS): lib/route_types.h
497 $(lib_libfrr_la_OBJECTS): lib/route_types.h
499 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
501 lib/command_lex.h: lib/command_lex.c
502 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
503 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
504 lib/command_lex.lo: lib/command_parse.h
505 lib/command_parse.lo: lib/command_lex.h
506 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
507 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
508 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
509 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
511 DISTCLEANFILES += lib/command_lex.h \
513 lib/command_parse.h \
519 rt_enabled += --enabled babeld
522 rt_enabled += --enabled bfdd
525 rt_enabled += --enabled bgpd
527 rt_enabled += --enabled bgpd-vnc
531 rt_enabled += --enabled eigrpd
534 rt_enabled += --enabled isisd
537 rt_enabled += --enabled fabricd
540 rt_enabled += --enabled ldpd
543 rt_enabled += --enabled nhrpd
546 rt_enabled += --enabled ospfd
549 rt_enabled += --enabled ospf6d
552 rt_enabled += --enabled pbrd
555 rt_enabled += --enabled pimd
558 rt_enabled += --enabled ripd
561 rt_enabled += --enabled ripngd
564 rt_enabled += --enabled sharpd
567 rt_enabled += --enabled zebra
570 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
571 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
572 DISTCLEANFILES += lib/route_types.h
575 # bit of a trick here to always have up-to-date git stamps without triggering
576 # unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
577 # but if we use that on gitversion.h it'll ripple through the .c file deps.
578 # (even if gitversion.h's file timestamp doesn't change, make will think it
579 # did, because of .PHONY...)
581 PHONY_GITVERSION=lib/gitversion.h.tmp
582 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
583 GITH=lib/gitversion.h
584 lib/gitversion.h.tmp: $(top_srcdir)/.git
585 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
586 lib/gitversion.h: lib/gitversion.h.tmp
587 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
590 PHONY_GITVERSION=lib/gitversion.h
594 .PHONY: $(PHONY_GITVERSION)