Navigation Menu

Skip to content

Commit

Permalink
Automatic version-number generation from git describe
Browse files Browse the repository at this point in the history
  • Loading branch information
Sound and Fury committed Jul 27, 2010
1 parent 709dc6b commit 15e4136
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
quirc
*.o
.quirc-shadow
version.h
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -6,6 +6,7 @@ CFLAGS ?= -Wall
all: quirc

quirc: quirc.c ttyraw.o ttyraw.h ttyesc.o ttyesc.h irc.o irc.h bits.o bits.h numeric.h version.h
./gitversion
$(CC) $(CFLAGS) -o quirc quirc.c ttyraw.o ttyesc.o irc.o bits.o

ttyraw.o: ttyraw.c ttyraw.h
Expand All @@ -20,3 +21,4 @@ irc.o: irc.c irc.h
bits.o: bits.c bits.h
$(CC) $(CFLAGS) -o bits.o -c bits.c


19 changes: 19 additions & 0 deletions gitversion
@@ -0,0 +1,19 @@
#!/bin/bash

VERSION=$(git describe --tags)
read MAJOR MINOR REVS GIT <<< ${VERSION//[-.]/ }

cat >version.h <<_EOM
/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010 Edward Cree
See quirc.c for license information
version.h: contains version number (generated from git describe)
*/
#pragma once
#define VERSION_MAJ $MAJOR // Major version
#define VERSION_MIN $MINOR // Minor version
#define VERSION_REV $REVS // Revision number
#define VERSION_TXT "$GIT" // Rest of git describe
_EOM
4 changes: 0 additions & 4 deletions version.h

This file was deleted.

0 comments on commit 15e4136

Please sign in to comment.