]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
Merge pull request #3116 from opensourcerouting/libfrr-exec
[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@
7
8 lib_libfrr_la_SOURCES = \
9 lib/agg_table.c \
10 lib/bfd.c \
11 lib/buffer.c \
12 lib/checksum.c \
13 lib/command.c \
14 lib/command_graph.c \
15 lib/command_lex.l \
16 lib/command_match.c \
17 lib/command_parse.y \
18 lib/csv.c \
19 lib/debug.c \
20 lib/distribute.c \
21 lib/event_counter.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/if.c \
33 lib/if_rmap.c \
34 lib/imsg-buffer.c \
35 lib/imsg.c \
36 lib/jhash.c \
37 lib/json.c \
38 lib/keychain.c \
39 lib/lib_errors.c \
40 lib/libfrr.c \
41 lib/linklist.c \
42 lib/log.c \
43 lib/md5.c \
44 lib/memory.c \
45 lib/memory_vty.c \
46 lib/module.c \
47 lib/mpls.c \
48 lib/network.c \
49 lib/nexthop.c \
50 lib/netns_linux.c \
51 lib/netns_other.c \
52 lib/nexthop_group.c \
53 lib/openbsd-tree.c \
54 lib/pid_output.c \
55 lib/plist.c \
56 lib/pqueue.c \
57 lib/prefix.c \
58 lib/privs.c \
59 lib/ptm_lib.c \
60 lib/qobj.c \
61 lib/ringbuf.c \
62 lib/routemap.c \
63 lib/sbuf.c \
64 lib/sha256.c \
65 lib/sigevent.c \
66 lib/skiplist.c \
67 lib/sockopt.c \
68 lib/sockunion.c \
69 lib/spf_backoff.c \
70 lib/srcdest_table.c \
71 lib/stream.c \
72 lib/strlcat.c \
73 lib/strlcpy.c \
74 lib/systemd.c \
75 lib/table.c \
76 lib/termtable.c \
77 lib/thread.c \
78 lib/vector.c \
79 lib/vrf.c \
80 lib/vty.c \
81 lib/wheel.c \
82 lib/workqueue.c \
83 lib/zclient.c \
84 lib/logicalrouter.c \
85 lib/lua.c \
86 # end
87
88 vtysh_scan += \
89 $(top_srcdir)/lib/distribute.c \
90 $(top_srcdir)/lib/filter.c \
91 $(top_srcdir)/lib/if.c \
92 $(top_srcdir)/lib/if_rmap.c \
93 $(top_srcdir)/lib/keychain.c \
94 $(top_srcdir)/lib/logicalrouter.c \
95 $(top_srcdir)/lib/nexthop_group.c \
96 $(top_srcdir)/lib/plist.c \
97 $(top_srcdir)/lib/routemap.c \
98 $(top_srcdir)/lib/vrf.c \
99 $(top_srcdir)/lib/vty.c \
100 # end
101 # can be loaded as DSO - always include for vtysh
102 vtysh_scan += $(top_srcdir)/lib/agentx.c
103
104 lib/plist_clippy.c: $(CLIPPY_DEPS)
105 lib/plist.lo: lib/plist_clippy.c
106 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
107 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
108
109 pkginclude_HEADERS += \
110 lib/agg_table.h \
111 lib/bfd.h \
112 lib/bitfield.h \
113 lib/buffer.h \
114 lib/checksum.h \
115 lib/command.h \
116 lib/command_graph.h \
117 lib/command_match.h \
118 lib/compiler.h \
119 lib/csv.h \
120 lib/debug.h \
121 lib/distribute.h \
122 lib/event_counter.h \
123 lib/ferr.h \
124 lib/fifo.h \
125 lib/filter.h \
126 lib/freebsd-queue.h \
127 lib/frr_pthread.h \
128 lib/frratomic.h \
129 lib/frrstr.h \
130 lib/getopt.h \
131 lib/graph.h \
132 lib/hash.h \
133 lib/hook.h \
134 lib/if.h \
135 lib/if_rmap.h \
136 lib/imsg.h \
137 lib/ipaddr.h \
138 lib/jhash.h \
139 lib/json.h \
140 lib/keychain.h \
141 lib/lib_errors.h \
142 lib/libfrr.h \
143 lib/libospf.h \
144 lib/linklist.h \
145 lib/log.h \
146 lib/md5.h \
147 lib/memory.h \
148 lib/memory_vty.h \
149 lib/module.h \
150 lib/monotime.h \
151 lib/mpls.h \
152 lib/network.h \
153 lib/nexthop.h \
154 lib/nexthop_group.h \
155 lib/ns.h \
156 lib/openbsd-queue.h \
157 lib/openbsd-tree.h \
158 lib/plist.h \
159 lib/pqueue.h \
160 lib/prefix.h \
161 lib/privs.h \
162 lib/ptm_lib.h \
163 lib/pw.h \
164 lib/qobj.h \
165 lib/queue.h \
166 lib/ringbuf.h \
167 lib/routemap.h \
168 lib/sbuf.h \
169 lib/sha256.h \
170 lib/sigevent.h \
171 lib/skiplist.h \
172 lib/smux.h \
173 lib/sockopt.h \
174 lib/sockunion.h \
175 lib/spf_backoff.h \
176 lib/srcdest_table.h \
177 lib/stream.h \
178 lib/systemd.h \
179 lib/table.h \
180 lib/termtable.h \
181 lib/thread.h \
182 lib/vector.h \
183 lib/vlan.h \
184 lib/vrf.h \
185 lib/vrf_int.h \
186 lib/vty.h \
187 lib/vxlan.h \
188 lib/wheel.h \
189 lib/workqueue.h \
190 lib/zassert.h \
191 lib/zclient.h \
192 lib/zebra.h \
193 lib/logicalrouter.h \
194 lib/lua.h \
195 lib/pbr.h \
196 # end
197
198
199 nodist_pkginclude_HEADERS += \
200 lib/route_types.h \
201 lib/version.h \
202 # end
203
204 noinst_HEADERS += \
205 lib/clippy.h \
206 lib/log_int.h \
207 lib/plist_int.h \
208 #end
209
210 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
211 # linking: If we're linking libfrr statically into daemons, we *must* remove
212 # libfrr from modules because modules will always link it in dynamically and
213 # thus 2 copies of libfrr will be loaded... hilarity ensues.
214 #
215 # Not linking libfrr into modules should generally work fine because the
216 # executable refers to libfrr either way and the dynamic linker should make
217 # libfrr available to modules. If some OS platform has a dynamic linker that
218 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
219 # it's not linked into daemons statically.
220
221 #
222 # SNMP support
223 #
224 if SNMP
225 lib_LTLIBRARIES += lib/libfrrsnmp.la
226 endif
227
228 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
229 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
230 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
231 lib_libfrrsnmp_la_SOURCES = \
232 lib/agentx.c \
233 lib/snmp.c \
234 # end
235
236 #
237 # ZeroMQ support
238 #
239 if ZEROMQ
240 lib_LTLIBRARIES += lib/libfrrzmq.la
241 pkginclude_HEADERS += lib/frr_zmq.h
242 endif
243
244 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
245 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
246 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
247 lib_libfrrzmq_la_SOURCES = \
248 lib/frr_zmq.c \
249 #end
250
251 #
252 # CLI utilities
253 #
254 noinst_PROGRAMS += \
255 lib/grammar_sandbox \
256 # end
257
258 if BUILD_CLIPPY
259 noinst_PROGRAMS += lib/clippy
260 else
261 $(HOSTTOOLS)lib/clippy:
262 @$(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/route_types.h lib/clippy
263 endif
264
265 lib_grammar_sandbox_SOURCES = \
266 lib/grammar_sandbox_main.c
267 lib_grammar_sandbox_LDADD = \
268 lib/libfrr.la
269
270 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
271 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
272 lib_clippy_LDADD = $(PYTHON_LIBS)
273 lib_clippy_LDFLAGS = -export-dynamic
274 lib_clippy_SOURCES = \
275 lib/clippy.c \
276 lib/command_graph.c \
277 lib/command_lex.l \
278 lib/command_parse.y \
279 lib/command_py.c \
280 lib/defun_lex.l \
281 lib/graph.c \
282 lib/memory.c \
283 lib/vector.c \
284 # end
285
286 # (global) clippy rules for all directories
287
288 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
289 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
290 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
291 am__v_CLIPPY_1 =
292
293 CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
294
295 SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h
296 .c_clippy.c:
297 @{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || \
298 $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
299 $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
300
301 ## automake's "ylwrap" is a great piece of GNU software... not.
302 .l.c:
303 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
304 .y.c:
305 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
306
307 #
308 # generated sources & extra foo
309 #
310 EXTRA_DIST += \
311 lib/command_lex.h \
312 lib/command_parse.h \
313 lib/gitversion.pl \
314 lib/route_types.pl \
315 lib/route_types.txt \
316 # end
317
318 BUILT_SOURCES += \
319 lib/gitversion.h \
320 lib/route_types.h \
321 # end
322
323 ## force route_types.h
324 $(lib_clippy_OBJECTS): lib/route_types.h
325 $(lib_libfrr_la_OBJECTS): lib/route_types.h
326
327 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
328
329 lib/command_lex.h: lib/command_lex.c
330 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
331 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
332 lib/command_lex.lo: lib/command_parse.h
333 lib/command_parse.lo: lib/command_lex.h
334 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
335 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
336
337 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
338 @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
339
340 if GIT_VERSION
341 # bit of a trick here to always have up-to-date git stamps without triggering
342 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
343 # but if we use that on gitversion.h it'll ripple through the .c file deps.
344 # (even if gitversion.h's file timestamp doesn't change, make will think it
345 # did, because of .PHONY...)
346
347 PHONY_GITVERSION=lib/gitversion.h.tmp
348 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
349 GITH=lib/gitversion.h
350 lib/gitversion.h.tmp: $(top_srcdir)/.git
351 @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
352 lib/gitversion.h: lib/gitversion.h.tmp
353 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
354
355 else
356 PHONY_GITVERSION=lib/gitversion.h
357 lib/gitversion.h:
358 true
359 endif
360 .PHONY: $(PHONY_GITVERSION)