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