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