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