-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgitversion
More file actions
executable file
·24 lines (21 loc) · 856 Bytes
/
gitversion
File metadata and controls
executable file
·24 lines (21 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
VERSION=$(git describe --tags)
MAJOR=$(echo $VERSION | cut -d . -f 1)
MINOR=$(echo $VERSION | cut -d . -f 2)
REST=$(echo $VERSION | cut -d . -f 3)
REV=$(echo $REST | cut -d - -f 1)
GIT=$(echo $REST | cut -d - -sf 2-)
CCVER=$(cc -v 2>&1 | tail -n 1)
echo "/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010-12 Edward Cree
See quirc.c for license information
version.h: contains version number (generated from git describe)
*/
#pragma once
#define VERSION_MAJ (unsigned char)${MAJOR}U // Major version
#define VERSION_MIN (unsigned char)${MINOR}U // Minor version
#define VERSION_REV (unsigned char)${REV}U // Revision number
#define VERSION_TXT \"$GIT\" // Rest of git describe
#define CC_VERSION \"$CCVER\" // last line of cc -v" > version.h2
if ! cmp version.h version.h2; then mv version.h2 version.h; else rm version.h2; fi