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