Skip to content

Commit

Permalink
Change versioning to git describe
Browse files Browse the repository at this point in the history
  • Loading branch information
fjes committed Apr 13, 2017
1 parent e864e39 commit 9391ce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ MANPATH = $(DESTDIR)/../man/man1
endif

SOURCEDIR = `pwd`
VERSION = `scripts/getversion`
VERSION = $(shell git describe --always)

CFLAGS += -DVERSION=\"$(VERSION)\"

%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
Expand Down
9 changes: 1 addition & 8 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
#include <stdlib.h>
#include <errno.h>

#define VERSION_MAJOR 1
#define VERSION_MINOR 1
#define VERSION_APPEND "-dev"

#define VERSION_STRING(x,y,z) VERSION_ARGS(x, y, z)
#define VERSION_ARGS(x,y,z) "v" #x "." #y z

#define MAX_BUFFER_SIZE (1000*1024)
#define MAX_FILENAME_SIZE (256)

Expand Down Expand Up @@ -252,7 +245,7 @@ int main(int argc, char *argv[])
} else if (argv[i][1] == 'v') {
printf("%s %s\n",
base(argv[0]),
VERSION_STRING(VERSION_MAJOR,VERSION_MINOR,VERSION_APPEND));
VERSION);
return 0;
} else if (argv[i][1] == 'o') {
i++;
Expand Down

0 comments on commit 9391ce7

Please sign in to comment.