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