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