blob: 7324275a3d786bc2a1fd13e464cb0e89a0a50722 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# The stamp file which is never created ensures that git_version.h is updated
# before every build. Having git_version.h in foo_SOURCES ensures a recompile
# of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES
# instead of foo_SOURCES prevents shipping git_version.h in dist tarballs,
# which may cause false GIT_FOO readings.
BUILT_SOURCES += git_version.stamp
CLEANFILES += git_version.h
GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh
git_version.stamp:
@if test -f "$(srcdir)/git_version.h"; then \
if test -f "git_version.h"; then :; \
else \
cp "$(srcdir)/git_version.h" "git_version.h"; \
fi; \
fi
$(GIT_VERSION_CMD) -k -s $(top_srcdir) -o git_version.h
@if test -s "$(srcdir)/git_version.h"; then \
if cmp "$(srcdir)/git_version.h" "git_version.h"; then :; \
else \
echo "Error: $(srcdir)/git_version.h and git_version.h differ."; \
echo " You probably want to remove the former."; \
exit 1; \
fi; \
fi
dist-hook: git_version.stamp
if test -f "git_version.h"; then \
$(SED) -e 's|^#undef GIT_IS_DIST.*|#define GIT_IS_DIST 1|' \
"git_version.h" > "$(distdir)/git_version.h"; \
fi
|