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