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