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