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