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