chiark / gitweb /
fixes
[inn-innduct.git] / support / mkversion
1 #! /bin/sh
2
3 ##  $Id: mkversion 7345 2005-07-02 05:04:05Z eagle $
4 ##
5 ##  Create version.h from INN version information.
6 ##
7 ##  Makefile.global contains the INN version number and extra version
8 ##  information (if any).  This is passed to use by lib/Makefile as our
9 ##  first and second arguments.  Print a header file suitable for use
10 ##  as inn/version.h on stdout.
11
12 version="$1"
13 extra="$2"
14 string="INN $version"
15 if [ x"$extra" = x"prerelease" ] ; then
16     date=`date +%Y%m%d`
17     extra="$date $extra"
18 fi
19 if [ -n "$extra" ] ; then
20     string="$string ($extra)"
21 fi
22 major=`echo "$version" | cut -d. -f1`
23 minor=`echo "$version" | cut -d. -f2`
24 patch=`echo "$version" | cut -d. -f3`
25
26 cat <<EOF
27 /* Automatically generated by mkversion, edit Makefile.global to change. */
28
29 #ifndef INN_VERSION_H
30 #define INN_VERSION_H 1
31
32 #define INN_VERSION_MAJOR $major
33 #define INN_VERSION_MINOR $minor
34 #define INN_VERSION_PATCH $patch
35 #define INN_VERSION_EXTRA "$extra"
36 #define INN_VERSION_STRING "$string"
37
38 #endif /* INN_VERSION_H */
39 EOF