]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #4724 from satheeshkarra/pim_fixes
[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/qobj.c \
69 lib/ringbuf.c \
70 lib/routemap.c \
71 lib/sbuf.c \
72 lib/seqlock.c \
73 lib/sha256.c \
74 lib/sigevent.c \
75 lib/skiplist.c \
76 lib/sockopt.c \
77 lib/sockunion.c \
78 lib/spf_backoff.c \
79 lib/srcdest_table.c \
80 lib/stream.c \
81 lib/strlcat.c \
82 lib/strlcpy.c \
83 lib/systemd.c \
84 lib/table.c \
85 lib/termtable.c \
86 lib/thread.c \
87 lib/typerb.c \
88 lib/typesafe.c \
89 lib/vector.c \
90 lib/vrf.c \
91 lib/vty.c \
92 lib/wheel.c \
93 lib/workqueue.c \
94 lib/yang.c \
95 lib/yang_translator.c \
96 lib/yang_wrappers.c \
97 lib/zclient.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/nexthop_group.c \
116 $(top_srcdir)/lib/plist.c \
117 $(top_srcdir)/lib/routemap.c \
118 $(top_srcdir)/lib/vrf.c \
119 $(top_srcdir)/lib/vty.c \
120 # end
121 # can be loaded as DSO - always include for vtysh
122 vtysh_scan += $(top_srcdir)/lib/agentx.c
123
124 if SQLITE3
125 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
126 lib_libfrr_la_SOURCES += lib/db.c
127 endif
128
129 lib/if_clippy.c: $(CLIPPY_DEPS)
130 lib/if.lo: lib/if_clippy.c
131 lib/plist_clippy.c: $(CLIPPY_DEPS)
132 lib/plist.lo: lib/plist_clippy.c
133 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
134 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
135 lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
136 lib/northbound_cli.lo: lib/northbound_cli_clippy.c
137 lib/vty_clippy.c: $(CLIPPY_DEPS)
138 lib/vty.lo: lib/vty_clippy.c
139 lib/log_vty_clippy.c: $(CLIPPY_DEPS)
140 lib/log_vty.lo: lib/log_vty_clippy.c
141
142 pkginclude_HEADERS += \
143 lib/agg_table.h \
144 lib/atomlist.h \
145 lib/bfd.h \
146 lib/bitfield.h \
147 lib/buffer.h \
148 lib/checksum.h \
149 lib/mlag.h \
150 lib/command.h \
151 lib/command_graph.h \
152 lib/command_match.h \
153 lib/compiler.h \
154 lib/csv.h \
155 lib/db.h \
156 lib/debug.h \
157 lib/distribute.h \
158 lib/ferr.h \
159 lib/filter.h \
160 lib/freebsd-queue.h \
161 lib/frrlua.h \
162 lib/frr_pthread.h \
163 lib/frratomic.h \
164 lib/frrcu.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/pbr.h \
243 # end
244
245
246 nodist_pkginclude_HEADERS += \
247 lib/route_types.h \
248 lib/version.h \
249 # end
250
251 noinst_HEADERS += \
252 lib/clippy.h \
253 lib/log_int.h \
254 lib/plist_int.h \
255 lib/printf/printfcommon.h \
256 lib/printf/printflocal.h \
257 #end
258
259 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
260 # linking: If we're linking libfrr statically into daemons, we *must* remove
261 # libfrr from modules because modules will always link it in dynamically and
262 # thus 2 copies of libfrr will be loaded... hilarity ensues.
263 #
264 # Not linking libfrr into modules should generally work fine because the
265 # executable refers to libfrr either way and the dynamic linker should make
266 # libfrr available to modules. If some OS platform has a dynamic linker that
267 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
268 # it's not linked into daemons statically.
269
270 #
271 # SNMP support
272 #
273 if SNMP
274 lib_LTLIBRARIES += lib/libfrrsnmp.la
275 endif
276
277 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
278 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
279 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
280 lib_libfrrsnmp_la_SOURCES = \
281 lib/agentx.c \
282 lib/snmp.c \
283 # end
284
285 #
286 # c-ares support
287 #
288 if CARES
289 lib_LTLIBRARIES += lib/libfrrcares.la
290 pkginclude_HEADERS += lib/resolver.h
291 endif
292
293 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
294 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
295 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
296 lib_libfrrcares_la_SOURCES = \
297 lib/resolver.c \
298 #end
299
300 #
301 # ZeroMQ support
302 #
303 if ZEROMQ
304 lib_LTLIBRARIES += lib/libfrrzmq.la
305 pkginclude_HEADERS += lib/frr_zmq.h
306 endif
307
308 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
309 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
310 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
311 lib_libfrrzmq_la_SOURCES = \
312 lib/frr_zmq.c \
313 #end
314
315 #
316 # Tail-f's ConfD support
317 #
318 if CONFD
319 module_LTLIBRARIES += lib/confd.la
320 endif
321
322 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
323 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
324 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
325 lib_confd_la_SOURCES = lib/northbound_confd.c
326
327 #
328 # Sysrepo support
329 #
330 if SYSREPO
331 module_LTLIBRARIES += lib/sysrepo.la
332 endif
333
334 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
335 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
336 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
337 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
338
339 #
340 # gRPC northbound plugin
341 #
342 if GRPC
343 module_LTLIBRARIES += lib/grpc.la
344 endif
345
346 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
347 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
348 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
349 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
350
351 #
352 # CLI utilities
353 #
354 noinst_PROGRAMS += \
355 lib/grammar_sandbox \
356 # end
357
358 if BUILD_CLIPPY
359 noinst_PROGRAMS += lib/clippy
360 else
361 if HOSTTOOLS_CLIPPY
362 $(CLIPPY):
363 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
364 endif
365 endif
366
367 lib_grammar_sandbox_SOURCES = \
368 lib/grammar_sandbox_main.c
369 lib_grammar_sandbox_LDADD = \
370 lib/libfrr.la
371
372 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
373 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
374 lib_clippy_LDADD = $(PYTHON_LIBS)
375 lib_clippy_LDFLAGS = -export-dynamic
376 lib_clippy_SOURCES = \
377 lib/clippy.c \
378 lib/command_graph.c \
379 lib/command_lex.l \
380 lib/command_parse.y \
381 lib/command_py.c \
382 lib/defun_lex.l \
383 lib/graph.c \
384 lib/memory.c \
385 lib/vector.c \
386 # end
387
388 # (global) clippy rules for all directories
389
390 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
391 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
392 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
393 am__v_CLIPPY_1 =
394
395 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
396
397 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
398 .c_clippy.c:
399 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
400
401 ## automake's "ylwrap" is a great piece of GNU software... not.
402 .l.c:
403 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
404 .y.c:
405 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
406
407 #
408 # generated sources & extra foo
409 #
410 EXTRA_DIST += \
411 lib/command_lex.h \
412 lib/command_parse.h \
413 lib/gitversion.pl \
414 lib/route_types.pl \
415 lib/route_types.txt \
416 # end
417
418 BUILT_SOURCES += \
419 lib/gitversion.h \
420 lib/route_types.h \
421 # end
422
423 ## force route_types.h
424 $(lib_clippy_OBJECTS): lib/route_types.h
425 $(lib_libfrr_la_OBJECTS): lib/route_types.h
426
427 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
428
429 lib/command_lex.h: lib/command_lex.c
430 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
431 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
432 lib/command_lex.lo: lib/command_parse.h
433 lib/command_parse.lo: lib/command_lex.h
434 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
435 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
436 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
437 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
438
439 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
440 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
441 DISTCLEANFILES += lib/route_types.h
442
443 if GIT_VERSION
444 # bit of a trick here to always have up-to-date git stamps without triggering
445 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
446 # but if we use that on gitversion.h it'll ripple through the .c file deps.
447 # (even if gitversion.h's file timestamp doesn't change, make will think it
448 # did, because of .PHONY...)
449
450 PHONY_GITVERSION=lib/gitversion.h.tmp
451 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
452 GITH=lib/gitversion.h
453 lib/gitversion.h.tmp: $(top_srcdir)/.git
454 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
455 lib/gitversion.h: lib/gitversion.h.tmp
456 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
457
458 else
459 PHONY_GITVERSION=lib/gitversion.h
460 lib/gitversion.h:
461 true
462 endif
463 .PHONY: $(PHONY_GITVERSION)