]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #8008 from chiragshah6/yang_nb5
[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) $(UST_LIBS) $(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/defaults.c \
22 lib/distribute.c \
23 lib/ferr.c \
24 lib/filter.c \
25 lib/filter_cli.c \
26 lib/filter_nb.c \
27 lib/frrcu.c \
28 lib/frrlua.c \
29 lib/frrscript.c \
30 lib/frr_pthread.c \
31 lib/frrstr.c \
32 lib/getopt.c \
33 lib/getopt1.c \
34 lib/grammar_sandbox.c \
35 lib/graph.c \
36 lib/hash.c \
37 lib/hook.c \
38 lib/id_alloc.c \
39 lib/if.c \
40 lib/if_rmap.c \
41 lib/imsg-buffer.c \
42 lib/imsg.c \
43 lib/jhash.c \
44 lib/json.c \
45 lib/keychain.c \
46 lib/ldp_sync.c \
47 lib/lib_errors.c \
48 lib/lib_vty.c \
49 lib/libfrr.c \
50 lib/libfrr_trace.c \
51 lib/linklist.c \
52 lib/link_state.c \
53 lib/log.c \
54 lib/log_filter.c \
55 lib/log_vty.c \
56 lib/md5.c \
57 lib/memory.c \
58 lib/mlag.c \
59 lib/module.c \
60 lib/mpls.c \
61 lib/srv6.c \
62 lib/network.c \
63 lib/nexthop.c \
64 lib/netns_linux.c \
65 lib/netns_other.c \
66 lib/nexthop_group.c \
67 lib/northbound.c \
68 lib/northbound_cli.c \
69 lib/northbound_db.c \
70 lib/ntop.c \
71 lib/openbsd-tree.c \
72 lib/pid_output.c \
73 lib/plist.c \
74 lib/prefix.c \
75 lib/privs.c \
76 lib/ptm_lib.c \
77 lib/pullwr.c \
78 lib/qobj.c \
79 lib/ringbuf.c \
80 lib/routemap.c \
81 lib/routemap_cli.c \
82 lib/routemap_northbound.c \
83 lib/sbuf.c \
84 lib/seqlock.c \
85 lib/sha256.c \
86 lib/sigevent.c \
87 lib/skiplist.c \
88 lib/sockopt.c \
89 lib/sockunion.c \
90 lib/spf_backoff.c \
91 lib/srcdest_table.c \
92 lib/stream.c \
93 lib/strlcat.c \
94 lib/strlcpy.c \
95 lib/systemd.c \
96 lib/table.c \
97 lib/termtable.c \
98 lib/thread.c \
99 lib/typerb.c \
100 lib/typesafe.c \
101 lib/vector.c \
102 lib/vrf.c \
103 lib/vty.c \
104 lib/wheel.c \
105 lib/workqueue.c \
106 lib/xref.c \
107 lib/yang.c \
108 lib/yang_translator.c \
109 lib/yang_wrappers.c \
110 lib/zclient.c \
111 lib/zlog.c \
112 lib/zlog_targets.c \
113 lib/printf/printf-pos.c \
114 lib/printf/vfprintf.c \
115 lib/printf/glue.c \
116 lib/routing_nb.c \
117 lib/routing_nb_config.c \
118 # end
119
120 nodist_lib_libfrr_la_SOURCES = \
121 yang/frr-filter.yang.c \
122 yang/frr-interface.yang.c \
123 yang/frr-route-map.yang.c \
124 yang/frr-route-types.yang.c \
125 yang/frr-vrf.yang.c \
126 yang/frr-routing.yang.c \
127 yang/frr-nexthop.yang.c \
128 yang/ietf/ietf-routing-types.yang.c \
129 yang/ietf/ietf-interfaces.yang.c \
130 yang/ietf/ietf-bgp-types.yang.c \
131 yang/frr-module-translator.yang.c \
132 yang/frr-nexthop.yang.c \
133 # end
134
135 vtysh_scan += \
136 lib/distribute.c \
137 lib/filter.c \
138 lib/filter_cli.c \
139 lib/if.c \
140 lib/if_rmap.c \
141 lib/keychain.c \
142 lib/lib_vty.c \
143 lib/nexthop_group.c \
144 lib/plist.c \
145 lib/routemap.c \
146 lib/routemap_cli.c \
147 lib/vrf.c \
148 lib/vty.c \
149 # end
150 # can be loaded as DSO - always include for vtysh
151 vtysh_scan += lib/agentx.c
152
153 if SQLITE3
154 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
155 lib_libfrr_la_SOURCES += lib/db.c
156 endif
157
158 clippy_scan += \
159 lib/if.c \
160 lib/filter_cli.c \
161 lib/log_vty.c \
162 lib/nexthop_group.c \
163 lib/northbound_cli.c \
164 lib/plist.c \
165 lib/routemap_cli.c \
166 lib/vty.c \
167 # end
168
169 pkginclude_HEADERS += \
170 lib/agg_table.h \
171 lib/atomlist.h \
172 lib/bfd.h \
173 lib/bitfield.h \
174 lib/buffer.h \
175 lib/checksum.h \
176 lib/mlag.h \
177 lib/command.h \
178 lib/command_graph.h \
179 lib/command_match.h \
180 lib/compiler.h \
181 lib/csv.h \
182 lib/db.h \
183 lib/debug.h \
184 lib/defaults.h \
185 lib/distribute.h \
186 lib/ferr.h \
187 lib/filter.h \
188 lib/freebsd-queue.h \
189 lib/frrlua.h \
190 lib/frrscript.h \
191 lib/frr_pthread.h \
192 lib/frratomic.h \
193 lib/frrcu.h \
194 lib/frrstr.h \
195 lib/getopt.h \
196 lib/graph.h \
197 lib/hash.h \
198 lib/hook.h \
199 lib/iana_afi.h \
200 lib/id_alloc.h \
201 lib/if.h \
202 lib/if_rmap.h \
203 lib/imsg.h \
204 lib/ipaddr.h \
205 lib/jhash.h \
206 lib/json.h \
207 lib/keychain.h \
208 lib/ldp_sync.h \
209 lib/lib_errors.h \
210 lib/lib_vty.h \
211 lib/libfrr.h \
212 lib/libfrr_trace.h \
213 lib/libospf.h \
214 lib/linklist.h \
215 lib/link_state.h \
216 lib/log.h \
217 lib/log_vty.h \
218 lib/md5.h \
219 lib/memory.h \
220 lib/module.h \
221 lib/monotime.h \
222 lib/mpls.h \
223 lib/srv6.h \
224 lib/network.h \
225 lib/nexthop.h \
226 lib/nexthop_group.h \
227 lib/nexthop_group_private.h \
228 lib/northbound.h \
229 lib/northbound_cli.h \
230 lib/northbound_db.h \
231 lib/ns.h \
232 lib/openbsd-queue.h \
233 lib/openbsd-tree.h \
234 lib/plist.h \
235 lib/prefix.h \
236 lib/printfrr.h \
237 lib/privs.h \
238 lib/ptm_lib.h \
239 lib/pullwr.h \
240 lib/pw.h \
241 lib/qobj.h \
242 lib/queue.h \
243 lib/ringbuf.h \
244 lib/routemap.h \
245 lib/sbuf.h \
246 lib/seqlock.h \
247 lib/sha256.h \
248 lib/sigevent.h \
249 lib/skiplist.h \
250 lib/smux.h \
251 lib/sockopt.h \
252 lib/sockunion.h \
253 lib/spf_backoff.h \
254 lib/srcdest_table.h \
255 lib/srte.h \
256 lib/stream.h \
257 lib/systemd.h \
258 lib/table.h \
259 lib/termtable.h \
260 lib/thread.h \
261 lib/trace.h \
262 lib/typerb.h \
263 lib/typesafe.h \
264 lib/vector.h \
265 lib/vlan.h \
266 lib/vrf.h \
267 lib/vrf_int.h \
268 lib/vty.h \
269 lib/vxlan.h \
270 lib/wheel.h \
271 lib/workqueue.h \
272 lib/xref.h \
273 lib/yang.h \
274 lib/yang_translator.h \
275 lib/yang_wrappers.h \
276 lib/zassert.h \
277 lib/zclient.h \
278 lib/zebra.h \
279 lib/zlog.h \
280 lib/zlog_targets.h \
281 lib/pbr.h \
282 lib/routing_nb.h \
283 # end
284
285
286 nodist_pkginclude_HEADERS += \
287 lib/route_types.h \
288 lib/version.h \
289 # end
290
291 noinst_HEADERS += \
292 lib/clippy.h \
293 lib/plist_int.h \
294 lib/printf/printfcommon.h \
295 lib/printf/printflocal.h \
296 #end
297
298 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
299 # linking: If we're linking libfrr statically into daemons, we *must* remove
300 # libfrr from modules because modules will always link it in dynamically and
301 # thus 2 copies of libfrr will be loaded... hilarity ensues.
302 #
303 # Not linking libfrr into modules should generally work fine because the
304 # executable refers to libfrr either way and the dynamic linker should make
305 # libfrr available to modules. If some OS platform has a dynamic linker that
306 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
307 # it's not linked into daemons statically.
308
309 #
310 # SNMP support
311 #
312 if SNMP
313 lib_LTLIBRARIES += lib/libfrrsnmp.la
314 endif
315
316 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
317 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
318 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
319 lib_libfrrsnmp_la_SOURCES = \
320 lib/agentx.c \
321 lib/snmp.c \
322 # end
323
324 #
325 # c-ares support
326 #
327 if CARES
328 lib_LTLIBRARIES += lib/libfrrcares.la
329 pkginclude_HEADERS += lib/resolver.h
330 endif
331
332 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
333 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
334 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
335 lib_libfrrcares_la_SOURCES = \
336 lib/resolver.c \
337 #end
338
339 #
340 # ZeroMQ support
341 #
342 if ZEROMQ
343 lib_LTLIBRARIES += lib/libfrrzmq.la
344 pkginclude_HEADERS += lib/frr_zmq.h
345 endif
346
347 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
348 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
349 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
350 lib_libfrrzmq_la_SOURCES = \
351 lib/frr_zmq.c \
352 #end
353
354 #
355 # Tail-f's ConfD support
356 #
357 if CONFD
358 module_LTLIBRARIES += lib/confd.la
359 endif
360
361 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
362 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
363 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
364 lib_confd_la_SOURCES = lib/northbound_confd.c
365
366 #
367 # Sysrepo support
368 #
369 if SYSREPO
370 module_LTLIBRARIES += lib/sysrepo.la
371 endif
372
373 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
374 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
375 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
376 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
377
378 #
379 # gRPC northbound plugin
380 #
381 if GRPC
382 module_LTLIBRARIES += lib/grpc.la
383 endif
384
385 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
386 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
387 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
388 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
389
390 #
391 # CLI utilities
392 #
393 noinst_PROGRAMS += \
394 lib/grammar_sandbox \
395 # end
396
397 if BUILD_CLIPPY
398 noinst_PROGRAMS += lib/clippy
399 else
400 if HOSTTOOLS_CLIPPY
401 $(CLIPPY):
402 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
403 endif
404 endif
405
406 lib_grammar_sandbox_SOURCES = \
407 lib/grammar_sandbox_main.c
408 lib_grammar_sandbox_LDADD = \
409 lib/libfrr.la
410
411 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
412 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
413 lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
414 lib_clippy_LDFLAGS = -export-dynamic
415 lib_clippy_SOURCES = \
416 lib/jhash.c \
417 lib/clippy.c \
418 lib/command_graph.c \
419 lib/command_lex.l \
420 lib/command_parse.y \
421 lib/command_py.c \
422 lib/defun_lex.l \
423 lib/elf_py.c \
424 lib/graph.c \
425 lib/libfrr_trace.c \
426 lib/memory.c \
427 lib/typesafe.c \
428 lib/vector.c \
429 # end
430
431 # (global) clippy rules for all directories
432
433 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
434 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
435 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
436 am__v_CLIPPY_1 =
437
438 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
439
440 SUFFIXES += _clippy.c
441 .c_clippy.c:
442 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
443
444 # xrelfo, the ELF xref extractor
445
446 AM_V_XRELFO = $(am__v_XRELFO_$(V))
447 am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
448 am__v_XRELFO_0 = @echo " XRELFO " $@;
449 am__v_XRELFO_1 =
450
451 if DEV_BUILD
452 XRELFO_FLAGS = -Wlog-format -Wlog-args
453 else
454 XRELFO_FLAGS =
455 endif
456
457 SUFFIXES += .xref
458 %.xref: % $(CLIPPY)
459 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(XRELFO_FLAGS) -o $@ $<
460
461 # dependencies added in python/makefile.py
462 frr.xref:
463 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^
464 all-am: frr.xref
465
466 clean-xref:
467 -rm -rf $(xrefs) frr.xref
468 clean-local: clean-xref
469
470 ## automake's "ylwrap" is a great piece of GNU software... not.
471 .l.c:
472 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
473 .y.c:
474 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
475
476 #
477 # generated sources & extra foo
478 #
479 EXTRA_DIST += \
480 lib/command_lex.h \
481 lib/command_parse.h \
482 lib/gitversion.pl \
483 lib/route_types.pl \
484 lib/route_types.txt \
485 # end
486
487 BUILT_SOURCES += \
488 lib/gitversion.h \
489 lib/route_types.h \
490 # end
491
492 ## force route_types.h
493 $(lib_clippy_OBJECTS): lib/route_types.h
494 $(lib_libfrr_la_OBJECTS): lib/route_types.h
495
496 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
497
498 lib/command_lex.h: lib/command_lex.c
499 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
500 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
501 lib/command_lex.lo: lib/command_parse.h
502 lib/command_parse.lo: lib/command_lex.h
503 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
504 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
505 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
506 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
507
508 rt_enabled =
509
510 if BABELD
511 rt_enabled += --enabled babeld
512 endif
513 if BFDD
514 rt_enabled += --enabled bfdd
515 endif
516 if BGPD
517 rt_enabled += --enabled bgpd
518 if ENABLE_BGP_VNC
519 rt_enabled += --enabled bgpd-vnc
520 endif
521 endif
522 if EIGRPD
523 rt_enabled += --enabled eigrpd
524 endif
525 if ISISD
526 rt_enabled += --enabled isisd
527 endif
528 if FABRICD
529 rt_enabled += --enabled fabricd
530 endif
531 if LDPD
532 rt_enabled += --enabled ldpd
533 endif
534 if NHRPD
535 rt_enabled += --enabled nhrpd
536 endif
537 if OSPFD
538 rt_enabled += --enabled ospfd
539 endif
540 if OSPF6D
541 rt_enabled += --enabled ospf6d
542 endif
543 if PBRD
544 rt_enabled += --enabled pbrd
545 endif
546 if PIMD
547 rt_enabled += --enabled pimd
548 endif
549 if RIPD
550 rt_enabled += --enabled ripd
551 endif
552 if RIPNGD
553 rt_enabled += --enabled ripngd
554 endif
555 if SHARPD
556 rt_enabled += --enabled sharpd
557 endif
558 if ZEBRA
559 rt_enabled += --enabled zebra
560 endif
561
562 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
563 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
564 DISTCLEANFILES += lib/route_types.h
565
566 if GIT_VERSION
567 # bit of a trick here to always have up-to-date git stamps without triggering
568 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
569 # but if we use that on gitversion.h it'll ripple through the .c file deps.
570 # (even if gitversion.h's file timestamp doesn't change, make will think it
571 # did, because of .PHONY...)
572
573 PHONY_GITVERSION=lib/gitversion.h.tmp
574 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
575 GITH=lib/gitversion.h
576 lib/gitversion.h.tmp: $(top_srcdir)/.git
577 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
578 lib/gitversion.h: lib/gitversion.h.tmp
579 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
580
581 else
582 PHONY_GITVERSION=lib/gitversion.h
583 lib/gitversion.h:
584 true
585 endif
586 .PHONY: $(PHONY_GITVERSION)