]>
Commit | Line | Data |
---|---|---|
4a121f99 DL |
1 | # |
2 | # libfrr | |
3 | # | |
4 | lib_LTLIBRARIES += lib/libfrr.la | |
42efb0d4 | 5 | lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version |
2655e41f | 6 | lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(LIBM) |
4a121f99 DL |
7 | |
8 | lib_libfrr_la_SOURCES = \ | |
8e1f6512 | 9 | lib/agg_table.c \ |
bcea0c0f | 10 | lib/atomlist.c \ |
4a121f99 DL |
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 \ | |
aea03ad6 | 20 | lib/debug.c \ |
4a121f99 | 21 | lib/distribute.c \ |
3155489a | 22 | lib/ferr.c \ |
4a121f99 | 23 | lib/filter.c \ |
5dbb0a7b | 24 | lib/frrlua.c \ |
4a121f99 | 25 | lib/frr_pthread.c \ |
fe011935 | 26 | lib/frrstr.c \ |
4a121f99 DL |
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 \ | |
a94eca09 | 33 | lib/id_alloc.c \ |
4a121f99 DL |
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 \ | |
b66d022e | 41 | lib/lib_errors.c \ |
4a121f99 DL |
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 \ | |
6edbb8b2 | 48 | lib/mlag.c \ |
4a121f99 | 49 | lib/module.c \ |
036fdaad | 50 | lib/mpls.c \ |
4a121f99 DL |
51 | lib/network.c \ |
52 | lib/nexthop.c \ | |
e26aedbe PG |
53 | lib/netns_linux.c \ |
54 | lib/netns_other.c \ | |
7ee30f28 | 55 | lib/nexthop_group.c \ |
1c2facd1 RW |
56 | lib/northbound.c \ |
57 | lib/northbound_cli.c \ | |
58 | lib/northbound_db.c \ | |
e128c002 | 59 | lib/ntop.c \ |
4a121f99 DL |
60 | lib/openbsd-tree.c \ |
61 | lib/pid_output.c \ | |
62 | lib/plist.c \ | |
7629b6b7 | 63 | lib/pqueue.c \ |
4a121f99 DL |
64 | lib/prefix.c \ |
65 | lib/privs.c \ | |
66 | lib/ptm_lib.c \ | |
67 | lib/qobj.c \ | |
5318d896 | 68 | lib/ringbuf.c \ |
4a121f99 | 69 | lib/routemap.c \ |
31bfa062 | 70 | lib/sbuf.c \ |
440d5faa | 71 | lib/seqlock.c \ |
4a121f99 DL |
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 \ | |
80911bc2 | 86 | lib/typerb.c \ |
abd71baa | 87 | lib/typesafe.c \ |
4a121f99 DL |
88 | lib/vector.c \ |
89 | lib/vrf.c \ | |
90 | lib/vty.c \ | |
91 | lib/wheel.c \ | |
92 | lib/workqueue.c \ | |
1c2facd1 RW |
93 | lib/yang.c \ |
94 | lib/yang_translator.c \ | |
95 | lib/yang_wrappers.c \ | |
4a121f99 | 96 | lib/zclient.c \ |
e26aedbe | 97 | lib/logicalrouter.c \ |
5c25bd87 DL |
98 | lib/printf/printf-pos.c \ |
99 | lib/printf/vfprintf.c \ | |
100 | lib/printf/glue.c \ | |
4a121f99 DL |
101 | # end |
102 | ||
3a11599c DL |
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 | ||
74dc19a2 DL |
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 | ||
1c2facd1 | 125 | if SQLITE3 |
fdbd8086 | 126 | lib_libfrr_la_LIBADD += $(SQLITE3_LIBS) |
1c2facd1 RW |
127 | lib_libfrr_la_SOURCES += lib/db.c |
128 | endif | |
129 | ||
8f90d89b RW |
130 | lib/if_clippy.c: $(CLIPPY_DEPS) |
131 | lib/if.lo: lib/if_clippy.c | |
f1b32b2e | 132 | lib/plist_clippy.c: $(CLIPPY_DEPS) |
4a121f99 | 133 | lib/plist.lo: lib/plist_clippy.c |
dba32923 DS |
134 | lib/nexthop_group_clippy.c: $(CLIPPY_DEPS) |
135 | lib/nexthop_group.lo: lib/nexthop_group_clippy.c | |
1c2facd1 RW |
136 | lib/northbound_cli_clippy.c: $(CLIPPY_DEPS) |
137 | lib/northbound_cli.lo: lib/northbound_cli_clippy.c | |
2950f5da DS |
138 | lib/vty_clippy.c: $(CLIPPY_DEPS) |
139 | lib/vty.lo: lib/vty_clippy.c | |
4a121f99 DL |
140 | |
141 | pkginclude_HEADERS += \ | |
8e1f6512 | 142 | lib/agg_table.h \ |
bcea0c0f | 143 | lib/atomlist.h \ |
4a121f99 DL |
144 | lib/bfd.h \ |
145 | lib/bitfield.h \ | |
146 | lib/buffer.h \ | |
147 | lib/checksum.h \ | |
14beb548 | 148 | lib/mlag.h \ |
4a121f99 DL |
149 | lib/command.h \ |
150 | lib/command_graph.h \ | |
151 | lib/command_match.h \ | |
de1a880c | 152 | lib/compiler.h \ |
4a121f99 | 153 | lib/csv.h \ |
1c2facd1 | 154 | lib/db.h \ |
aea03ad6 | 155 | lib/debug.h \ |
4a121f99 | 156 | lib/distribute.h \ |
3155489a | 157 | lib/ferr.h \ |
4a121f99 | 158 | lib/filter.h \ |
cd85bc2e | 159 | lib/freebsd-queue.h \ |
5dbb0a7b | 160 | lib/frrlua.h \ |
4a121f99 DL |
161 | lib/frr_pthread.h \ |
162 | lib/frratomic.h \ | |
fe011935 | 163 | lib/frrstr.h \ |
4a121f99 DL |
164 | lib/getopt.h \ |
165 | lib/graph.h \ | |
166 | lib/hash.h \ | |
167 | lib/hook.h \ | |
17136bf2 | 168 | lib/iana_afi.h \ |
a94eca09 | 169 | lib/id_alloc.h \ |
4a121f99 DL |
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 \ | |
b66d022e | 177 | lib/lib_errors.h \ |
4a121f99 DL |
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 \ | |
7ee30f28 | 190 | lib/nexthop_group.h \ |
1c2facd1 RW |
191 | lib/northbound.h \ |
192 | lib/northbound_cli.h \ | |
193 | lib/northbound_db.h \ | |
4a121f99 DL |
194 | lib/ns.h \ |
195 | lib/openbsd-queue.h \ | |
196 | lib/openbsd-tree.h \ | |
197 | lib/plist.h \ | |
7629b6b7 | 198 | lib/pqueue.h \ |
4a121f99 | 199 | lib/prefix.h \ |
5c25bd87 | 200 | lib/printfrr.h \ |
4a121f99 DL |
201 | lib/privs.h \ |
202 | lib/ptm_lib.h \ | |
6833ae01 | 203 | lib/pw.h \ |
4a121f99 | 204 | lib/qobj.h \ |
cd85bc2e | 205 | lib/queue.h \ |
5318d896 | 206 | lib/ringbuf.h \ |
4a121f99 | 207 | lib/routemap.h \ |
31bfa062 | 208 | lib/sbuf.h \ |
440d5faa | 209 | lib/seqlock.h \ |
4a121f99 DL |
210 | lib/sha256.h \ |
211 | lib/sigevent.h \ | |
212 | lib/skiplist.h \ | |
98ea5be8 | 213 | lib/smux.h \ |
4a121f99 DL |
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 \ | |
80911bc2 | 223 | lib/typerb.h \ |
abd71baa | 224 | lib/typesafe.h \ |
4a121f99 | 225 | lib/vector.h \ |
4a121f99 DL |
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 \ | |
1c2facd1 RW |
233 | lib/yang.h \ |
234 | lib/yang_translator.h \ | |
235 | lib/yang_wrappers.h \ | |
4a121f99 DL |
236 | lib/zassert.h \ |
237 | lib/zclient.h \ | |
238 | lib/zebra.h \ | |
e26aedbe | 239 | lib/logicalrouter.h \ |
0031a6bb | 240 | lib/pbr.h \ |
4a121f99 DL |
241 | # end |
242 | ||
58f8a9ec | 243 | |
70d27c5b DL |
244 | nodist_pkginclude_HEADERS += \ |
245 | lib/route_types.h \ | |
246 | lib/version.h \ | |
247 | # end | |
248 | ||
4a121f99 DL |
249 | noinst_HEADERS += \ |
250 | lib/clippy.h \ | |
251 | lib/log_int.h \ | |
252 | lib/plist_int.h \ | |
5c25bd87 DL |
253 | lib/printf/printfcommon.h \ |
254 | lib/printf/printflocal.h \ | |
4a121f99 DL |
255 | #end |
256 | ||
d6e76257 DL |
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 | ||
4a121f99 DL |
268 | # |
269 | # SNMP support | |
270 | # | |
271 | if SNMP | |
272 | lib_LTLIBRARIES += lib/libfrrsnmp.la | |
273 | endif | |
274 | ||
7aad1594 | 275 | lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99 |
4a121f99 | 276 | lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0 |
d6e76257 | 277 | lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS) |
4a121f99 DL |
278 | lib_libfrrsnmp_la_SOURCES = \ |
279 | lib/agentx.c \ | |
4a121f99 DL |
280 | lib/snmp.c \ |
281 | # end | |
282 | ||
b6116506 DL |
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 | |
d6e76257 | 293 | lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS) |
b6116506 DL |
294 | lib_libfrrzmq_la_SOURCES = \ |
295 | lib/frr_zmq.c \ | |
296 | #end | |
297 | ||
5bce33b3 RW |
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 | |
fdbd8086 | 307 | lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS) |
5bce33b3 RW |
308 | lib_confd_la_SOURCES = lib/northbound_confd.c |
309 | ||
a7ca2199 RW |
310 | # |
311 | # Sysrepo support | |
312 | # | |
313 | if SYSREPO | |
314 | module_LTLIBRARIES += lib/sysrepo.la | |
315 | endif | |
316 | ||
fdbd8086 | 317 | lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS) |
a7ca2199 | 318 | lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic |
fdbd8086 | 319 | lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS) |
a7ca2199 RW |
320 | lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c |
321 | ||
ec2ac5f2 RW |
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 | ||
4a121f99 DL |
334 | # |
335 | # CLI utilities | |
336 | # | |
337 | noinst_PROGRAMS += \ | |
4a121f99 DL |
338 | lib/grammar_sandbox \ |
339 | # end | |
340 | ||
89727c8d DL |
341 | if BUILD_CLIPPY |
342 | noinst_PROGRAMS += lib/clippy | |
343 | else | |
a71c5039 DL |
344 | if HOSTTOOLS_CLIPPY |
345 | $(CLIPPY): | |
346 | @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy | |
347 | endif | |
89727c8d DL |
348 | endif |
349 | ||
4a121f99 DL |
350 | lib_grammar_sandbox_SOURCES = \ |
351 | lib/grammar_sandbox_main.c | |
352 | lib_grammar_sandbox_LDADD = \ | |
353 | lib/libfrr.la | |
354 | ||
dbac691d DL |
355 | lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY |
356 | lib_clippy_CFLAGS = $(PYTHON_CFLAGS) | |
4a121f99 | 357 | lib_clippy_LDADD = $(PYTHON_LIBS) |
dbac691d | 358 | lib_clippy_LDFLAGS = -export-dynamic |
4a121f99 DL |
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 | ||
aad24c5b DL |
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 | ||
a71c5039 | 378 | CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py |
aad24c5b | 379 | |
ec2ac5f2 | 380 | SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc |
aad24c5b | 381 | .c_clippy.c: |
a71c5039 | 382 | $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $< |
aad24c5b DL |
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) $< | |
4a121f99 DL |
389 | |
390 | # | |
391 | # generated sources & extra foo | |
392 | # | |
393 | EXTRA_DIST += \ | |
394 | lib/command_lex.h \ | |
70d27c5b | 395 | lib/command_parse.h \ |
4a121f99 | 396 | lib/gitversion.pl \ |
4a121f99 DL |
397 | lib/route_types.pl \ |
398 | lib/route_types.txt \ | |
399 | # end | |
400 | ||
401 | BUILT_SOURCES += \ | |
4a121f99 DL |
402 | lib/gitversion.h \ |
403 | lib/route_types.h \ | |
404 | # end | |
405 | ||
f1b32b2e DL |
406 | ## force route_types.h |
407 | $(lib_clippy_OBJECTS): lib/route_types.h | |
408 | $(lib_libfrr_la_OBJECTS): lib/route_types.h | |
409 | ||
4a121f99 DL |
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 | |
f1b32b2e | 415 | lib/command_lex.lo: lib/command_parse.h |
4a121f99 | 416 | lib/command_parse.lo: lib/command_lex.h |
fdbd8086 DL |
417 | lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h |
418 | lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h | |
f1b32b2e | 419 | lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h |
4a121f99 DL |
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 | |
fdbd8086 | 423 | $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@ |
67cf020d | 424 | DISTCLEANFILES += lib/route_types.h |
4a121f99 DL |
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 | ||
9e53b315 | 433 | PHONY_GITVERSION=lib/gitversion.h.tmp |
4a121f99 DL |
434 | .SILENT: lib/gitversion.h lib/gitversion.h.tmp |
435 | GITH=lib/gitversion.h | |
436 | lib/gitversion.h.tmp: $(top_srcdir)/.git | |
fdbd8086 | 437 | $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp |
4a121f99 | 438 | lib/gitversion.h: lib/gitversion.h.tmp |
bd402424 | 439 | { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH} |
4a121f99 DL |
440 | |
441 | else | |
9e53b315 | 442 | PHONY_GITVERSION=lib/gitversion.h |
4a121f99 DL |
443 | lib/gitversion.h: |
444 | true | |
445 | endif | |
9e53b315 | 446 | .PHONY: $(PHONY_GITVERSION) |