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