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