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