]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/subdir.am
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / subdir.am
index d5284e3f813f8fb048fe6ef4fb422980a9c4fe53..43b39100cb3a701675bf540109f9d08db75fee8f 100644 (file)
@@ -2,8 +2,8 @@
 # libfrr
 #
 lib_LTLIBRARIES += lib/libfrr.la
-lib_libfrr_la_LDFLAGS = -version-info 0:0:0
-lib_libfrr_la_LIBADD = @LIBCAP@
+lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
+lib_libfrr_la_LIBADD = @LIBCAP@ $(UNWIND_LIBS) -lyang
 
 lib_libfrr_la_SOURCES = \
        lib/agg_table.c \
@@ -29,6 +29,7 @@ lib_libfrr_la_SOURCES = \
        lib/graph.c \
        lib/hash.c \
        lib/hook.c \
+       lib/id_alloc.c \
        lib/if.c \
        lib/if_rmap.c \
        lib/imsg-buffer.c \
@@ -50,6 +51,9 @@ lib_libfrr_la_SOURCES = \
        lib/netns_linux.c \
        lib/netns_other.c \
        lib/nexthop_group.c \
+       lib/northbound.c \
+       lib/northbound_cli.c \
+       lib/northbound_db.c \
        lib/openbsd-tree.c \
        lib/pid_output.c \
        lib/plist.c \
@@ -80,14 +84,49 @@ lib_libfrr_la_SOURCES = \
        lib/vty.c \
        lib/wheel.c \
        lib/workqueue.c \
+       lib/yang.c \
+       lib/yang_translator.c \
+       lib/yang_wrappers.c \
        lib/zclient.c \
        lib/logicalrouter.c \
+       lib/lua.c \
        # end
 
+nodist_lib_libfrr_la_SOURCES = \
+       yang/frr-interface.yang.c \
+       yang/frr-route-types.yang.c \
+       yang/frr-module-translator.yang.c \
+       # end
+
+vtysh_scan += \
+       $(top_srcdir)/lib/distribute.c \
+       $(top_srcdir)/lib/filter.c \
+       $(top_srcdir)/lib/if.c \
+       $(top_srcdir)/lib/if_rmap.c \
+       $(top_srcdir)/lib/keychain.c \
+       $(top_srcdir)/lib/logicalrouter.c \
+       $(top_srcdir)/lib/nexthop_group.c \
+       $(top_srcdir)/lib/plist.c \
+       $(top_srcdir)/lib/routemap.c \
+       $(top_srcdir)/lib/vrf.c \
+       $(top_srcdir)/lib/vty.c \
+       # end
+# can be loaded as DSO - always include for vtysh
+vtysh_scan += $(top_srcdir)/lib/agentx.c
+
+if SQLITE3
+lib_libfrr_la_LIBADD += -lsqlite3
+lib_libfrr_la_SOURCES += lib/db.c
+endif
+
+lib/if_clippy.c: $(CLIPPY_DEPS)
+lib/if.lo: lib/if_clippy.c
 lib/plist_clippy.c: $(CLIPPY_DEPS)
 lib/plist.lo: lib/plist_clippy.c
 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
+lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
+lib/northbound_cli.lo: lib/northbound_cli_clippy.c
 
 pkginclude_HEADERS += \
        lib/agg_table.h \
@@ -100,6 +139,7 @@ pkginclude_HEADERS += \
        lib/command_match.h \
        lib/compiler.h \
        lib/csv.h \
+       lib/db.h \
        lib/debug.h \
        lib/distribute.h \
        lib/event_counter.h \
@@ -114,6 +154,7 @@ pkginclude_HEADERS += \
        lib/graph.h \
        lib/hash.h \
        lib/hook.h \
+       lib/id_alloc.h \
        lib/if.h \
        lib/if_rmap.h \
        lib/imsg.h \
@@ -135,6 +176,9 @@ pkginclude_HEADERS += \
        lib/network.h \
        lib/nexthop.h \
        lib/nexthop_group.h \
+       lib/northbound.h \
+       lib/northbound_cli.h \
+       lib/northbound_db.h \
        lib/ns.h \
        lib/openbsd-queue.h \
        lib/openbsd-tree.h \
@@ -152,6 +196,7 @@ pkginclude_HEADERS += \
        lib/sha256.h \
        lib/sigevent.h \
        lib/skiplist.h \
+       lib/smux.h \
        lib/sockopt.h \
        lib/sockunion.h \
        lib/spf_backoff.h \
