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