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