@@ -169,10 +214,14 @@ pkginclude_HEADERS += \
        lib/vxlan.h \
        lib/wheel.h \
        lib/workqueue.h \
+       lib/yang.h \
+       lib/yang_translator.h \
+       lib/yang_wrappers.h \
        lib/zassert.h \
        lib/zclient.h \
        lib/zebra.h \
        lib/logicalrouter.h \
+       lib/lua.h \
        lib/pbr.h \
        # end
 
@@ -188,6 +237,17 @@ noinst_HEADERS += \
        lib/plist_int.h \
        #end
 
+# General note about module and module helper library (libfrrsnmp, libfrrzmq)
+# linking:  If we're linking libfrr statically into daemons, we *must* remove
+# libfrr from modules because modules will always link it in dynamically and
+# thus 2 copies of libfrr will be loaded... hilarity ensues.
+#
+# Not linking libfrr into modules should generally work fine because the
+# executable refers to libfrr either way and the dynamic linker should make
+# libfrr available to modules.  If some OS platform has a dynamic linker that
+# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
+# it's not linked into daemons statically.
+
 #
 # SNMP support
 #
@@ -197,7 +257,7 @@ endif
 
 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
-lib_libfrrsnmp_la_LIBADD = lib/libfrr.la $(SNMP_LIBS)
+lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
 lib_libfrrsnmp_la_SOURCES = \
        lib/agentx.c \
        lib/snmp.c \
@@ -213,11 +273,35 @@ endif
 
 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
-lib_libfrrzmq_la_LIBADD = lib/libfrr.la $(ZEROMQ_LIBS)
+lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
 lib_libfrrzmq_la_SOURCES = \
        lib/frr_zmq.c \
        #end
 
+#
+# Tail-f's ConfD support
+#
+if CONFD
+module_LTLIBRARIES += lib/confd.la
+endif
+
+lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
+lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+lib_confd_la_LIBADD = lib/libfrr.la -lconfd
+lib_confd_la_SOURCES = lib/northbound_confd.c
+
+#
+# Sysrepo support
+#
+if SYSREPO
+module_LTLIBRARIES += lib/sysrepo.la
+endif
+
+lib_sysrepo_la_CFLAGS = $(WERROR)
+lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+lib_sysrepo_la_LIBADD = lib/libfrr.la -lsysrepo
+lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
+
 #
 # CLI utilities
 #
@@ -237,9 +321,10 @@ lib_grammar_sandbox_SOURCES = \
 lib_grammar_sandbox_LDADD = \
        lib/libfrr.la
 
-lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY @SAN_CLIPPY_FLAGS@
-lib_clippy_CFLAGS = $(PYTHON_CFLAGS) @SAN_CLIPPY_FLAGS@
+lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
+lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
 lib_clippy_LDADD = $(PYTHON_LIBS)
+lib_clippy_LDFLAGS = -export-dynamic
 lib_clippy_SOURCES = \
        lib/clippy.c \
        lib/command_graph.c \
@@ -252,6 +337,26 @@ lib_clippy_SOURCES = \
        lib/vector.c \
        # end
 
+# (global) clippy rules for all directories
+
+AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
+am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
+am__v_CLIPPY_0 = @echo "  CLIPPY  " $@;
+am__v_CLIPPY_1 =
+
+CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
+
+SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h
+.c_clippy.c:
+       @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
+               $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
+       $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
+
+## automake's "ylwrap" is a great piece of GNU software... not.
+.l.c:
+       $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
+.y.c:
+       $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
 
 #
 # generated sources & extra foo
@@ -285,6 +390,7 @@ lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
 
 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
        @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
+DISTCLEANFILES += lib/route_types.h
 
 if GIT_VERSION
 # bit of a trick here to always have up-to-date git stamps without triggering
@@ -293,7 +399,7 @@ if GIT_VERSION
 # (even if gitversion.h's file timestamp doesn't change, make will think it
 # did, because of .PHONY...)
 
-.PHONY: lib/gitversion.h.tmp
+PHONY_GITVERSION=lib/gitversion.h.tmp
 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
 GITH=lib/gitversion.h
 lib/gitversion.h.tmp: $(top_srcdir)/.git
@@ -302,7 +408,8 @@ lib/gitversion.h: lib/gitversion.h.tmp
        { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
 
 else
-.PHONY: lib/gitversion.h
+PHONY_GITVERSION=lib/gitversion.h
 lib/gitversion.h:
        true
 endif
+.PHONY: $(PHONY_GITVERSION)