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