]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #6263 from opensourcerouting/zlog-coverity-20200420
[mirror_frr.git] / lib / subdir.am
1 #
2 # libfrr
3 #
4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
6 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(LIBM)
7
8 lib_libfrr_la_SOURCES = \
9 lib/agg_table.c \
10 lib/atomlist.c \
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 \
20 lib/debug.c \
21 lib/defaults.c \
22 lib/distribute.c \
23 lib/ferr.c \
24 lib/filter.c \
25 lib/frrcu.c \
26 lib/frrlua.c \
27 lib/frr_pthread.c \
28 lib/frrstr.c \
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 \
35 lib/id_alloc.c \
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 \
43 lib/lib_errors.c \
44 lib/lib_vty.c \
45 lib/libfrr.c \
46 lib/linklist.c \
47 lib/log.c \
48 lib/log_filter.c \
49 lib/log_vty.c \
50 lib/md5.c \
51 lib/memory.c \
52 lib/mlag.c \
53 lib/module.c \
54 lib/mpls.c \
55 lib/srv6.c \
56 lib/network.c \
57 lib/nexthop.c \
58 lib/netns_linux.c \
59 lib/netns_other.c \
60 lib/nexthop_group.c \
61 lib/northbound.c \
62 lib/northbound_cli.c \
63 lib/northbound_db.c \
64 lib/ntop.c \
65 lib/openbsd-tree.c \
66 lib/pid_output.c \
67 lib/plist.c \
68 lib/prefix.c \
69 lib/privs.c \
70 lib/ptm_lib.c \
71 lib/pullwr.c \
72 lib/qobj.c \
73 lib/ringbuf.c \
74 lib/routemap.c \
75 lib/routemap_cli.c \
76 lib/routemap_northbound.c \
77 lib/sbuf.c \
78 lib/seqlock.c \
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 \
93 lib/typerb.c \
94 lib/typesafe.c \
95 lib/vector.c \
96 lib/vrf.c \
97 lib/vty.c \
98 lib/wheel.c \
99 lib/workqueue.c \
100 lib/yang.c \
101 lib/yang_translator.c \
102 lib/yang_wrappers.c \
103 lib/zclient.c \
104 lib/zlog.c \
105 lib/zlog_targets.c \
106 lib/printf/printf-pos.c \
107 lib/printf/vfprintf.c \
108 lib/printf/glue.c \
109 # end
110
111 nodist_lib_libfrr_la_SOURCES = \
112 yang/frr-filter.yang.c \
113 yang/frr-interface.yang.c \
114 yang/frr-route-map.yang.c \
115 yang/frr-route-types.yang.c \
116 yang/frr-vrf.yang.c \
117 yang/frr-routing.yang.c \
118 yang/ietf/ietf-routing-types.yang.c \
119 yang/ietf/ietf-interfaces.yang.c \
120 yang/frr-module-translator.yang.c \
121 yang/frr-nexthop.yang.c \
122 yang/frr-igmp.yang.c \
123 # end
124
125 vtysh_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 \
131 $(top_srcdir)/lib/lib_vty.c \
132 $(top_srcdir)/lib/nexthop_group.c \
133 $(top_srcdir)/lib/plist.c \
134 $(top_srcdir)/lib/routemap.c \
135 $(top_srcdir)/lib/routemap_cli.c \
136 $(top_srcdir)/lib/vrf.c \
137 $(top_srcdir)/lib/vty.c \
138 # end
139 # can be loaded as DSO - always include for vtysh
140 vtysh_scan += $(top_srcdir)/lib/agentx.c
141
142 if SQLITE3
143 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
144 lib_libfrr_la_SOURCES += lib/db.c
145 endif
146
147 lib/if_clippy.c: $(CLIPPY_DEPS)
148 lib/if.lo: lib/if_clippy.c
149 lib/plist_clippy.c: $(CLIPPY_DEPS)
150 lib/plist.lo: lib/plist_clippy.c
151 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
152 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
153 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
154 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
155 lib/routemap_cli_clippy.c: $(CLIPPY_DEPS)
156 lib/routemap_cli.lo: lib/routemap_cli_clippy.c
157 lib/vty_clippy.c: $(CLIPPY_DEPS)
158 lib/vty.lo: lib/vty_clippy.c
159 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
160 lib/log_vty.lo: lib/log_vty_clippy.c
161
162 pkginclude_HEADERS += \
163 lib/agg_table.h \
164 lib/atomlist.h \
165 lib/bfd.h \
166 lib/bitfield.h \
167 lib/buffer.h \
168 lib/checksum.h \
169 lib/mlag.h \
170 lib/command.h \
171 lib/command_graph.h \
172 lib/command_match.h \
173 lib/compiler.h \
174 lib/csv.h \
175 lib/db.h \
176 lib/debug.h \
177 lib/defaults.h \
178 lib/distribute.h \
179 lib/ferr.h \
180 lib/filter.h \
181 lib/freebsd-queue.h \
182 lib/frrlua.h \
183 lib/frr_pthread.h \
184 lib/frratomic.h \
185 lib/frrcu.h \
186 lib/frrstr.h \
187 lib/getopt.h \
188 lib/graph.h \
189 lib/hash.h \
190 lib/hook.h \
191 lib/iana_afi.h \
192 lib/id_alloc.h \
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 \
200 lib/lib_errors.h \
201 lib/lib_vty.h \
202 lib/libfrr.h \
203 lib/libospf.h \
204 lib/linklist.h \
205 lib/log.h \
206 lib/log_vty.h \
207 lib/md5.h \
208 lib/memory.h \
209 lib/module.h \
210 lib/monotime.h \
211 lib/mpls.h \
212 lib/srv6.h \
213 lib/network.h \
214 lib/nexthop.h \
215 lib/nexthop_group.h \
216 lib/nexthop_group_private.h \
217 lib/northbound.h \
218 lib/northbound_cli.h \
219 lib/northbound_db.h \
220 lib/ns.h \
221 lib/openbsd-queue.h \
222 lib/openbsd-tree.h \
223 lib/plist.h \
224 lib/prefix.h \
225 lib/printfrr.h \
226 lib/privs.h \
227 lib/ptm_lib.h \
228 lib/pullwr.h \
229 lib/pw.h \
230 lib/qobj.h \
231 lib/queue.h \
232 lib/ringbuf.h \
233 lib/routemap.h \
234 lib/sbuf.h \
235 lib/seqlock.h \
236 lib/sha256.h \
237 lib/sigevent.h \
238 lib/skiplist.h \
239 lib/smux.h \
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 \
249 lib/typerb.h \
250 lib/typesafe.h \
251 lib/vector.h \
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 \
259 lib/yang.h \
260 lib/yang_translator.h \
261 lib/yang_wrappers.h \
262 lib/zassert.h \
263 lib/zclient.h \
264 lib/zebra.h \
265 lib/zlog.h \
266 lib/zlog_targets.h \
267 lib/pbr.h \
268 # end
269
270
271 nodist_pkginclude_HEADERS += \
272 lib/route_types.h \
273 lib/version.h \
274 # end
275
276 noinst_HEADERS += \
277 lib/clippy.h \
278 lib/plist_int.h \
279 lib/printf/printfcommon.h \
280 lib/printf/printflocal.h \
281 #end
282
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
294 #
295 # SNMP support
296 #
297 if SNMP
298 lib_LTLIBRARIES += lib/libfrrsnmp.la
299 endif
300
301 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
302 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
303 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
304 lib_libfrrsnmp_la_SOURCES = \
305 lib/agentx.c \
306 lib/snmp.c \
307 # end
308
309 #
310 # c-ares support
311 #
312 if CARES
313 lib_LTLIBRARIES += lib/libfrrcares.la
314 pkginclude_HEADERS += lib/resolver.h
315 endif
316
317 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
318 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
319 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
320 lib_libfrrcares_la_SOURCES = \
321 lib/resolver.c \
322 #end
323
324 #
325 # ZeroMQ support
326 #
327 if ZEROMQ
328 lib_LTLIBRARIES += lib/libfrrzmq.la
329 pkginclude_HEADERS += lib/frr_zmq.h
330 endif
331
332 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
333 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
334 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
335 lib_libfrrzmq_la_SOURCES = \
336 lib/frr_zmq.c \
337 #end
338
339 #
340 # Tail-f's ConfD support
341 #
342 if CONFD
343 module_LTLIBRARIES += lib/confd.la
344 endif
345
346 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
347 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
348 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
349 lib_confd_la_SOURCES = lib/northbound_confd.c
350
351 #
352 # Sysrepo support
353 #
354 if SYSREPO
355 module_LTLIBRARIES += lib/sysrepo.la
356 endif
357
358 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
359 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
360 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
361 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
362
363 #
364 # gRPC northbound plugin
365 #
366 if GRPC
367 module_LTLIBRARIES += lib/grpc.la
368 endif
369
370 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
371 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
372 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
373 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
374
375 #
376 # CLI utilities
377 #
378 noinst_PROGRAMS += \
379 lib/grammar_sandbox \
380 # end
381
382 if BUILD_CLIPPY
383 noinst_PROGRAMS += lib/clippy
384 else
385 if HOSTTOOLS_CLIPPY
386 $(CLIPPY):
387 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
388 endif
389 endif
390
391 lib_grammar_sandbox_SOURCES = \
392 lib/grammar_sandbox_main.c
393 lib_grammar_sandbox_LDADD = \
394 lib/libfrr.la
395
396 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
397 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
398 lib_clippy_LDADD = $(PYTHON_LIBS)
399 lib_clippy_LDFLAGS = -export-dynamic
400 lib_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
412 # (global) clippy rules for all directories
413
414 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
415 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
416 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
417 am__v_CLIPPY_1 =
418
419 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
420
421 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
422 .c_clippy.c:
423 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
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) $<
430
431 #
432 # generated sources & extra foo
433 #
434 EXTRA_DIST += \
435 lib/command_lex.h \
436 lib/command_parse.h \
437 lib/gitversion.pl \
438 lib/route_types.pl \
439 lib/route_types.txt \
440 # end
441
442 BUILT_SOURCES += \
443 lib/gitversion.h \
444 lib/route_types.h \
445 # end
446
447 ## force route_types.h
448 $(lib_clippy_OBJECTS): lib/route_types.h
449 $(lib_libfrr_la_OBJECTS): lib/route_types.h
450
451 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
452
453 lib/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
456 lib/command_lex.lo: lib/command_parse.h
457 lib/command_parse.lo: lib/command_lex.h
458 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
459 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
460 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
461 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
462
463 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
464 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
465 DISTCLEANFILES += lib/route_types.h
466
467 if 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
474 PHONY_GITVERSION=lib/gitversion.h.tmp
475 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
476 GITH=lib/gitversion.h
477 lib/gitversion.h.tmp: $(top_srcdir)/.git
478 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
479 lib/gitversion.h: lib/gitversion.h.tmp
480 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
481
482 else
483 PHONY_GITVERSION=lib/gitversion.h
484 lib/gitversion.h:
485 true
486 endif
487 .PHONY: $(PHONY_GITVERSION)