summaryrefslogtreecommitdiffstats
path: root/lib/subdir.am
blob: 61dded05f86c288dd802101fc6c84b22b9619f3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
#
# libfrr
#
lib_LTLIBRARIES += lib/libfrr.la
lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB)

lib_libfrr_la_SOURCES = \
	lib/agg_table.c \
	lib/atomlist.c \
	lib/bfd.c \
	lib/buffer.c \
	lib/checksum.c \
	lib/command.c \
	lib/command_graph.c \
	lib/command_lex.l \
	lib/command_match.c \
	lib/command_parse.y \
	lib/csv.c \
	lib/debug.c \
	lib/distribute.c \
	lib/ferr.c \
	lib/filter.c \
	lib/frrlua.c \
	lib/frr_pthread.c \
	lib/frrstr.c \
	lib/getopt.c \
	lib/getopt1.c \
	lib/grammar_sandbox.c \
	lib/graph.c \
	lib/hash.c \
	lib/hook.c \
	lib/id_alloc.c \
	lib/if.c \
	lib/if_rmap.c \
	lib/imsg-buffer.c \
	lib/imsg.c \
	lib/jhash.c \
	lib/json.c \
	lib/keychain.c \
	lib/lib_errors.c \
	lib/libfrr.c \
	lib/linklist.c \
	lib/log.c \
	lib/md5.c \
	lib/memory.c \
	lib/memory_vty.c \
	lib/mlag.c \
	lib/module.c \
	lib/mpls.c \
	lib/network.c \
	lib/nexthop.c \
	lib/netns_linux.c \
	lib/netns_other.c \
	lib/nexthop_group.c \
	lib/northbound.c \
	lib/northbound_cli.c \
	lib/northbound_db.c \
	lib/openbsd-tree.c \
	lib/pid_output.c \
	lib/plist.c \
	lib/pqueue.c \
	lib/prefix.c \
	lib/privs.c \
	lib/ptm_lib.c \
	lib/qobj.c \
	lib/ringbuf.c \
	lib/routemap.c \
	lib/sbuf.c \
	lib/seqlock.c \
	lib/sha256.c \
	lib/sigevent.c \
	lib/skiplist.c \
	lib/sockopt.c \
	lib/sockunion.c \
	lib/spf_backoff.c \
	lib/srcdest_table.c \
	lib/stream.c \
	lib/strlcat.c \
	lib/strlcpy.c \
	lib/systemd.c \
	lib/table.c \
	lib/termtable.c \
	lib/thread.c \
	lib/typerb.c \
	lib/typesafe.c \
	lib/vector.c \
	lib/vrf.c \
	lib/vty.c \
	lib/wheel.c \
	lib/workqueue.c \
	lib/yang.c \
	lib/yang_translator.c \
	lib/yang_wrappers.c \
	lib/zclient.c \
	lib/logicalrouter.c \
	# end

nodist_lib_libfrr_la_SOURCES = \
	yang/frr-interface.yang.c \
	yang/frr-route-types.yang.c \
	yang/frr-module-translator.yang.c \
	# end

vtysh_scan += \
	$(top_srcdir)/lib/distribute.c \
	$(top_srcdir)/lib/filter.c \
	$(top_srcdir)/lib/if.c \
	$(top_srcdir)/lib/if_rmap.c \
	$(top_srcdir)/lib/keychain.c \
	$(top_srcdir)/lib/logicalrouter.c \
	$(top_srcdir)/lib/nexthop_group.c \
	$(top_srcdir)/lib/plist.c \
	$(top_srcdir)/lib/routemap.c \
	$(top_srcdir)/lib/vrf.c \
	$(top_srcdir)/lib/vty.c \
	# end
# can be loaded as DSO - always include for vtysh
vtysh_scan += $(top_srcdir)/lib/agentx.c

if SQLITE3
lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
lib_libfrr_la_SOURCES += lib/db.c
endif

