]> git.proxmox.com Git - mirror_frr.git/blame - lib/subdir.am
*: add filter northbound support
[mirror_frr.git] / lib / subdir.am
CommitLineData
4a121f99
DL
1#
2# libfrr
3#
4lib_LTLIBRARIES += lib/libfrr.la
42efb0d4 5lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
2655e41f 6lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(LIBM)
4a121f99
DL
7
8lib_libfrr_la_SOURCES = \
8e1f6512 9 lib/agg_table.c \
bcea0c0f 10 lib/atomlist.c \
4a121f99
DL
11 lib/bfd.c \
12 lib/buffer.c \
13 lib/checksum.c \
14 lib/command.c \
15 lib/command_graph.c \
16 lib/command_lex.l \
17 lib/command_match.c \
18 lib/command_parse.y \
19 lib/csv.c \
aea03ad6 20 lib/debug.c \
96673e06 21 lib/defaults.c \
4a121f99 22 lib/distribute.c \
3155489a 23 lib/ferr.c \
4a121f99 24 lib/filter.c \
c2aab693 25 lib/filter_nb.c \
3e41733f 26 lib/frrcu.c \
5dbb0a7b 27 lib/frrlua.c \
4a121f99 28 lib/frr_pthread.c \
fe011935 29 lib/frrstr.c \
4a121f99
DL
30 lib/getopt.c \
31 lib/getopt1.c \
32 lib/grammar_sandbox.c \
33 lib/graph.c \
34 lib/hash.c \
35 lib/hook.c \
a94eca09 36 lib/id_alloc.c \
4a121f99
DL
37 lib/if.c \
38 lib/if_rmap.c \
39 lib/imsg-buffer.c \
40 lib/imsg.c \
41 lib/jhash.c \
42 lib/json.c \
43 lib/keychain.c \
b66d022e 44 lib/lib_errors.c \
1c0d8808 45 lib/lib_vty.c \
4a121f99
DL
46 lib/libfrr.c \
47 lib/linklist.c \
48 lib/log.c \
1c408628 49 lib/log_filter.c \
f73126c3 50 lib/log_vty.c \
4a121f99
DL
51 lib/md5.c \
52 lib/memory.c \
6edbb8b2 53 lib/mlag.c \
4a121f99 54 lib/module.c \
036fdaad 55 lib/mpls.c \
e496b420 56 lib/srv6.c \
4a121f99
DL
57 lib/network.c \
58 lib/nexthop.c \
e26aedbe
PG
59 lib/netns_linux.c \
60 lib/netns_other.c \
7ee30f28 61 lib/nexthop_group.c \
1c2facd1
RW
62 lib/northbound.c \
63 lib/northbound_cli.c \
64 lib/northbound_db.c \
e128c002 65 lib/ntop.c \
4a121f99
DL
66 lib/openbsd-tree.c \
67 lib/pid_output.c \
68 lib/plist.c \
4a121f99
DL
69 lib/prefix.c \
70 lib/privs.c \
71 lib/ptm_lib.c \
5c52c06c 72 lib/pullwr.c \
4a121f99 73 lib/qobj.c \
5318d896 74 lib/ringbuf.c \
4a121f99 75 lib/routemap.c \
2b3e4807 76 lib/routemap_cli.c \
686d244f 77 lib/routemap_northbound.c \
31bfa062 78 lib/sbuf.c \
440d5faa 79 lib/seqlock.c \
4a121f99
DL
80 lib/sha256.c \
81 lib/sigevent.c \
82 lib/skiplist.c \
83 lib/sockopt.c \
84 lib/sockunion.c \
85 lib/spf_backoff.c \
86 lib/srcdest_table.c \
87 lib/stream.c \
88 lib/strlcat.c \
89 lib/strlcpy.c \
90 lib/systemd.c \
91 lib/table.c \
92 lib/termtable.c \
93 lib/thread.c \
80911bc2 94 lib/typerb.c \
abd71baa 95 lib/typesafe.c \
4a121f99
DL
96 lib/vector.c \
97 lib/vrf.c \
98 lib/vty.c \
99 lib/wheel.c \
100 lib/workqueue.c \
1c2facd1
RW
101 lib/yang.c \
102 lib/yang_translator.c \
103 lib/yang_wrappers.c \
4a121f99 104 lib/zclient.c \
0bdeb5e5
DL
105 lib/zlog.c \
106 lib/zlog_targets.c \
5c25bd87
DL
107 lib/printf/printf-pos.c \
108 lib/printf/vfprintf.c \
109 lib/printf/glue.c \
4a121f99
DL
110 # end
111
3a11599c 112nodist_lib_libfrr_la_SOURCES = \
a513824c 113 yang/frr-filter.yang.c \
3a11599c 114 yang/frr-interface.yang.c \
686d244f 115 yang/frr-route-map.yang.c \
3a11599c 116 yang/frr-route-types.yang.c \
3a7262b6 117 yang/frr-vrf.yang.c \
8b043166 118 yang/frr-routing.yang.c \
e6a0538b 119 yang/ietf/ietf-routing-types.yang.c \
b0f502c5 120 yang/ietf/ietf-interfaces.yang.c \
3a11599c 121 yang/frr-module-translator.yang.c \
e7ecd0a6 122 yang/frr-nexthop.yang.c \
7fd139b5 123 yang/frr-igmp.yang.c \
da787004
SP
124 yang/frr-pim.yang.c \
125 yang/frr-pim-rp.yang.c \
3a11599c
DL
126 # end
127
74dc19a2 128vtysh_scan += \
2768748b
DL
129 lib/distribute.c \
130 lib/filter.c \
131 lib/if.c \
132 lib/if_rmap.c \
133 lib/keychain.c \
134 lib/lib_vty.c \
135 lib/nexthop_group.c \
136 lib/plist.c \
137 lib/routemap.c \
138 lib/routemap_cli.c \
139 lib/vrf.c \
140 lib/vty.c \
74dc19a2
DL
141 # end
142# can be loaded as DSO - always include for vtysh
2768748b 143vtysh_scan += lib/agentx.c
74dc19a2 144
1c2facd1 145if SQLITE3
fdbd8086 146lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
1c2facd1
RW
147lib_libfrr_la_SOURCES += lib/db.c
148endif
149
94cfb069
DL
150clippy_scan += \
151 lib/if.c \
152 lib/log_vty.c \
153 lib/nexthop_group.c \
154 lib/northbound_cli.c \
155 lib/plist.c \
156 lib/routemap_cli.c \
157 lib/vty.c \
158 # end
4a121f99
DL
159
160pkginclude_HEADERS += \
8e1f6512 161 lib/agg_table.h \
bcea0c0f 162 lib/atomlist.h \
4a121f99
DL
163 lib/bfd.h \
164 lib/bitfield.h \
165 lib/buffer.h \
166 lib/checksum.h \
14beb548 167 lib/mlag.h \
4a121f99
DL
168 lib/command.h \
169 lib/command_graph.h \
170 lib/command_match.h \
de1a880c 171 lib/compiler.h \
4a121f99 172 lib/csv.h \
1c2facd1 173 lib/db.h \
aea03ad6 174 lib/debug.h \
96673e06 175 lib/defaults.h \
4a121f99 176 lib/distribute.h \
3155489a 177 lib/ferr.h \
4a121f99 178 lib/filter.h \
cd85bc2e 179 lib/freebsd-queue.h \
5dbb0a7b 180 lib/frrlua.h \
4a121f99
DL
181 lib/frr_pthread.h \
182 lib/frratomic.h \
3e41733f 183 lib/frrcu.h \
fe011935 184 lib/frrstr.h \
4a121f99
DL
185 lib/getopt.h \
186 lib/graph.h \
187 lib/hash.h \
188 lib/hook.h \
17136bf2 189 lib/iana_afi.h \
a94eca09 190 lib/id_alloc.h \
4a121f99
DL
191 lib/if.h \
192 lib/if_rmap.h \
193 lib/imsg.h \
194 lib/ipaddr.h \
195 lib/jhash.h \
196 lib/json.h \
197 lib/keychain.h \
b66d022e 198 lib/lib_errors.h \
1c0d8808 199 lib/lib_vty.h \
4a121f99
DL
200 lib/libfrr.h \
201 lib/libospf.h \
202 lib/linklist.h \
203 lib/log.h \
f73126c3 204 lib/log_vty.h \
4a121f99
DL
205 lib/md5.h \
206 lib/memory.h \
4a121f99
DL
207 lib/module.h \
208 lib/monotime.h \
209 lib/mpls.h \
e496b420 210 lib/srv6.h \
4a121f99
DL
211 lib/network.h \
212 lib/nexthop.h \
7ee30f28 213 lib/nexthop_group.h \
50d89650 214 lib/nexthop_group_private.h \
1c2facd1
RW
215 lib/northbound.h \
216 lib/northbound_cli.h \
217 lib/northbound_db.h \
4a121f99
DL
218 lib/ns.h \
219 lib/openbsd-queue.h \
220 lib/openbsd-tree.h \
221 lib/plist.h \
4a121f99 222 lib/prefix.h \
5c25bd87 223 lib/printfrr.h \
4a121f99
DL
224 lib/privs.h \
225 lib/ptm_lib.h \
5c52c06c 226 lib/pullwr.h \
6833ae01 227 lib/pw.h \
4a121f99 228 lib/qobj.h \
cd85bc2e 229 lib/queue.h \
5318d896 230 lib/ringbuf.h \
4a121f99 231 lib/routemap.h \
31bfa062 232 lib/sbuf.h \
440d5faa 233 lib/seqlock.h \
4a121f99
DL
234 lib/sha256.h \
235 lib/sigevent.h \
236 lib/skiplist.h \
98ea5be8 237 lib/smux.h \
4a121f99
DL
238 lib/sockopt.h \
239 lib/sockunion.h \
240 lib/spf_backoff.h \
241 lib/srcdest_table.h \
242 lib/stream.h \
243 lib/systemd.h \
244 lib/table.h \
245 lib/termtable.h \
246 lib/thread.h \
80911bc2 247 lib/typerb.h \
abd71baa 248 lib/typesafe.h \
4a121f99 249 lib/vector.h \
4a121f99
DL
250 lib/vlan.h \
251 lib/vrf.h \
252 lib/vrf_int.h \
253 lib/vty.h \
254 lib/vxlan.h \
255 lib/wheel.h \
256 lib/workqueue.h \
1c2facd1
RW
257 lib/yang.h \
258 lib/yang_translator.h \
259 lib/yang_wrappers.h \
4a121f99
DL
260 lib/zassert.h \
261 lib/zclient.h \
262 lib/zebra.h \
0bdeb5e5
DL
263 lib/zlog.h \
264 lib/zlog_targets.h \
0031a6bb 265 lib/pbr.h \
4a121f99
DL
266 # end
267
58f8a9ec 268
70d27c5b
DL
269nodist_pkginclude_HEADERS += \
270 lib/route_types.h \
271 lib/version.h \
272 # end
273
4a121f99
DL
274noinst_HEADERS += \
275 lib/clippy.h \
4a121f99 276 lib/plist_int.h \
5c25bd87
DL
277 lib/printf/printfcommon.h \
278 lib/printf/printflocal.h \
4a121f99
DL
279 #end
280
d6e76257
DL
281# General note about module and module helper library (libfrrsnmp, libfrrzmq)
282# linking: If we're linking libfrr statically into daemons, we *must* remove
283# libfrr from modules because modules will always link it in dynamically and
284# thus 2 copies of libfrr will be loaded... hilarity ensues.
285#
286# Not linking libfrr into modules should generally work fine because the
287# executable refers to libfrr either way and the dynamic linker should make
288# libfrr available to modules. If some OS platform has a dynamic linker that
289# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
290# it's not linked into daemons statically.
291
4a121f99
DL
292#
293# SNMP support
294#
295if SNMP
296lib_LTLIBRARIES += lib/libfrrsnmp.la
297endif
298
7aad1594 299lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
4a121f99 300lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
d6e76257 301lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
4a121f99
DL
302lib_libfrrsnmp_la_SOURCES = \
303 lib/agentx.c \
4a121f99
DL
304 lib/snmp.c \
305 # end
306
fe9e7b71
DL
307#
308# c-ares support
309#
310if CARES
311lib_LTLIBRARIES += lib/libfrrcares.la
312pkginclude_HEADERS += lib/resolver.h
313endif
314
315lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
316lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
317lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
318lib_libfrrcares_la_SOURCES = \
319 lib/resolver.c \
320 #end
321
b6116506
DL
322#
323# ZeroMQ support
324#
325if ZEROMQ
326lib_LTLIBRARIES += lib/libfrrzmq.la
327pkginclude_HEADERS += lib/frr_zmq.h
328endif
329
330lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
331lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
d6e76257 332lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
b6116506
DL
333lib_libfrrzmq_la_SOURCES = \
334 lib/frr_zmq.c \
335 #end
336
5bce33b3
RW
337#
338# Tail-f's ConfD support
339#
340if CONFD
341module_LTLIBRARIES += lib/confd.la
342endif
343
344lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
345lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
fdbd8086 346lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
5bce33b3
RW
347lib_confd_la_SOURCES = lib/northbound_confd.c
348
a7ca2199
RW
349#
350# Sysrepo support
351#
352if SYSREPO
353module_LTLIBRARIES += lib/sysrepo.la
354endif
355
fdbd8086 356lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
a7ca2199 357lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
fdbd8086 358lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
a7ca2199
RW
359lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
360
ec2ac5f2
RW
361#
362# gRPC northbound plugin
363#
364if GRPC
365module_LTLIBRARIES += lib/grpc.la
366endif
367
368lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
369lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
370lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
371lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
372
4a121f99
DL
373#
374# CLI utilities
375#
376noinst_PROGRAMS += \
4a121f99
DL
377 lib/grammar_sandbox \
378 # end
379
89727c8d
DL
380if BUILD_CLIPPY
381noinst_PROGRAMS += lib/clippy
382else
a71c5039
DL
383if HOSTTOOLS_CLIPPY
384$(CLIPPY):
385 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
386endif
89727c8d
DL
387endif
388
4a121f99
DL
389lib_grammar_sandbox_SOURCES = \
390 lib/grammar_sandbox_main.c
391lib_grammar_sandbox_LDADD = \
392 lib/libfrr.la
393
dbac691d
DL
394lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
395lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
4a121f99 396lib_clippy_LDADD = $(PYTHON_LIBS)
dbac691d 397lib_clippy_LDFLAGS = -export-dynamic
4a121f99
DL
398lib_clippy_SOURCES = \
399 lib/clippy.c \
400 lib/command_graph.c \
401 lib/command_lex.l \
402 lib/command_parse.y \
403 lib/command_py.c \
404 lib/defun_lex.l \
405 lib/graph.c \
406 lib/memory.c \
407 lib/vector.c \
408 # end
409
aad24c5b
DL
410# (global) clippy rules for all directories
411
412AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
413am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
414am__v_CLIPPY_0 = @echo " CLIPPY " $@;
415am__v_CLIPPY_1 =
416
a71c5039 417CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
aad24c5b 418
8fb40377 419SUFFIXES += _clippy.c
aad24c5b 420.c_clippy.c:
a71c5039 421 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
aad24c5b
DL
422
423## automake's "ylwrap" is a great piece of GNU software... not.
424.l.c:
425 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
426.y.c:
427 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
4a121f99
DL
428
429#
430# generated sources & extra foo
431#
432EXTRA_DIST += \
433 lib/command_lex.h \
70d27c5b 434 lib/command_parse.h \
4a121f99 435 lib/gitversion.pl \
4a121f99
DL
436 lib/route_types.pl \
437 lib/route_types.txt \
438 # end
439
440BUILT_SOURCES += \
4a121f99
DL
441 lib/gitversion.h \
442 lib/route_types.h \
443 # end
444
f1b32b2e
DL
445## force route_types.h
446$(lib_clippy_OBJECTS): lib/route_types.h
447$(lib_libfrr_la_OBJECTS): lib/route_types.h
448
4a121f99
DL
449AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
450
451lib/command_lex.h: lib/command_lex.c
452 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
453 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
f1b32b2e 454lib/command_lex.lo: lib/command_parse.h
4a121f99 455lib/command_parse.lo: lib/command_lex.h
fdbd8086
DL
456lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
457lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
f1b32b2e 458lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
4a121f99
DL
459lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
460
461lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
fdbd8086 462 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
67cf020d 463DISTCLEANFILES += lib/route_types.h
4a121f99
DL
464
465if GIT_VERSION
466# bit of a trick here to always have up-to-date git stamps without triggering
467# unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
468# but if we use that on gitversion.h it'll ripple through the .c file deps.
469# (even if gitversion.h's file timestamp doesn't change, make will think it
470# did, because of .PHONY...)
471
9e53b315 472PHONY_GITVERSION=lib/gitversion.h.tmp
4a121f99
DL
473.SILENT: lib/gitversion.h lib/gitversion.h.tmp
474GITH=lib/gitversion.h
475lib/gitversion.h.tmp: $(top_srcdir)/.git
fdbd8086 476 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
4a121f99 477lib/gitversion.h: lib/gitversion.h.tmp
bd402424 478 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
4a121f99
DL
479
480else
9e53b315 481PHONY_GITVERSION=lib/gitversion.h
4a121f99
DL
482lib/gitversion.h:
483 true
484endif
9e53b315 485.PHONY: $(PHONY_GITVERSION)