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