]> git.proxmox.com Git - mirror_frr.git/blame - lib/subdir.am
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / subdir.am
CommitLineData
4a121f99
DL
1#
2# libfrr
3#
04b4b595 4
4a121f99 5lib_LTLIBRARIES += lib/libfrr.la
63116a70 6lib_libfrr_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0 -Xlinker -e_libfrr_version
3bd7df45 7lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBCRYPT) $(LIBDL) $(LIBM)
4a121f99
DL
8
9lib_libfrr_la_SOURCES = \
15833261 10 lib/admin_group.c \
05a12619
LS
11 lib/affinitymap.c \
12 lib/affinitymap_cli.c \
13 lib/affinitymap_northbound.c \
8e1f6512 14 lib/agg_table.c \
bcea0c0f 15 lib/atomlist.c \
8079a413 16 lib/asn.c \
ac313345 17 lib/base64.c \
4a121f99
DL
18 lib/bfd.c \
19 lib/buffer.c \
20 lib/checksum.c \
21 lib/command.c \
22 lib/command_graph.c \
23 lib/command_lex.l \
24 lib/command_match.c \
25 lib/command_parse.y \
fd8e262a 26 lib/cspf.c \
4a121f99 27 lib/csv.c \
aea03ad6 28 lib/debug.c \
96673e06 29 lib/defaults.c \
4a121f99 30 lib/distribute.c \
04b4b595 31 lib/explicit_bzero.c \
3155489a 32 lib/ferr.c \
4a121f99 33 lib/filter.c \
b62578bd 34 lib/filter_cli.c \
c2aab693 35 lib/filter_nb.c \
735fb37d 36 lib/flex_algo.c \
3e41733f 37 lib/frrcu.c \
5dbb0a7b 38 lib/frrlua.c \
5f98c815 39 lib/frrscript.c \
4a121f99 40 lib/frr_pthread.c \
fe011935 41 lib/frrstr.c \
4a121f99
DL
42 lib/grammar_sandbox.c \
43 lib/graph.c \
44 lib/hash.c \
45 lib/hook.c \
a94eca09 46 lib/id_alloc.c \
4a121f99
DL
47 lib/if.c \
48 lib/if_rmap.c \
49 lib/imsg-buffer.c \
50 lib/imsg.c \
7f9ab3b0 51 lib/iso.c \
4a121f99
DL
52 lib/jhash.c \
53 lib/json.c \
54 lib/keychain.c \
24e7c5c8 55 lib/ldp_sync.c \
b66d022e 56 lib/lib_errors.c \
1c0d8808 57 lib/lib_vty.c \
4a121f99 58 lib/libfrr.c \
912d45a1 59 lib/libfrr_trace.c \
4a121f99 60 lib/linklist.c \
bbd85e20 61 lib/link_state.c \
4a121f99 62 lib/log.c \
1c408628 63 lib/log_filter.c \
f73126c3 64 lib/log_vty.c \
4a121f99
DL
65 lib/md5.c \
66 lib/memory.c \
7d65b7b7 67 lib/mgmt_be_client.c \
ef43a632 68 lib/mgmt_fe_client.c \
c9f0e90b 69 lib/mgmt_msg.c \
6edbb8b2 70 lib/mlag.c \
4a121f99 71 lib/module.c \
036fdaad 72 lib/mpls.c \
e496b420 73 lib/srv6.c \
4a121f99
DL
74 lib/network.c \
75 lib/nexthop.c \
e26aedbe
PG
76 lib/netns_linux.c \
77 lib/netns_other.c \
7ee30f28 78 lib/nexthop_group.c \
1c2facd1
RW
79 lib/northbound.c \
80 lib/northbound_cli.c \
81 lib/northbound_db.c \
e128c002 82 lib/ntop.c \
4a121f99
DL
83 lib/openbsd-tree.c \
84 lib/pid_output.c \
85 lib/plist.c \
4a121f99
DL
86 lib/prefix.c \
87 lib/privs.c \
88 lib/ptm_lib.c \
5c52c06c 89 lib/pullwr.c \
4a121f99 90 lib/qobj.c \
5318d896 91 lib/ringbuf.c \
4a121f99 92 lib/routemap.c \
2b3e4807 93 lib/routemap_cli.c \
686d244f 94 lib/routemap_northbound.c \
31bfa062 95 lib/sbuf.c \
440d5faa 96 lib/seqlock.c \
4a121f99
DL
97 lib/sha256.c \
98 lib/sigevent.c \
99 lib/skiplist.c \
100 lib/sockopt.c \
101 lib/sockunion.c \
102 lib/spf_backoff.c \
81a067cd 103 lib/segment_routing.c \
4a121f99
DL
104 lib/srcdest_table.c \
105 lib/stream.c \
a4cb97a6 106 lib/strformat.c \
4a121f99
DL
107 lib/strlcat.c \
108 lib/strlcpy.c \
109 lib/systemd.c \
110 lib/table.c \
111 lib/termtable.c \
cb37cb33 112 lib/event.c \
80911bc2 113 lib/typerb.c \
abd71baa 114 lib/typesafe.c \
4a121f99
DL
115 lib/vector.c \
116 lib/vrf.c \
117 lib/vty.c \
118 lib/wheel.c \
119 lib/workqueue.c \
8e427c29 120 lib/xref.c \
1c2facd1
RW
121 lib/yang.c \
122 lib/yang_translator.c \
123 lib/yang_wrappers.c \
4a121f99 124 lib/zclient.c \
0bdeb5e5 125 lib/zlog.c \
1c6261a9
DL
126 lib/zlog_5424.c \
127 lib/zlog_5424_cli.c \
0798d276 128 lib/zlog_live.c \
0bdeb5e5 129 lib/zlog_targets.c \
5c25bd87
DL
130 lib/printf/printf-pos.c \
131 lib/printf/vfprintf.c \
132 lib/printf/glue.c \
7441ea1a 133 lib/routing_nb.c \
134 lib/routing_nb_config.c \
c317d3f2 135 lib/tc.c \
4a121f99
DL
136 # end
137
3a11599c 138nodist_lib_libfrr_la_SOURCES = \
05a12619 139 yang/frr-affinity-map.yang.c \
a513824c 140 yang/frr-filter.yang.c \
edaee546 141 yang/frr-if-rmap.yang.c \
3a11599c 142 yang/frr-interface.yang.c \
686d244f 143 yang/frr-route-map.yang.c \
3a11599c 144 yang/frr-route-types.yang.c \
3a7262b6 145 yang/frr-vrf.yang.c \
8b043166 146 yang/frr-routing.yang.c \
7441ea1a 147 yang/frr-nexthop.yang.c \
e6a0538b 148 yang/ietf/ietf-routing-types.yang.c \
b0f502c5 149 yang/ietf/ietf-interfaces.yang.c \
bc8c00cc 150 yang/ietf/ietf-bgp-types.yang.c \
3a11599c
DL
151 yang/frr-module-translator.yang.c \
152 # end
153
ef43a632
CH
154# Add logic to build mgmt.proto
155lib_libfrr_la_LIBADD += $(PROTOBUF_C_LIBS)
156
157BUILT_SOURCES += \
158 lib/mgmt.pb-c.c \
159 lib/mgmt.pb-c.h \
160 # end
161
162CLEANFILES += \
163 lib/mgmt.pb-c.h \
164 lib/mgmt.pb-c.c \
165 # end
166
167lib_libfrr_la_SOURCES += \
168 lib/mgmt.pb-c.c \
169 #end
170
1c2facd1 171if SQLITE3
fdbd8086 172lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
1c2facd1
RW
173lib_libfrr_la_SOURCES += lib/db.c
174endif
175
94cfb069 176clippy_scan += \
05a12619 177 lib/affinitymap_cli.c \
94cfb069 178 lib/if.c \
b62578bd 179 lib/filter_cli.c \
efa2ca6e 180 lib/if_rmap.c \
94cfb069 181 lib/log_vty.c \
cfa0facb
CH
182 lib/mgmt_be_client.c \
183 lib/mgmt_fe_client.c \
94cfb069
DL
184 lib/nexthop_group.c \
185 lib/northbound_cli.c \
186 lib/plist.c \
1c950f37 187 lib/routemap.c \
94cfb069 188 lib/routemap_cli.c \
cb37cb33 189 lib/event.c \
94cfb069 190 lib/vty.c \
1c6261a9 191 lib/zlog_5424_cli.c \
94cfb069 192 # end
4a121f99
DL
193
194pkginclude_HEADERS += \
15833261 195 lib/admin_group.h \
05a12619 196 lib/affinitymap.h \
8e1f6512 197 lib/agg_table.h \
8079a413 198 lib/asn.h \
bcea0c0f 199 lib/atomlist.h \
ac313345 200 lib/base64.h \
4a121f99
DL
201 lib/bfd.h \
202 lib/bitfield.h \
203 lib/buffer.h \
204 lib/checksum.h \
14beb548 205 lib/mlag.h \
4a121f99
DL
206 lib/command.h \
207 lib/command_graph.h \
208 lib/command_match.h \
de1a880c 209 lib/compiler.h \
fd8e262a 210 lib/cspf.h \
4a121f99 211 lib/csv.h \
1c2facd1 212 lib/db.h \
aea03ad6 213 lib/debug.h \
96673e06 214 lib/defaults.h \
4a121f99 215 lib/distribute.h \
3155489a 216 lib/ferr.h \
4a121f99 217 lib/filter.h \
735fb37d 218 lib/flex_algo.h \
cd85bc2e 219 lib/freebsd-queue.h \
5dbb0a7b 220 lib/frrlua.h \
5f98c815 221 lib/frrscript.h \
4a121f99
DL
222 lib/frr_pthread.h \
223 lib/frratomic.h \
3e41733f 224 lib/frrcu.h \
fe011935 225 lib/frrstr.h \
4a121f99
DL
226 lib/graph.h \
227 lib/hash.h \
228 lib/hook.h \
17136bf2 229 lib/iana_afi.h \
a94eca09 230 lib/id_alloc.h \
4a121f99
DL
231 lib/if.h \
232 lib/if_rmap.h \
233 lib/imsg.h \
234 lib/ipaddr.h \
7f9ab3b0 235 lib/iso.h \
4a121f99
DL
236 lib/jhash.h \
237 lib/json.h \
238 lib/keychain.h \
24e7c5c8 239 lib/ldp_sync.h \
b66d022e 240 lib/lib_errors.h \
1c0d8808 241 lib/lib_vty.h \
4a121f99 242 lib/libfrr.h \
912d45a1 243 lib/libfrr_trace.h \
4a121f99
DL
244 lib/libospf.h \
245 lib/linklist.h \
bbd85e20 246 lib/link_state.h \
4a121f99 247 lib/log.h \
f73126c3 248 lib/log_vty.h \
4a121f99
DL
249 lib/md5.h \
250 lib/memory.h \
ef43a632 251 lib/mgmt.pb-c.h \
7d65b7b7 252 lib/mgmt_be_client.h \
ef43a632 253 lib/mgmt_fe_client.h \
c9f0e90b 254 lib/mgmt_msg.h \
ef43a632 255 lib/mgmt_pb.h \
4a121f99
DL
256 lib/module.h \
257 lib/monotime.h \
258 lib/mpls.h \
e496b420 259 lib/srv6.h \
4a121f99
DL
260 lib/network.h \
261 lib/nexthop.h \
7ee30f28 262 lib/nexthop_group.h \
50d89650 263 lib/nexthop_group_private.h \
1c2facd1
RW
264 lib/northbound.h \
265 lib/northbound_cli.h \
266 lib/northbound_db.h \
4a121f99
DL
267 lib/ns.h \
268 lib/openbsd-queue.h \
269 lib/openbsd-tree.h \
270 lib/plist.h \
4a121f99 271 lib/prefix.h \
5c25bd87 272 lib/printfrr.h \
4a121f99
DL
273 lib/privs.h \
274 lib/ptm_lib.h \
5c52c06c 275 lib/pullwr.h \
6833ae01 276 lib/pw.h \
4a121f99 277 lib/qobj.h \
cd85bc2e 278 lib/queue.h \
5318d896 279 lib/ringbuf.h \
4a121f99 280 lib/routemap.h \
94effaf0 281 lib/route_opaque.h \
31bfa062 282 lib/sbuf.h \
440d5faa 283 lib/seqlock.h \
4a121f99
DL
284 lib/sha256.h \
285 lib/sigevent.h \
286 lib/skiplist.h \
98ea5be8 287 lib/smux.h \
4a121f99
DL
288 lib/sockopt.h \
289 lib/sockunion.h \
290 lib/spf_backoff.h \
81a067cd 291 lib/segment_routing.h \
4a121f99 292 lib/srcdest_table.h \
31f937fb 293 lib/srte.h \
4a121f99
DL
294 lib/stream.h \
295 lib/systemd.h \
296 lib/table.h \
297 lib/termtable.h \
24a58196 298 lib/frrevent.h \
552e2a30 299 lib/trace.h \
80911bc2 300 lib/typerb.h \
abd71baa 301 lib/typesafe.h \
4a121f99 302 lib/vector.h \
4a121f99
DL
303 lib/vlan.h \
304 lib/vrf.h \
305 lib/vrf_int.h \
306 lib/vty.h \
307 lib/vxlan.h \
308 lib/wheel.h \
309 lib/workqueue.h \
8e427c29 310 lib/xref.h \
1c2facd1
RW
311 lib/yang.h \
312 lib/yang_translator.h \
313 lib/yang_wrappers.h \
4a121f99
DL
314 lib/zclient.h \
315 lib/zebra.h \
0bdeb5e5 316 lib/zlog.h \
1c6261a9 317 lib/zlog_5424.h \
0798d276 318 lib/zlog_live.h \
0bdeb5e5 319 lib/zlog_targets.h \
0031a6bb 320 lib/pbr.h \
c317d3f2 321 lib/tc.h \
7441ea1a 322 lib/routing_nb.h \
64dd7736
DL
323 \
324 lib/assert/assert.h \
4a121f99
DL
325 # end
326
58f8a9ec 327
70d27c5b
DL
328nodist_pkginclude_HEADERS += \
329 lib/route_types.h \
330 lib/version.h \
331 # end
332
4a121f99
DL
333noinst_HEADERS += \
334 lib/clippy.h \
4a121f99 335 lib/plist_int.h \
5c25bd87
DL
336 lib/printf/printfcommon.h \
337 lib/printf/printflocal.h \
4a121f99
DL
338 #end
339
d6e76257
DL
340# General note about module and module helper library (libfrrsnmp, libfrrzmq)
341# linking: If we're linking libfrr statically into daemons, we *must* remove
342# libfrr from modules because modules will always link it in dynamically and
343# thus 2 copies of libfrr will be loaded... hilarity ensues.
344#
345# Not linking libfrr into modules should generally work fine because the
346# executable refers to libfrr either way and the dynamic linker should make
347# libfrr available to modules. If some OS platform has a dynamic linker that
348# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
349# it's not linked into daemons statically.
350
4a121f99
DL
351#
352# SNMP support
353#
354if SNMP
355lib_LTLIBRARIES += lib/libfrrsnmp.la
356endif
357
0c4285d7 358lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
63116a70 359lib_libfrrsnmp_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
d6e76257 360lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
4a121f99
DL
361lib_libfrrsnmp_la_SOURCES = \
362 lib/agentx.c \
4a121f99
DL
363 lib/snmp.c \
364 # end
365
04b4b595 366
fe9e7b71
DL
367#
368# c-ares support
369#
370if CARES
371lib_LTLIBRARIES += lib/libfrrcares.la
372pkginclude_HEADERS += lib/resolver.h
373endif
374
0c4285d7 375lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
63116a70 376lib_libfrrcares_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
fe9e7b71
DL
377lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
378lib_libfrrcares_la_SOURCES = \
379 lib/resolver.c \
380 #end
381
b6116506
DL
382#
383# ZeroMQ support
384#
385if ZEROMQ
386lib_LTLIBRARIES += lib/libfrrzmq.la
387pkginclude_HEADERS += lib/frr_zmq.h
388endif
389
0c4285d7 390lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
63116a70 391lib_libfrrzmq_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0
d6e76257 392lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
b6116506
DL
393lib_libfrrzmq_la_SOURCES = \
394 lib/frr_zmq.c \
395 #end
396
5bce33b3
RW
397#
398# Tail-f's ConfD support
399#
400if CONFD
401module_LTLIBRARIES += lib/confd.la
402endif
403
0c4285d7 404lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
63116a70 405lib_confd_la_LDFLAGS = $(MODULE_LDFLAGS)
fdbd8086 406lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
5bce33b3
RW
407lib_confd_la_SOURCES = lib/northbound_confd.c
408
a7ca2199
RW
409#
410# Sysrepo support
411#
412if SYSREPO
413module_LTLIBRARIES += lib/sysrepo.la
414endif
415
0c4285d7 416lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
63116a70 417lib_sysrepo_la_LDFLAGS = $(MODULE_LDFLAGS)
fdbd8086 418lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
a7ca2199
RW
419lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
420
ec2ac5f2
RW
421#
422# gRPC northbound plugin
423#
424if GRPC
425module_LTLIBRARIES += lib/grpc.la
426endif
427
428lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
63116a70 429lib_grpc_la_LDFLAGS = $(MODULE_LDFLAGS)
ec2ac5f2
RW
430lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
431lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
432
4a121f99
DL
433#
434# CLI utilities
435#
436noinst_PROGRAMS += \
4a121f99
DL
437 lib/grammar_sandbox \
438 # end
439
89727c8d
DL
440if BUILD_CLIPPY
441noinst_PROGRAMS += lib/clippy
442else
a71c5039
DL
443if HOSTTOOLS_CLIPPY
444$(CLIPPY):
445 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
446endif
89727c8d
DL
447endif
448
4a121f99
DL
449lib_grammar_sandbox_SOURCES = \
450 lib/grammar_sandbox_main.c
451lib_grammar_sandbox_LDADD = \
452 lib/libfrr.la
453
64dd7736 454lib_clippy_CPPFLAGS = $(CPPFLAGS_BASE) -D_GNU_SOURCE -DBUILDING_CLIPPY
0c4285d7 455lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
5609b3af 456lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
63116a70
DL
457# no $(SAN_FLAGS) here
458lib_clippy_LDFLAGS = -export-dynamic $(AC_LDFLAGS) $(AC_LDFLAGS_EXEC)
4a121f99 459lib_clippy_SOURCES = \
8e427c29 460 lib/jhash.c \
4a121f99
DL
461 lib/clippy.c \
462 lib/command_graph.c \
463 lib/command_lex.l \
464 lib/command_parse.y \
465 lib/command_py.c \
466 lib/defun_lex.l \
5609b3af 467 lib/elf_py.c \
4a121f99 468 lib/graph.c \
912d45a1 469 lib/libfrr_trace.c \
4a121f99 470 lib/memory.c \
5609b3af 471 lib/typesafe.c \
4a121f99
DL
472 lib/vector.c \
473 # end
474
aad24c5b
DL
475# (global) clippy rules for all directories
476
477AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
478am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
479am__v_CLIPPY_0 = @echo " CLIPPY " $@;
480am__v_CLIPPY_1 =
481
a71c5039 482CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
aad24c5b 483
8fb40377 484SUFFIXES += _clippy.c
aad24c5b 485.c_clippy.c:
a71c5039 486 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
aad24c5b 487
a1e6ab1e
DL
488# xrelfo, the ELF xref extractor
489
490AM_V_XRELFO = $(am__v_XRELFO_$(V))
491am__v_XRELFO_ = $(am__v_XRELFO_$(AM_DEFAULT_VERBOSITY))
492am__v_XRELFO_0 = @echo " XRELFO " $@;
493am__v_XRELFO_1 =
494
2621bb8b 495XRELFO_FLAGS = -Wlog-format -Wlog-args
2621bb8b 496
a1e6ab1e
DL
497SUFFIXES += .xref
498%.xref: % $(CLIPPY)
13f9aea3 499 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py $(WERROR) $(XRELFO_FLAGS) -o $@ $<
a1e6ab1e
DL
500
501# dependencies added in python/makefile.py
502frr.xref:
89cb86ae 503 $(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^
a1e6ab1e
DL
504all-am: frr.xref
505
506clean-xref:
507 -rm -rf $(xrefs) frr.xref
508clean-local: clean-xref
509
89cb86ae
DL
510CLEANFILES += vtysh/vtysh_cmd.c
511vtysh/vtysh_cmd.c: frr.xref
512 @test -f $@ || rm -f frr.xref || true
513 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref
514
aad24c5b
DL
515## automake's "ylwrap" is a great piece of GNU software... not.
516.l.c:
517 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
518.y.c:
519 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
4a121f99
DL
520
521#
522# generated sources & extra foo
523#
524EXTRA_DIST += \
525 lib/command_lex.h \
70d27c5b 526 lib/command_parse.h \
4a121f99 527 lib/gitversion.pl \
4a121f99
DL
528 lib/route_types.pl \
529 lib/route_types.txt \
530 # end
531
532BUILT_SOURCES += \
4a121f99
DL
533 lib/gitversion.h \
534 lib/route_types.h \
535 # end
536
f1b32b2e
DL
537## force route_types.h
538$(lib_clippy_OBJECTS): lib/route_types.h
539$(lib_libfrr_la_OBJECTS): lib/route_types.h
540
4a121f99
DL
541AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
542
543lib/command_lex.h: lib/command_lex.c
544 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
545 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
f1b32b2e 546lib/command_lex.lo: lib/command_parse.h
4a121f99 547lib/command_parse.lo: lib/command_lex.h
fdbd8086
DL
548lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
549lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
f1b32b2e 550lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
4a121f99
DL
551lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
552
f0368a3e
MS
553DISTCLEANFILES += lib/command_lex.h \
554 lib/command_lex.c \
555 lib/command_parse.h \
556 lib/command_parse.c
557
b3b4dfa5
IR
558rt_enabled =
559
560if BABELD
561rt_enabled += --enabled babeld
562endif
563if BFDD
564rt_enabled += --enabled bfdd
565endif
566if BGPD
567rt_enabled += --enabled bgpd
568if ENABLE_BGP_VNC
569rt_enabled += --enabled bgpd-vnc
570endif
571endif
572if EIGRPD
573rt_enabled += --enabled eigrpd
574endif
575if ISISD
576rt_enabled += --enabled isisd
577endif
578if FABRICD
579rt_enabled += --enabled fabricd
580endif
581if LDPD
582rt_enabled += --enabled ldpd
583endif
584if NHRPD
585rt_enabled += --enabled nhrpd
586endif
587if OSPFD
588rt_enabled += --enabled ospfd
589endif
590if OSPF6D
591rt_enabled += --enabled ospf6d
592endif
593if PBRD
594rt_enabled += --enabled pbrd
595endif
596if PIMD
597rt_enabled += --enabled pimd
598endif
599if RIPD
600rt_enabled += --enabled ripd
601endif
602if RIPNGD
603rt_enabled += --enabled ripngd
604endif
605if SHARPD
606rt_enabled += --enabled sharpd
607endif
608if ZEBRA
609rt_enabled += --enabled zebra
610endif
611
4a121f99 612lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
d173381e 613 @$(MKDIR_P) lib
b3b4dfa5 614 $(PERL) $(top_srcdir)/lib/route_types.pl $(rt_enabled) < $(top_srcdir)/lib/route_types.txt > $@
67cf020d 615DISTCLEANFILES += lib/route_types.h
4a121f99
DL
616
617if GIT_VERSION
618# bit of a trick here to always have up-to-date git stamps without triggering
485ac9a7 619# unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
4a121f99
DL
620# but if we use that on gitversion.h it'll ripple through the .c file deps.
621# (even if gitversion.h's file timestamp doesn't change, make will think it
622# did, because of .PHONY...)
623
9e53b315 624PHONY_GITVERSION=lib/gitversion.h.tmp
4a121f99
DL
625.SILENT: lib/gitversion.h lib/gitversion.h.tmp
626GITH=lib/gitversion.h
627lib/gitversion.h.tmp: $(top_srcdir)/.git
d173381e 628 @$(MKDIR_P) lib
fdbd8086 629 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
4a121f99 630lib/gitversion.h: lib/gitversion.h.tmp
bd402424 631 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
4a121f99
DL
632
633else
9e53b315 634PHONY_GITVERSION=lib/gitversion.h
4a121f99
DL
635lib/gitversion.h:
636 true
637endif
9e53b315 638.PHONY: $(PHONY_GITVERSION)