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