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