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