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