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