]> git.proxmox.com Git - mirror_frr.git/blame - lib/subdir.am
Merge pull request #7717 from ranjanyash54/2368
[mirror_frr.git] / lib / subdir.am
CommitLineData
4a121f99
DL
1#
2# libfrr
3#
4lib_LTLIBRARIES += lib/libfrr.la
42efb0d4 5lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
0cbcadcc 6lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBM)
4a121f99
DL
7
8lib_libfrr_la_SOURCES = \
8e1f6512 9 lib/agg_table.c \
bcea0c0f 10 lib/atomlist.c \
4a121f99
DL
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 \
aea03ad6 20 lib/debug.c \
96673e06 21 lib/defaults.c \
4a121f99 22 lib/distribute.c \
3155489a 23 lib/ferr.c \
4a121f99 24 lib/filter.c \
b62578bd 25 lib/filter_cli.c \
c2aab693 26 lib/filter_nb.c \
3e41733f 27 lib/frrcu.c \
5dbb0a7b 28 lib/frrlua.c \
4a121f99 29 lib/frr_pthread.c \
fe011935 30 lib/frrstr.c \
4a121f99
DL
31 lib/getopt.c \
32 lib/getopt1.c \
33 lib/grammar_sandbox.c \
34 lib/graph.c \
35 lib/hash.c \
36 lib/hook.c \
a94eca09 37 lib/id_alloc.c \
4a121f99
DL
38 lib/if.c \
39 lib/if_rmap.c \
40 lib/imsg-buffer.c \
41 lib/imsg.c \
42 lib/jhash.c \
43 lib/json.c \
44 lib/keychain.c \
24e7c5c8 45 lib/ldp_sync.c \
b66d022e 46 lib/lib_errors.c \
1c0d8808 47 lib/lib_vty.c \
4a121f99 48 lib/libfrr.c \
912d45a1 49 lib/libfrr_trace.c \
4a121f99
DL
50 lib/linklist.c \
51 lib/log.c \
1c408628 52 lib/log_filter.c \
f73126c3 53 lib/log_vty.c \
4a121f99
DL
54 lib/md5.c \
55 lib/memory.c \
6edbb8b2 56 lib/mlag.c \
4a121f99 57 lib/module.c \
036fdaad 58 lib/mpls.c \
e496b420 59 lib/srv6.c \
4a121f99
DL
60 lib/network.c \
61 lib/nexthop.c \
e26aedbe
PG
62 lib/netns_linux.c \
63 lib/netns_other.c \
7ee30f28 64 lib/nexthop_group.c \
1c2facd1
RW
65 lib/northbound.c \
66 lib/northbound_cli.c \
67 lib/northbound_db.c \
e128c002 68 lib/ntop.c \
4a121f99
DL
69 lib/openbsd-tree.c \
70 lib/pid_output.c \
71 lib/plist.c \
4a121f99
DL
72 lib/prefix.c \
73 lib/privs.c \
74 lib/ptm_lib.c \
5c52c06c 75 lib/pullwr.c \
4a121f99 76 lib/qobj.c \
5318d896 77 lib/ringbuf.c \
4a121f99 78 lib/routemap.c \
2b3e4807 79 lib/routemap_cli.c \
686d244f 80 lib/routemap_northbound.c \
31bfa062 81 lib/sbuf.c \
440d5faa 82 lib/seqlock.c \
4a121f99
DL
83 lib/sha256.c \
84 lib/sigevent.c \
85 lib/skiplist.c \
86 lib/sockopt.c \
87 lib/sockunion.c \
88 lib/spf_backoff.c \
89 lib/srcdest_table.c \
90 lib/stream.c \
91 lib/strlcat.c \
92 lib/strlcpy.c \
93 lib/systemd.c \
94 lib/table.c \
95 lib/termtable.c \
96 lib/thread.c \
80911bc2 97 lib/typerb.c \
abd71baa 98 lib/typesafe.c \
4a121f99
DL
99 lib/vector.c \
100 lib/vrf.c \
101 lib/vty.c \
102 lib/wheel.c \
103 lib/workqueue.c \
1c2facd1
RW
104 lib/yang.c \
105 lib/yang_translator.c \
106 lib/yang_wrappers.c \
4a121f99 107 lib/zclient.c \
0bdeb5e5
DL
108 lib/zlog.c \
109 lib/zlog_targets.c \
5c25bd87
DL
110 lib/printf/printf-pos.c \
111 lib/printf/vfprintf.c \
112 lib/printf/glue.c \
7441ea1a 113 lib/routing_nb.c \
114 lib/routing_nb_config.c \
4a121f99
DL
115 # end
116
3a11599c 117nodist_lib_libfrr_la_SOURCES = \
a513824c 118 yang/frr-filter.yang.c \
3a11599c 119 yang/frr-interface.yang.c \
686d244f 120 yang/frr-route-map.yang.c \
3a11599c 121 yang/frr-route-types.yang.c \
3a7262b6 122 yang/frr-vrf.yang.c \
8b043166 123 yang/frr-routing.yang.c \
7441ea1a 124 yang/frr-nexthop.yang.c \
e6a0538b 125 yang/ietf/ietf-routing-types.yang.c \
b0f502c5 126 yang/ietf/ietf-interfaces.yang.c \
bc8c00cc 127 yang/ietf/ietf-bgp-types.yang.c \
3a11599c 128 yang/frr-module-translator.yang.c \
e7ecd0a6 129 yang/frr-nexthop.yang.c \
3a11599c
DL
130 # end
131
74dc19a2 132vtysh_scan += \
2768748b
DL
133 lib/distribute.c \
134 lib/filter.c \
b62578bd 135 lib/filter_cli.c \
2768748b
DL
136 lib/if.c \
137 lib/if_rmap.c \
138 lib/keychain.c \
139 lib/lib_vty.c \
140 lib/nexthop_group.c \
141 lib/plist.c \
142 lib/routemap.c \
143 lib/routemap_cli.c \
144 lib/vrf.c \
145 lib/vty.c \
74dc19a2
DL
146 # end
147# can be loaded as DSO - always include for vtysh
2768748b 148vtysh_scan += lib/agentx.c
74dc19a2 149
1c2facd1 150if SQLITE3
fdbd8086 151lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
1c2facd1
RW
152lib_libfrr_la_SOURCES += lib/db.c
153endif
154
94cfb069
DL
155clippy_scan += \
156 lib/if.c \
b62578bd 157 lib/filter_cli.c \
94cfb069
DL
158 lib/log_vty.c \
159 lib/nexthop_group.c \
160 lib/northbound_cli.c \
161 lib/plist.c \
162 lib/routemap_cli.c \
163 lib/vty.c \
164 # end
4a121f99
DL
165
166pkginclude_HEADERS += \
8e1f6512 167 lib/agg_table.h \
bcea0c0f 168 lib/atomlist.h \
4a121f99
DL
169 lib/bfd.h \
170 lib/bitfield.h \
171 lib/buffer.h \
172 lib/checksum.h \
14beb548 173 lib/mlag.h \
4a121f99
DL
174 lib/command.h \
175 lib/command_graph.h \
176 lib/command_match.h \
de1a880c 177 lib/compiler.h \
4a121f99 178 lib/csv.h \
1c2facd1 179 lib/db.h \
aea03ad6 180 lib/debug.h \
96673e06 181 lib/defaults.h \
4a121f99 182 lib/distribute.h \
3155489a 183 lib/ferr.h \
4a121f99 184 lib/filter.h \
cd85bc2e 185 lib/freebsd-queue.h \
5dbb0a7b 186 lib/frrlua.h \
4a121f99
DL
187 lib/frr_pthread.h \
188 lib/frratomic.h \
3e41733f 189 lib/frrcu.h \
fe011935 190 lib/frrstr.h \
4a121f99
DL
191 lib/getopt.h \
192 lib/graph.h \
193 lib/hash.h \
194 lib/hook.h \
17136bf2 195 lib/iana_afi.h \
a94eca09 196 lib/id_alloc.h \
4a121f99
DL
197 lib/if.h \
198 lib/if_rmap.h \
199 lib/imsg.h \
200 lib/ipaddr.h \
201 lib/jhash.h \
202 lib/json.h \
203 lib/keychain.h \
24e7c5c8 204 lib/ldp_sync.h \
b66d022e 205 lib/lib_errors.h \
1c0d8808 206 lib/lib_vty.h \
4a121f99 207 lib/libfrr.h \
912d45a1 208 lib/libfrr_trace.h \
4a121f99
DL
209 lib/libospf.h \
210 lib/linklist.h \
211 lib/log.h \
f73126c3 212 lib/log_vty.h \
4a121f99
DL
213 lib/md5.h \
214 lib/memory.h \
4a121f99
DL
215 lib/module.h \
216 lib/monotime.h \
217 lib/mpls.h \
e496b420 218 lib/srv6.h \
4a121f99
DL
219 lib/network.h \
220 lib/nexthop.h \
7ee30f28 221 lib/nexthop_group.h \
50d89650 222 lib/nexthop_group_private.h \
1c2facd1
RW
223 lib/northbound.h \
224 lib/northbound_cli.h \
225 lib/northbound_db.h \
4a121f99
DL
226 lib/ns.h \
227 lib/openbsd-queue.h \
228 lib/openbsd-tree.h \
229 lib/plist.h \
4a121f99 230 lib/prefix.h \
5c25bd87 231 lib/printfrr.h \
4a121f99
DL
232 lib/privs.h \
233 lib/ptm_lib.h \
5c52c06c 234 lib/pullwr.h \
6833ae01 235 lib/pw.h \
4a121f99 236 lib/qobj.h \
cd85bc2e 237 lib/queue.h \
5318d896 238 lib/ringbuf.h \
4a121f99 239 lib/routemap.h \
31bfa062 240 lib/sbuf.h \
440d5faa 241 lib/seqlock.h \
4a121f99
DL
242 lib/sha256.h \
243 lib/sigevent.h \
244 lib/skiplist.h \
98ea5be8 245 lib/smux.h \
4a121f99
DL
246 lib/sockopt.h \
247 lib/sockunion.h \
248 lib/spf_backoff.h \
249 lib/srcdest_table.h \
31f937fb 250 lib/srte.h \
4a121f99
DL
251 lib/stream.h \
252 lib/systemd.h \
253 lib/table.h \
254 lib/termtable.h \
255 lib/thread.h \
552e2a30 256 lib/trace.h \
80911bc2 257 lib/typerb.h \
abd71baa 258 lib/typesafe.h \
4a121f99 259 lib/vector.h \
4a121f99
DL
260 lib/vlan.h \
261 lib/vrf.h \
262 lib/vrf_int.h \
263 lib/vty.h \
264 lib/vxlan.h \
265 lib/wheel.h \
266 lib/workqueue.h \
1c2facd1
RW
267 lib/yang.h \
268 lib/yang_translator.h \
269 lib/yang_wrappers.h \
4a121f99
DL
270 lib/zassert.h \
271 lib/zclient.h \
272 lib/zebra.h \
0bdeb5e5
DL
273 lib/zlog.h \
274 lib/zlog_targets.h \
0031a6bb 275 lib/pbr.h \
7441ea1a 276 lib/routing_nb.h \
4a121f99
DL
277 # end
278
58f8a9ec 279
70d27c5b
DL
280nodist_pkginclude_HEADERS += \
281 lib/route_types.h \
282 lib/version.h \
283 # end
284
4a121f99
DL
285noinst_HEADERS += \
286 lib/clippy.h \
4a121f99 287 lib/plist_int.h \
5c25bd87
DL
288 lib/printf/printfcommon.h \
289 lib/printf/printflocal.h \
4a121f99
DL
290 #end
291
d6e76257
DL
292# General note about module and module helper library (libfrrsnmp, libfrrzmq)
293# linking: If we're linking libfrr statically into daemons, we *must* remove
294# libfrr from modules because modules will always link it in dynamically and
295# thus 2 copies of libfrr will be loaded... hilarity ensues.
296#
297# Not linking libfrr into modules should generally work fine because the
298# executable refers to libfrr either way and the dynamic linker should make
299# libfrr available to modules. If some OS platform has a dynamic linker that
300# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
301# it's not linked into daemons statically.
302
4a121f99
DL
303#
304# SNMP support
305#
306if SNMP
307lib_LTLIBRARIES += lib/libfrrsnmp.la
308endif
309
7aad1594 310lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
4a121f99 311lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
d6e76257 312lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
4a121f99
DL
313lib_libfrrsnmp_la_SOURCES = \
314 lib/agentx.c \
4a121f99
DL
315 lib/snmp.c \
316 # end
317
fe9e7b71
DL
318#
319# c-ares support
320#
321if CARES
322lib_LTLIBRARIES += lib/libfrrcares.la
323pkginclude_HEADERS += lib/resolver.h
324endif
325
326lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
327lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
328lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
329lib_libfrrcares_la_SOURCES = \
330 lib/resolver.c \
331 #end
332
b6116506
DL
333#
334# ZeroMQ support
335#
336if ZEROMQ
337lib_LTLIBRARIES += lib/libfrrzmq.la
338pkginclude_HEADERS += lib/frr_zmq.h
339endif
340
341lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
342lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
d6e76257 343lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
b6116506
DL
344lib_libfrrzmq_la_SOURCES = \
345 lib/frr_zmq.c \
346 #end
347
5bce33b3
RW
348#
349# Tail-f's ConfD support
350#
351if CONFD
352module_LTLIBRARIES += lib/confd.la
353endif
354
355lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
356lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
fdbd8086 357lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
5bce33b3
RW
358lib_confd_la_SOURCES = lib/northbound_confd.c
359
a7ca2199
RW
360#
361# Sysrepo support
362#
363if SYSREPO
364module_LTLIBRARIES += lib/sysrepo.la
365endif
366
fdbd8086 367lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
a7ca2199 368lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
fdbd8086 369lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
a7ca2199
RW
370lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
371
ec2ac5f2
RW
372#
373# gRPC northbound plugin
374#
375if GRPC
376module_LTLIBRARIES += lib/grpc.la
377endif
378
379lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
380lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
381lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
382lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
383
4a121f99
DL
384#
385# CLI utilities
386#
387noinst_PROGRAMS += \
4a121f99
DL
388 lib/grammar_sandbox \
389 # end
390
89727c8d
DL
391if BUILD_CLIPPY
392noinst_PROGRAMS += lib/clippy
393else
a71c5039
DL
394if HOSTTOOLS_CLIPPY
395$(CLIPPY):
396 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
397endif
89727c8d
DL
398endif
399
4a121f99
DL
400lib_grammar_sandbox_SOURCES = \
401 lib/grammar_sandbox_main.c
402lib_grammar_sandbox_LDADD = \
403 lib/libfrr.la
404
dbac691d
DL
405lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
406lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
d92658f4 407lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS)
dbac691d 408lib_clippy_LDFLAGS = -export-dynamic
4a121f99
DL
409lib_clippy_SOURCES = \
410 lib/clippy.c \
411 lib/command_graph.c \
412 lib/command_lex.l \
413 lib/command_parse.y \
414 lib/command_py.c \
415 lib/defun_lex.l \
416 lib/graph.c \
912d45a1 417 lib/libfrr_trace.c \
4a121f99
DL
418 lib/memory.c \
419 lib/vector.c \
420 # end
421
aad24c5b
DL
422# (global) clippy rules for all directories
423
424AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
425am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
426am__v_CLIPPY_0 = @echo " CLIPPY " $@;
427am__v_CLIPPY_1 =
428
a71c5039 429CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
aad24c5b 430
8fb40377 431SUFFIXES += _clippy.c
aad24c5b 432.c_clippy.c:
a71c5039 433 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
aad24c5b
DL
434
435## automake's "ylwrap" is a great piece of GNU software... not.
436.l.c:
437 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
438.y.c:
439 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
4a121f99
DL
440
441#
442# generated sources & extra foo
443#
444EXTRA_DIST += \
445 lib/command_lex.h \
70d27c5b 446 lib/command_parse.h \
4a121f99 447 lib/gitversion.pl \
4a121f99
DL
448 lib/route_types.pl \
449 lib/route_types.txt \
450 # end
451
452BUILT_SOURCES += \
4a121f99
DL
453 lib/gitversion.h \
454 lib/route_types.h \
455 # end
456
f1b32b2e
DL
457## force route_types.h
458$(lib_clippy_OBJECTS): lib/route_types.h
459$(lib_libfrr_la_OBJECTS): lib/route_types.h
460
4a121f99
DL
461AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
462
463lib/command_lex.h: lib/command_lex.c
464 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
465 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
f1b32b2e 466lib/command_lex.lo: lib/command_parse.h
4a121f99 467lib/command_parse.lo: lib/command_lex.h
fdbd8086
DL
468lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
469lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
f1b32b2e 470lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
4a121f99
DL
471lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
472
b3b4dfa5
IR
473rt_enabled =
474
475if BABELD
476rt_enabled += --enabled babeld
477endif
478if BFDD
479rt_enabled += --enabled bfdd
480endif
481if BGPD
482rt_enabled += --enabled bgpd
483if ENABLE_BGP_VNC
484rt_enabled += --enabled bgpd-vnc
485endif
486endif
487if EIGRPD
488rt_enabled += --enabled eigrpd
489endif
490if ISISD
491rt_enabled += --enabled isisd
492endif
493if FABRICD
494rt_enabled += --enabled fabricd
495endif
496if LDPD
497rt_enabled += --enabled ldpd
498endif
499if NHRPD
500rt_enabled += --enabled nhrpd
501endif
502if OSPFD
503rt_enabled += --enabled ospfd
504endif
505if OSPF6D
506rt_enabled += --enabled ospf6d
507endif
508if PBRD
509rt_enabled += --enabled pbrd
510endif
511if PIMD
512rt_enabled += --enabled pimd
513endif
514if RIPD
515rt_enabled += --enabled ripd
516endif
517if RIPNGD
518rt_enabled += --enabled ripngd
519endif
520if SHARPD
521rt_enabled += --enabled sharpd
522endif
523if ZEBRA
524rt_enabled += --enabled zebra
525endif
526
4a121f99 527lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
b3b4dfa5 528 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
67cf020d 529DISTCLEANFILES += lib/route_types.h
4a121f99
DL
530
531if GIT_VERSION
532# bit of a trick here to always have up-to-date git stamps without triggering
533# unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
534# but if we use that on gitversion.h it'll ripple through the .c file deps.
535# (even if gitversion.h's file timestamp doesn't change, make will think it
536# did, because of .PHONY...)
537
9e53b315 538PHONY_GITVERSION=lib/gitversion.h.tmp
4a121f99
DL
539.SILENT: lib/gitversion.h lib/gitversion.h.tmp
540GITH=lib/gitversion.h
541lib/gitversion.h.tmp: $(top_srcdir)/.git
fdbd8086 542 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
4a121f99 543lib/gitversion.h: lib/gitversion.h.tmp
bd402424 544 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
4a121f99
DL
545
546else
9e53b315 547PHONY_GITVERSION=lib/gitversion.h
4a121f99
DL
548lib/gitversion.h:
549 true
550endif
9e53b315 551.PHONY: $(PHONY_GITVERSION)