xref: /freebsd/usr.sbin/ntp/scripts/mkver (revision 273c26a3c3bea87a241d6879abd4f991db180bf0)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5PROG=${1-UNKNOWN}
6
7ConfStr="$PROG"
8
9ConfStr="$ConfStr 4.2.8p8"
10
11case "$CSET" in
12 '') ;;
13 *) ConfStr="$ConfStr@$CSET" ;;
14esac
15
16case "" in
17 '')
18    case "1" in
19     '') ;;
20     *) ConfStr="${ConfStr}-a" ;;
21    esac
22    ;;
23 *)  ConfStr="${ConfStr}-r" ;;
24esac
25
26if [ ! -f .version ]; then
27  echo 0 > .version
28fi
29RUN="`cat .version`"
30RUN="`expr $RUN + 1`"
31echo $RUN > .version
32
33ConfStr="$ConfStr (${RUN})"
34
35echo "Version <${ConfStr}>";
36
37rm -f version.c
38cat > version.c << -EoF-
39/*
40 * version file for $PROG
41 */
42#include <config.h>
43const char * Version = "${ConfStr}";
44-EoF-
45