summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.once.head/10-write-ifchanged.mk
blob: 649aab9c1298b2ce74e76535412d385144cb9b4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod.write-ifchanged.description = `write-ifchanged` auxiliary build script
mod.write-ifchanged.files += $(topsrcdir)/build-aux/write-ifchanged
define mod.write-ifchanged.doc
# User variables:
#   - `WRITE_IFCHANGED ?= $(topsrcdir)/build-aux/write-ifchanged`
# Inputs:
#   (none)
# Outputs:
#   (none)
#
# The $(WRITE_IFCHANGED) program reads a file from stdin, and writes it to the
# file named in argv[1], but does so atomically, but more importantly, does so
# in a way that does not bump the file's ctime if the new content is the same
# as the old content.
#
# That is, the following lines are almost equivalient:
#
#     ... > $@
#     ... | $(WRITE_ATOMIC) $@
endef
mod.write-ifchanged.doc := $(value mod.write-ifchanged.doc)

WRITE_IFCHANGED ?= $(topsrcdir)/build-aux/write-ifchanged