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