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