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