lib/if_clippy.c: $(CLIPPY_DEPS)
lib/if.lo: lib/if_clippy.c
lib/plist_clippy.c: $(CLIPPY_DEPS)
lib/plist.lo: lib/plist_clippy.c
lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
lib/nexthop_group.lo: lib/nexthop_group_clippy.c
lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
lib/northbound_cli.lo: lib/northbound_cli_clippy.c
lib/vty_clippy.c: $(CLIPPY_DEPS)
lib/vty.lo: lib/vty_clippy.c

pkginclude_HEADERS += \
	lib/agg_table.h \
	lib/atomlist.h \
	lib/bfd.h \
	lib/bitfield.h \
	lib/buffer.h \
	lib/checksum.h \
	lib/mlag.h \
	lib/command.h \
	lib/command_graph.h \
	lib/command_match.h \
	lib/compiler.h \
	lib/csv.h \
	lib/db.h \
	lib/debug.h \
	lib/distribute.h \
	lib/ferr.h \
	lib/filter.h \
	lib/freebsd-queue.h \
	lib/frrlua.h \
	lib/frr_pthread.h \
	lib/frratomic.h \
	lib/frrstr.h \
	lib/getopt.h \
	lib/graph.h \
	lib/hash.h \
	lib/hook.h \
	lib/id_alloc.h \
	lib/if.h \
	lib/if_rmap.h \
	lib/imsg.h \
	lib/ipaddr.h \
	lib/jhash.h \
	lib/json.h \
	lib/keychain.h \
	lib/lib_errors.h \
	lib/libfrr.h \
	lib/libospf.h \
	lib/linklist.h \
	lib/log.h \
	lib/md5.h \
	lib/memory.h \
	lib/memory_vty.h \
	lib/module.h \
	lib/monotime.h \
	lib/mpls.h \
	lib/network.h \
	lib/nexthop.h \
	lib/nexthop_group.h \
	lib/northbound.h \
	lib/northbound_cli.h \
	lib/northbound_db.h \
	lib/ns.h \
	lib/openbsd-queue.h \
	lib/openbsd-tree.h \
	lib/plist.h \
	lib/pqueue.h \
	lib/prefix.h \
	lib/privs.h \
	lib/ptm_lib.h \
	lib/pw.h \
	lib/qobj.h \
	lib/queue.h \
	lib/ringbuf.h \
	lib/routemap.h \
	lib/sbuf.h \
	lib/seqlock.h \
	lib/sha256.h \
	lib/sigevent.h \
	lib/skiplist.h \
	lib/smux.h \
	lib/sockopt.h \
	lib/sockunion.h \
	lib/spf_backoff.h \
	lib/srcdest_table.h \
	lib/stream.h \
	lib/systemd.h \
	lib/table.h \
	lib/termtable.h \
	lib/thread.h \
	lib/typerb.h \
	lib/typesafe.h \
	lib/vector.h \
	lib/vlan.h \
	lib/vrf.h \
	lib/vrf_int.h \
	lib/vty.h \
	lib/vxlan.h \
	lib/wheel.h \
	lib/workqueue.h \
	lib/yang.h \
	lib/yang_translator.h \
	lib/yang_wrappers.h \
	lib/zassert.h \
	lib/zclient.h \
	lib/zebra.h \
	lib/logicalrouter.h \
	lib/pbr.h \
	# end


nodist_pkginclude_HEADERS += \
	lib/route_types.h \
	lib/version.h \
	# end

noinst_HEADERS += \
	lib/clippy.h \
	lib/log_int.h \
	lib/plist_int.h \
	#end

# General note about module and module helper library (libfrrsnmp, libfrrzmq)
# linking:  If we're linking libfrr statically into daemons, we *must* remove
# libfrr from modules because modules will always link it in dynamically and
# thus 2 copies of libfrr will be loaded... hilarity ensues.
#
# Not linking libfrr into modules should generally work fine because the
# executable refers to libfrr either way and the dynamic linker should make
# libfrr available to modules.  If some OS platform has a dynamic linker that
# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
# it's not linked into daemons statically.

