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