]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #8962 from donaldsharp/bgp_ll_must_be_there
[mirror_frr.git] / lib / subdir.am
1 #
2 # libfrr
3 #
4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_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 = -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 = -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 = -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 = -avoid-version -module -shared -export-dynamic
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 = -avoid-version -module -shared -export-dynamic
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 = -avoid-version -module -shared -export-dynamic
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 lib_clippy_LDFLAGS = -export-dynamic
423 lib_clippy_SOURCES = \
424 lib/jhash.c \
425 lib/clippy.c \
426 lib/command_graph.c \
427 lib/command_lex.l \
428 lib/command_parse.y \
429 lib/command_py.c \
430 lib/defun_lex.l \
431 lib/elf_py.c \
432 lib/graph.c \
433 lib/libfrr_trace.c \
434 lib/memory.c \
435 lib/typesafe.c \
436 lib/vector.c \
437 # end
438
439 # (global) clippy rules for all directories
440
441 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
442 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
443 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
444 am__v_CLIPPY_1 =
445
446 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
447
448 SUFFIXES += _clippy.c
449 .c_clippy.c:
450 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
451
452 # xrelfo, the ELF xref extractor
453
454 AM_V_XRELFO = $(am__v_XRELFO_$(V))
455 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
456 am__v_XRELFO_0 = @echo " XRELFO " $@;
457 am__v_XRELFO_1 =
458
459 if DEV_BUILD
460 XRELFO_FLAGS = -Wlog-format -Wlog-args
461 else
462 XRELFO_FLAGS =
463 endif
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 $@ $^
472 all-am: frr.xref
473
474 clean-xref:
475 -rm -rf $(xrefs) frr.xref
476 clean-local: clean-xref
477
478 ## automake's "ylwrap" is a great piece of GNU software... not.
479 .l.c:
480 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
481 .y.c:
482 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
483
484 #
485 # generated sources & extra foo
486 #
487 EXTRA_DIST += \
488 lib/command_lex.h \
489 lib/command_parse.h \
490 lib/gitversion.pl \
491 lib/route_types.pl \
492 lib/route_types.txt \
493 # end
494
495 BUILT_SOURCES += \
496 lib/gitversion.h \
497 lib/route_types.h \
498 # end
499
500 ## force route_types.h
501 $(lib_clippy_OBJECTS): lib/route_types.h
502 $(lib_libfrr_la_OBJECTS): lib/route_types.h
503
504 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
505
506 lib/command_lex.h: lib/command_lex.c
507 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
508 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
509 lib/command_lex.lo: lib/command_parse.h
510 lib/command_parse.lo: lib/command_lex.h
511 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
512 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
513 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
514 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
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 # unneccessary 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)