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