#
# SNMP support
#
if SNMP
lib_LTLIBRARIES += lib/libfrrsnmp.la
endif

lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
lib_libfrrsnmp_la_SOURCES = \
	lib/agentx.c \
	lib/snmp.c \
	# end

#
# ZeroMQ support
#
if ZEROMQ
lib_LTLIBRARIES += lib/libfrrzmq.la
pkginclude_HEADERS += lib/frr_zmq.h
endif

lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
lib_libfrrzmq_la_SOURCES = \
	lib/frr_zmq.c \
	#end

#
# Tail-f's ConfD support
#
if CONFD
module_LTLIBRARIES += lib/confd.la
endif

lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
lib_confd_la_SOURCES = lib/northbound_confd.c

#
# Sysrepo support
#
if SYSREPO
module_LTLIBRARIES += lib/sysrepo.la
endif

lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c

#
# gRPC northbound plugin
#
if GRPC
module_LTLIBRARIES += lib/grpc.la
endif

lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
lib_grpc_la_SOURCES = lib/northbound_grpc.cpp

#
# CLI utilities
#
noinst_PROGRAMS += \
	lib/grammar_sandbox \
	# end

if BUILD_CLIPPY
noinst_PROGRAMS += lib/clippy
else
$(HOSTTOOLS)lib/clippy:
	@$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
endif

lib_grammar_sandbox_SOURCES = \
	lib/grammar_sandbox_main.c
lib_grammar_sandbox_LDADD = \
	lib/libfrr.la

lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
lib_clippy_LDADD = $(PYTHON_LIBS)
lib_clippy_LDFLAGS = -export-dynamic
lib_clippy_SOURCES = \
	lib/clippy.c \
	lib/command_graph.c \
	lib/command_lex.l \
	lib/command_parse.y \
	lib/command_py.c \
	lib/defun_lex.l \
	lib/graph.c \
	lib/memory.c \
	lib/vector.c \
	# end

# (global) clippy rules for all directories

AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
am__v_CLIPPY_0 = @echo "  CLIPPY  " $@;
am__v_CLIPPY_1 =

CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py

SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h .pb.cc .grpc.pb.cc
.c_clippy.c:
	@{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
		$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
	$(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<

## automake's "ylwrap" is a great piece of GNU software... not.
.l.c:
	$(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
.y.c:
	$(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<

#
# generated sources & extra foo
#
EXTRA_DIST += \
	lib/command_lex.h \
	lib/command_parse.h \
	lib/gitversion.pl \
	lib/route_types.pl \
	lib/route_types.txt \
	# end

BUILT_SOURCES += \
	lib/gitversion.h \
	lib/route_types.h \
	# end

## force route_types.h
$(lib_clippy_OBJECTS): lib/route_types.h
$(lib_libfrr_la_OBJECTS): lib/route_types.h

AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@

lib/command_lex.h: lib/command_lex.c
	@if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
lib/command_lex.lo: lib/command_parse.h
lib/command_parse.lo: lib/command_lex.h
lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h

lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
	$(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
DISTCLEANFILES += lib/route_types.h

if GIT_VERSION
# bit of a trick here to always have up-to-date git stamps without triggering
# unneccessary rebuilds.  .PHONY causes the .tmp file to be rebuilt always,
# but if we use that on gitversion.h it'll ripple through the .c file deps.
# (even if gitversion.h's file timestamp doesn't change, make will think it
# did, because of .PHONY...)

PHONY_GITVERSION=lib/gitversion.h.tmp
.SILENT: lib/gitversion.h lib/gitversion.h.tmp
GITH=lib/gitversion.h
lib/gitversion.h.tmp: $(top_srcdir)/.git
	$(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
lib/gitversion.h: lib/gitversion.h.tmp
	{ test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}

else
PHONY_GITVERSION=lib/gitversion.h
lib/gitversion.h:
	true
endif
.PHONY: $(PHONY_GITVERSION)