summaryrefslogtreecommitdiff
path: root/support/dktools/scripts/build-version.sh
blob: f4165742b7c661fc18a990158197a440d0a9e21a (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh

VERSNO=`cat version.txt`
if [ -f "preview.txt" ]
then
	VERSDATE=`date '+%Y-%m-%d/%H:%M:%S'`
	VERSNO="${VERSNO}_preview_${VERSDATE}"
	echo ${VERSDATE} > preview.txt
fi

YEAR=`date '+%Y'`

cat > dk4vers.h <<EOF
/*
Copyright (C) 2001-${YEAR}, Dirk Krause. All rights reserved.
SPDX-License-Identifier:	BSD-3-Clause
*/

#ifndef DK4VERS_H_INCLUDED
#define	DK4VERS_H_INCLUDED	1

/**	@file	dk4vers.h	Version number as text string.
*/

/**	Version number in 8 bit  characters.
*/
#define	DKT_VERSION_C8 "$VERSNO"

/**	Version number in dkChar.
*/
#define	DKT_VERSION_DK dkT("$VERSNO")

#endif
EOF

cat > dk4verswx.h <<EOF
/*
Copyright (C) 2001-${YEAR}, Dirk Krause. All rights reserved.
SPDX-License-Identifier:	BSD-3-Clause
*/

#ifndef DK4VERSWX_H_INCLUDED
/** Protection against multiple inclusions. */
#define	DK4VERSWX_H_INCLUDED 1
/** @file	dk4verswx.h	Version number as wxChar string.
*/

#ifndef WX_WXPREC_H_INCLUDED
#include "wx/wxprec.h"
#define WX_WXPREC_H_INCLUDED 1
#endif

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#ifndef WX_WX_H_INCLUDED
#include "wx/wx.h"
#define WX_WX_H_INCLUDED 1
#endif
#endif

/**	Version number as wxChar string.
*/
#define	DKT_VERSION_WX wxT("$VERSNO")

#endif
EOF
chmod 644 dk4vers.h