summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-08-14 21:17:27 +0200
committerJim Meyering <meyering@redhat.com>2008-08-26 18:45:06 +0200
commit5bf3e7ee96a0952e3b439e31ee6efa055fef897f (patch)
tree3099256b4be6bf3ca601d63669ed2fcbfd313789 /src/Makefile.am
parent0c1fc1c715aa18605eb11c6c25867277824e8f8d (diff)
downloadcoreutils-5bf3e7ee96a0952e3b439e31ee6efa055fef897f.tar.xz
generate version.c and version.h
* src/Makefile.am (version.c, version.h): New rules. Generate. (nodist_libver_a_SOURCES): Define * .gitignore: Add src/version.c and src/version.h. (DISTCLEANFILES): Add version.c and version.h.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 1d5900387..1eae0158d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,7 +70,7 @@ CLEANFILES = $(SCRIPTS) su
AM_CPPFLAGS = -I$(top_srcdir)/lib
noinst_LIBRARIES = libver.a
-libver_a_SOURCES = version.c version.h
+nodist_libver_a_SOURCES = version.c version.h
# Sometimes, the expansion of $(LIBINTL) includes -lc which may
# include modules defining variables like `optind', so libcoreutils.a
@@ -311,6 +311,22 @@ fs.h: stat.c extract-magic
@chmod a-w $@t
mv $@t $@
+BUILT_SOURCES += version.c
+version.c: Makefile
+ rm -f $@
+ printf '#include <config.h>\n' > $@t
+ printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+ @chmod a-w $@t
+ mv $@t $@
+
+BUILT_SOURCES += version.h
+version.h: Makefile
+ rm -f $@
+ printf 'extern char const *Version;\n' > $@t
+ @chmod a-w $@t
+ mv $@t $@
+
+DISTCLEANFILES = version.c version.h
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
# Sort in traditional ASCII order, regardless of the current locale;