]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / subdir.am
1 #
2 # libfrr
3 #
4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
6 lib_libfrr_la_LIBADD = @LIBCAP@ $(UNWIND_LIBS) -lyang
7
8 lib_libfrr_la_SOURCES = \
9 lib/agg_table.c \
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 \
19 lib/debug.c \
20 lib/distribute.c \
21 lib/event_counter.c \
22 lib/ferr.c \
23 lib/filter.c \
24 lib/frr_pthread.c \
25 lib/frrstr.c \
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 \
32 lib/id_alloc.c \
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 \
40 lib/lib_errors.c \
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 \
48 lib/mpls.c \
49 lib/network.c \
50 lib/nexthop.c \
51 lib/netns_linux.c \
52 lib/netns_other.c \
53 lib/nexthop_group.c \
54 lib/northbound.c \
55 lib/northbound_cli.c \
56 lib/northbound_db.c \
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 \
65 lib/ringbuf.c \
66 lib/routemap.c \
67 lib/sbuf.c \
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 \
87 lib/yang.c \
88 lib/yang_translator.c \
89 lib/yang_wrappers.c \
90 lib/zclient.c \
91 lib/logicalrouter.c \
92 lib/lua.c \
93 # end
94
95 nodist_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
101 vtysh_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
115 vtysh_scan += $(top_srcdir)/lib/agentx.c
116
117 if SQLITE3
118 lib_libfrr_la_LIBADD += -lsqlite3
119 lib_libfrr_la_SOURCES += lib/db.c
120 endif
121
122 lib/if_clippy.c: $(CLIPPY_DEPS)
123 lib/if.lo: lib/if_clippy.c
124 lib/plist_clippy.c: $(CLIPPY_DEPS)
125 lib/plist.lo: lib/plist_clippy.c
126 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
127 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
128 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
129 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
130
131 pkginclude_HEADERS += \
132 lib/agg_table.h \
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 \
140 lib/compiler.h \
141 lib/csv.h \
142 lib/db.h \
143 lib/debug.h \
144 lib/distribute.h \
145 lib/event_counter.h \
146 lib/ferr.h \
147 lib/fifo.h \
148 lib/filter.h \
149 lib/freebsd-queue.h \
150 lib/frr_pthread.h \
151 lib/frratomic.h \
152 lib/frrstr.h \
153 lib/getopt.h \
154 lib/graph.h \
155 lib/hash.h \
156 lib/hook.h \
157 lib/id_alloc.h \
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 \
165 lib/lib_errors.h \
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 \
178 lib/nexthop_group.h \
179 lib/northbound.h \
180 lib/northbound_cli.h \
181 lib/northbound_db.h \
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 \
190 lib/pw.h \
191 lib/qobj.h \
192 lib/queue.h \
193 lib/ringbuf.h \
194 lib/routemap.h \
195 lib/sbuf.h \
196 lib/sha256.h \
197 lib/sigevent.h \
198 lib/skiplist.h \
199 lib/smux.h \
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 \
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 \
217 lib/yang.h \
218 lib/yang_translator.h \
219 lib/yang_wrappers.h \
220 lib/zassert.h \
221 lib/zclient.h \
222 lib/zebra.h \
223 lib/logicalrouter.h \
224 lib/lua.h \
225 lib/pbr.h \
226 # end
227
228
229 nodist_pkginclude_HEADERS += \
230 lib/route_types.h \
231 lib/version.h \
232 # end
233
234 noinst_HEADERS += \
235 lib/clippy.h \
236 lib/log_int.h \
237 lib/plist_int.h \
238 #end
239
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
251 #
252 # SNMP support
253 #
254 if SNMP
255 lib_LTLIBRARIES += lib/libfrrsnmp.la
256 endif
257
258 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
259 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
260 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
261 lib_libfrrsnmp_la_SOURCES = \
262 lib/agentx.c \
263 lib/snmp.c \
264 # end
265
266 #
267 # ZeroMQ support
268 #
269 if ZEROMQ
270 lib_LTLIBRARIES += lib/libfrrzmq.la
271 pkginclude_HEADERS += lib/frr_zmq.h
272 endif
273
274 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
275 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
276 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
277 lib_libfrrzmq_la_SOURCES = \
278 lib/frr_zmq.c \
279 #end
280
281 #
282 # Tail-f's ConfD support
283 #
284 if CONFD
285 module_LTLIBRARIES += lib/confd.la
286 endif
287
288 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
289 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
290 lib_confd_la_LIBADD = lib/libfrr.la -lconfd
291 lib_confd_la_SOURCES = lib/northbound_confd.c
292
293 #
294 # Sysrepo support
295 #
296 if SYSREPO
297 module_LTLIBRARIES += lib/sysrepo.la
298 endif
299
300 lib_sysrepo_la_CFLAGS = $(WERROR)
301 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
302 lib_sysrepo_la_LIBADD = lib/libfrr.la -lsysrepo
303 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
304
305 #
306 # CLI utilities
307 #
308 noinst_PROGRAMS += \
309 lib/grammar_sandbox \
310 # end
311
312 if BUILD_CLIPPY
313 noinst_PROGRAMS += lib/clippy
314 else
315 $(HOSTTOOLS)lib/clippy:
316 @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
317 endif
318
319 lib_grammar_sandbox_SOURCES = \
320 lib/grammar_sandbox_main.c
321 lib_grammar_sandbox_LDADD = \
322 lib/libfrr.la
323
324 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
325 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
326 lib_clippy_LDADD = $(PYTHON_LIBS)
327 lib_clippy_LDFLAGS = -export-dynamic
328 lib_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
340 # (global) clippy rules for all directories
341
342 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
343 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
344 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
345 am__v_CLIPPY_1 =
346
347 CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
348
349 SUFFIXES = _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) $<
360
361 #
362 # generated sources & extra foo
363 #
364 EXTRA_DIST += \
365 lib/command_lex.h \
366 lib/command_parse.h \
367 lib/gitversion.pl \
368 lib/route_types.pl \
369 lib/route_types.txt \
370 # end
371
372 BUILT_SOURCES += \
373 lib/gitversion.h \
374 lib/route_types.h \
375 # end
376
377 ## force route_types.h
378 $(lib_clippy_OBJECTS): lib/route_types.h
379 $(lib_libfrr_la_OBJECTS): lib/route_types.h
380
381 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
382
383 lib/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
386 lib/command_lex.lo: lib/command_parse.h
387 lib/command_parse.lo: lib/command_lex.h
388 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
389 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
390
391 lib/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 > $@
393 DISTCLEANFILES += lib/route_types.h
394
395 if 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
402 PHONY_GITVERSION=lib/gitversion.h.tmp
403 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
404 GITH=lib/gitversion.h
405 lib/gitversion.h.tmp: $(top_srcdir)/.git
406 @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
407 lib/gitversion.h: lib/gitversion.h.tmp
408 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
409
410 else
411 PHONY_GITVERSION=lib/gitversion.h
412 lib/gitversion.h:
413 true
414 endif
415 .PHONY: $(PHONY_GITVERSION)