AFS_component_version_number.c: Respect SOURCE_DATE_EPOCH if set
[openafs.git] / src / config / Makefile.version-NOCML.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 PACKAGE=@PACKAGE@
9
10 AFS_component_version_number.o: AFS_component_version_number.c
11
12 AFS_component_version_number.c: @TOP_OBJDIR@/src/config/Makefile.version
13         ( VERSION=`@abs_top_srcdir@/build-tools/git-version @abs_top_srcdir@ "@VERSION@"` && \
14         if [ "$$SOURCE_DATE_EPOCH" ]; then \
15              echo 'char cml_version_number[]="@(#)OpenAFS '$$VERSION `date -u -d "@$$SOURCE_DATE_EPOCH" +"%Y-%m-%d" 2>/dev/null || date -u -r "$$SOURCE_DATE_EPOCH" +"%Y-%m-%d"`'";'; \
16         else \
17              echo 'char cml_version_number[]="@(#)OpenAFS '$$VERSION `date +"%Y-%m-%d"` $$USER@`hostname`'";'; \
18         fi >AFS_component_version_number.c.NEW && \
19         echo 'char* AFSVersion = "${PACKAGE} '$$VERSION'";' >>AFS_component_version_number.c.NEW && \
20         if cmp AFS_component_version_number.c.NEW AFS_component_version_number.c > /dev/null 2>&1 ; then : ; else \
21         mv AFS_component_version_number.c.NEW AFS_component_version_number.c ; fi )
22         rm -f AFS_component_version_number.c.NEW
23
24 version.xml:
25         VERSION=`@abs_top_srcdir@/build-tools/git-version @abs_top_srcdir@ "@VERSION@"` && \
26         echo '<?xml version="1.0" encoding="UTF-8"?>' >version.xml && \
27         echo '<revision>' >>version.xml && \
28         echo '<revnumber>'$$VERSION'</revnumber>' >>version.xml && \
29         echo '<date></date>' >>version.xml && \
30         echo '</revision>' >>version.xml
31
32 version.txt:
33         echo "Base configuration unknown" > version.txt