]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #8722 from opensourcerouting/ospfv3-asan-crash
[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) $(UST_LIBS) $(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/filter_cli.c \
26 lib/filter_nb.c \
27 lib/frrcu.c \
28 lib/frrlua.c \
29 lib/frrscript.c \
30 lib/frr_pthread.c \
31 lib/frrstr.c \
32 lib/getopt.c \
33 lib/getopt1.c \
34 lib/grammar_sandbox.c \
35 lib/graph.c \
36 lib/hash.c \
37 lib/hook.c \
38 lib/id_alloc.c \
39 lib/if.c \
40 lib/if_rmap.c \
41 lib/imsg-buffer.c \
42 lib/imsg.c \
43 lib/jhash.c \
44 lib/json.c \
45 lib/keychain.c \
46 lib/ldp_sync.c \
47 lib/lib_errors.c \
48 lib/lib_vty.c \
49 lib/libfrr.c \
50 lib/libfrr_trace.c \
51 lib/linklist.c \
52 lib/link_state.c \
53 lib/log.c \
54 lib/log_filter.c \
55 lib/log_vty.c \
56 lib/md5.c \
57 lib/memory.c \
58 lib/mlag.c \
59 lib/module.c \
60 lib/mpls.c \
61 lib/srv6.c \
62 lib/network.c \
63 lib/nexthop.c \
64 lib/netns_linux.c \
65 lib/netns_other.c \
66 lib/nexthop_group.c \
67 lib/northbound.c \
68 lib/northbound_cli.c \
69 lib/northbound_db.c \
70 lib/ntop.c \
71 lib/openbsd-tree.c \
72 lib/pid_output.c \
73 lib/plist.c \
74 lib/prefix.c \
75 lib/privs.c \
76 lib/ptm_lib.c \
77 lib/pullwr.c \
78 lib/qobj.c \
79 lib/ringbuf.c \
80 lib/routemap.c \
81 lib/routemap_cli.c \
82 lib/routemap_northbound.c \
83 lib/sbuf.c \
84 lib/seqlock.c \
85 lib/sha256.c \
86 lib/sigevent.c \
87 lib/skiplist.c \
88 lib/sockopt.c \
89 lib/sockunion.c \
90 lib/spf_backoff.c \
91 lib/srcdest_table.c \
92 lib/stream.c \
93 lib/strformat.c \
94 lib/strlcat.c \
95 lib/strlcpy.c \
96 lib/systemd.c \
97 lib/table.c \
98 lib/termtable.c \
99 lib/thread.c \
100 lib/typerb.c \
101 lib/typesafe.c \
102 lib/vector.c \
103 lib/vrf.c \
104 lib/vty.c \
105 lib/wheel.c \
106 lib/workqueue.c \
107 lib/xref.c \
108 lib/yang.c \
109 lib/yang_translator.c \
110 lib/yang_wrappers.c \
111 lib/zclient.c \
112 lib/zlog.c \
113 lib/zlog_targets.c \
114 lib/printf/printf-pos.c \
115 lib/printf/vfprintf.c \
116 lib/printf/glue.c \
117 lib/routing_nb.c \
118 lib/routing_nb_config.c \
119 # end
120
121 nodist_lib_libfrr_la_SOURCES = \
122 yang/frr-filter.yang.c \
123 yang/frr-interface.yang.c \
124 yang/frr-route-map.yang.c \
125 yang/frr-route-types.yang.c \
126 yang/frr-vrf.yang.c \
127 yang/frr-routing.yang.c \
128 yang/frr-nexthop.yang.c \
129 yang/ietf/ietf-routing-types.yang.c \
130 yang/ietf/ietf-interfaces.yang.c \
131 yang/ietf/ietf-bgp-types.yang.c \
132 yang/frr-module-translator.yang.c \
133 yang/frr-nexthop.yang.c \
134 # end
135
136 vtysh_scan += \
137 lib/distribute.c \
138 lib/filter.c \
139 lib/filter_cli.c \
140 lib/if.c \
141 lib/if_rmap.c \
142 lib/keychain.c \
143 lib/lib_vty.c \
144 lib/log_vty.c \
145 lib/nexthop_group.c \
146 lib/plist.c \
147 lib/resolver.c \
148 lib/routemap.c \
149 lib/routemap_cli.c \
150 lib/spf_backoff.c \
151 lib/thread.c \
152 lib/vrf.c \
153 lib/vty.c \
154 # end
155 # can be loaded as DSO - always include for vtysh
156 vtysh_scan += lib/agentx.c
157
158 if SQLITE3
159 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
160 lib_libfrr_la_SOURCES += lib/db.c
161 endif
162
163 clippy_scan += \
164 lib/if.c \
165 lib/filter_cli.c \
166 lib/log_vty.c \
167 lib/nexthop_group.c \
168 lib/northbound_cli.c \
169 lib/plist.c \
170 lib/routemap_cli.c \
171 lib/vty.c \
172 # end
173
174 pkginclude_HEADERS += \
175 lib/agg_table.h \
176 lib/atomlist.h \
177 lib/bfd.h \
178 lib/bitfield.h \
179 lib/buffer.h \
180 lib/checksum.h \
181 lib/mlag.h \
182 lib/command.h \
183 lib/command_graph.h \
184 lib/command_match.h \
185 lib/compiler.h \
186 lib/csv.h \
187 lib/db.h \
188 lib/debug.h \
189 lib/defaults.h \
190 lib/distribute.h \
191 lib/ferr.h \
192 lib/filter.h \
193 lib/freebsd-queue.h \
194 lib/frrlua.h \
195 lib/frrscript.h \
196 lib/frr_pthread.h \
197 lib/frratomic.h \
198 lib/frrcu.h \
199 lib/frrstr.h \
200 lib/getopt.h \
201 lib/graph.h \
202 lib/hash.h \
203 lib/hook.h \
204 lib/iana_afi.h \
205 lib/id_alloc.h \
206 lib/if.h \
207 lib/if_rmap.h \
208 lib/imsg.h \
209 lib/ipaddr.h \
210 lib/jhash.h \
211 lib/json.h \
212 lib/keychain.h \
213 lib/ldp_sync.h \
214 lib/lib_errors.h \
215 lib/lib_vty.h \
216 lib/libfrr.h \
217 lib/libfrr_trace.h \
218 lib/libospf.h \
219 lib/linklist.h \
220 lib/link_state.h \
221 lib/log.h \
222 lib/log_vty.h \
223 lib/md5.h \
224 lib/memory.h \
225 lib/module.h \
226 lib/monotime.h \
227 lib/mpls.h \
228 lib/srv6.h \
229 lib/network.h \
230 lib/nexthop.h \
231 lib/nexthop_group.h \
232 lib/nexthop_group_private.h \
233 lib/northbound.h \
234 lib/northbound_cli.h \
235 lib/northbound_db.h \
236 lib/ns.h \
237 lib/openbsd-queue.h \
238 lib/openbsd-tree.h \
239 lib/plist.h \
240 lib/prefix.h \
241 lib/printfrr.h \
242 lib/privs.h \
243 lib/ptm_lib.h \
244 lib/pullwr.h \
245 lib/pw.h \
246 lib/qobj.h \
247 lib/queue.h \
248 lib/ringbuf.h \
249 lib/routemap.h \
250 lib/route_opaque.h \
251 lib/sbuf.h \
252 lib/seqlock.h \
253 lib/sha256.h \
254 lib/sigevent.h \
255 lib/skiplist.h \
256 lib/smux.h \
257 lib/sockopt.h \
258 lib/sockunion.h \
259 lib/spf_backoff.h \
260 lib/srcdest_table.h \
261 lib/srte.h \
262 lib/stream.h \
263 lib/systemd.h \
264 lib/table.h \
265 lib/termtable.h \
266 lib/thread.h \
267 lib/trace.h \
268 lib/typerb.h \
269 lib/typesafe.h \
270 lib/vector.h \
271 lib/vlan.h \
272 lib/vrf.h \
273 lib/vrf_int.h \
274 lib/vty.h \
275 lib/vxlan.h \
276 lib/wheel.h \
277 lib/workqueue.h \
278 lib/xref.h \
279 lib/yang.h \
280 lib/yang_translator.h \
281 lib/yang_wrappers.h \
282 lib/zclient.h \
283 lib/zebra.h \
284 lib/zlog.h \
285 lib/zlog_targets.h \
286 lib/pbr.h \
287 lib/routing_nb.h \
288 \
289 lib/assert/assert.h \
290 # end
291
292
293 nodist_pkginclude_HEADERS += \
294 lib/route_types.h \
295 lib/version.h \
296 # end
297
298 noinst_HEADERS += \
299 lib/clippy.h \
300 lib/plist_int.h \
301 lib/printf/printfcommon.h \
302 lib/printf/printflocal.h \
303 #end
304
305 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
306 # linking: If we're linking libfrr statically into daemons, we *must* remove
307 # libfrr from modules because modules will always link it in dynamically and
308 # thus 2 copies of libfrr will be loaded... hilarity ensues.
309 #
310 # Not linking libfrr into modules should generally work fine because the
311 # executable refers to libfrr either way and the dynamic linker should make
312 # libfrr available to modules. If some OS platform has a dynamic linker that
313 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
314 # it's not linked into daemons statically.
315
316 #
317 # SNMP support
318 #
319 if SNMP
320 lib_LTLIBRARIES += lib/libfrrsnmp.la
321 endif
322
323 lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
324 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
325 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
326 lib_libfrrsnmp_la_SOURCES = \
327 lib/agentx.c \
328 lib/snmp.c \
329 # end
330
331 #
332 # c-ares support
333 #
334 if CARES
335 lib_LTLIBRARIES += lib/libfrrcares.la
336 pkginclude_HEADERS += lib/resolver.h
337 endif
338
339 lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
340 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
341 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
342 lib_libfrrcares_la_SOURCES = \
343 lib/resolver.c \
344 #end
345
346 #
347 # ZeroMQ support
348 #
349 if ZEROMQ
350 lib_LTLIBRARIES += lib/libfrrzmq.la
351 pkginclude_HEADERS += lib/frr_zmq.h
352 endif
353
354 lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
355 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
356 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
357 lib_libfrrzmq_la_SOURCES = \
358 lib/frr_zmq.c \
359 #end
360
361 #
362 # Tail-f's ConfD support
363 #
364 if CONFD
365 module_LTLIBRARIES += lib/confd.la
366 endif
367
368 lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
369 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
370 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
371 lib_confd_la_SOURCES = lib/northbound_confd.c
372
373 #
374 # Sysrepo support
375 #
376 if SYSREPO
377 module_LTLIBRARIES += lib/sysrepo.la
378 endif
379
380 lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
381 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
382 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
383 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
384
385 #
386 # gRPC northbound plugin
387 #
388 if GRPC
389 module_LTLIBRARIES += lib/grpc.la
390 endif
391
392 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
393 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
394 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
395 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
396
397 #
398 # CLI utilities
399 #
400 noinst_PROGRAMS += \
401 lib/grammar_sandbox \
402 # end
403
404 if BUILD_CLIPPY
405 noinst_PROGRAMS += lib/clippy
406 else
407 if HOSTTOOLS_CLIPPY
408 $(CLIPPY):
409 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
410 endif
411 endif
412
413 lib_grammar_sandbox_SOURCES = \
414 lib/grammar_sandbox_main.c
415 lib_grammar_sandbox_LDADD = \
416 lib/libfrr.la
417
418 lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
419 lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
420 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
421 lib_clippy_LDFLAGS = -export-dynamic
422 lib_clippy_SOURCES = \
423 lib/jhash.c \
424 lib/clippy.c \
425 lib/command_graph.c \
426 lib/command_lex.l \
427 lib/command_parse.y \
428 lib/command_py.c \
429 lib/defun_lex.l \
430 lib/elf_py.c \
431 lib/graph.c \
432 lib/libfrr_trace.c \
433 lib/memory.c \
434 lib/typesafe.c \
435 lib/vector.c \
436 # end
437
438 # (global) clippy rules for all directories
439
440 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
441 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
442 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
443 am__v_CLIPPY_1 =
444
445 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
446
447 SUFFIXES += _clippy.c
448 .c_clippy.c:
449 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
450
451 # xrelfo, the ELF xref extractor
452
453 AM_V_XRELFO = $(am__v_XRELFO_$(V))
454 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
455 am__v_XRELFO_0 = @echo " XRELFO " $@;
456 am__v_XRELFO_1 =
457
458 if DEV_BUILD
459 XRELFO_FLAGS = -Wlog-format -Wlog-args
460 else
461 XRELFO_FLAGS =
462 endif
463
464 SUFFIXES += .xref
465 %.xref: % $(CLIPPY)
466 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(XRELFO_FLAGS) -o $@ $<
467
468 # dependencies added in python/makefile.py
469 frr.xref:
470 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^
471 all-am: frr.xref
472
473 clean-xref:
474 -rm -rf $(xrefs) frr.xref
475 clean-local: clean-xref
476
477 ## automake's "ylwrap" is a great piece of GNU software... not.
478 .l.c:
479 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
480 .y.c:
481 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
482
483 #
484 # generated sources & extra foo
485 #
486 EXTRA_DIST += \
487 lib/command_lex.h \
488 lib/command_parse.h \
489 lib/gitversion.pl \
490 lib/route_types.pl \
491 lib/route_types.txt \
492 # end
493
494 BUILT_SOURCES += \
495 lib/gitversion.h \
496 lib/route_types.h \
497 # end
498
499 ## force route_types.h
500 $(lib_clippy_OBJECTS): lib/route_types.h
501 $(lib_libfrr_la_OBJECTS): lib/route_types.h
502
503 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
504
505 lib/command_lex.h: lib/command_lex.c
506 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
507 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
508 lib/command_lex.lo: lib/command_parse.h
509 lib/command_parse.lo: lib/command_lex.h
510 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
511 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
512 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
513 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
514
515 rt_enabled =
516
517 if BABELD
518 rt_enabled += --enabled babeld
519 endif
520 if BFDD
521 rt_enabled += --enabled bfdd
522 endif
523 if BGPD
524 rt_enabled += --enabled bgpd
525 if ENABLE_BGP_VNC
526 rt_enabled += --enabled bgpd-vnc
527 endif
528 endif
529 if EIGRPD
530 rt_enabled += --enabled eigrpd
531 endif
532 if ISISD
533 rt_enabled += --enabled isisd
534 endif
535 if FABRICD
536 rt_enabled += --enabled fabricd
537 endif
538 if LDPD
539 rt_enabled += --enabled ldpd
540 endif
541 if NHRPD
542 rt_enabled += --enabled nhrpd
543 endif
544 if OSPFD
545 rt_enabled += --enabled ospfd
546 endif
547 if OSPF6D
548 rt_enabled += --enabled ospf6d
549 endif
550 if PBRD
551 rt_enabled += --enabled pbrd
552 endif
553 if PIMD
554 rt_enabled += --enabled pimd
555 endif
556 if RIPD
557 rt_enabled += --enabled ripd
558 endif
559 if RIPNGD
560 rt_enabled += --enabled ripngd
561 endif
562 if SHARPD
563 rt_enabled += --enabled sharpd
564 endif
565 if ZEBRA
566 rt_enabled += --enabled zebra
567 endif
568
569 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
570 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
571 DISTCLEANFILES += lib/route_types.h
572
573 if GIT_VERSION
574 # bit of a trick here to always have up-to-date git stamps without triggering
575 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
576 # but if we use that on gitversion.h it'll ripple through the .c file deps.
577 # (even if gitversion.h's file timestamp doesn't change, make will think it
578 # did, because of .PHONY...)
579
580 PHONY_GITVERSION=lib/gitversion.h.tmp
581 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
582 GITH=lib/gitversion.h
583 lib/gitversion.h.tmp: $(top_srcdir)/.git
584 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
585 lib/gitversion.h: lib/gitversion.h.tmp
586 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
587
588 else
589 PHONY_GITVERSION=lib/gitversion.h
590 lib/gitversion.h:
591 true
592 endif
593 .PHONY: $(PHONY_GITVERSION)