Added git hash to version number
This commit is contained in:
parent
be33c08738
commit
7bbd877fb5
2 changed files with 16 additions and 3 deletions
10
connect4.c
10
connect4.c
|
|
@ -26,10 +26,16 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
#define VERSION 0.1.0
|
#define VERSION 0.1.1
|
||||||
|
|
||||||
|
#ifndef GITHASH
|
||||||
|
#define FULLVERSION VERSION
|
||||||
|
#else
|
||||||
|
#define FULLVERSION VERSION~git.GITHASH
|
||||||
|
#endif
|
||||||
|
|
||||||
#define VERSIONSTRING \
|
#define VERSIONSTRING \
|
||||||
"AnnaConnect version "XSTR(VERSION)", Copyright (C) Anna Snoeijs\n"
|
"AnnaConnect version "XSTR(FULLVERSION)", Copyright (C) Anna Snoeijs\n"
|
||||||
|
|
||||||
// The LISENCE file
|
// The LISENCE file
|
||||||
// Not null-terminated so need pointers for both start and end
|
// Not null-terminated so need pointers for both start and end
|
||||||
|
|
|
||||||
7
makefile
7
makefile
|
|
@ -6,6 +6,8 @@ FLAGS += -Wall
|
||||||
FLAGS += -Wextra
|
FLAGS += -Wextra
|
||||||
FLAGS += -Werror
|
FLAGS += -Werror
|
||||||
|
|
||||||
|
GITFLAG = -D'GITHASH=$(shell git rev-parse --short=1 HEAD)'
|
||||||
|
|
||||||
OBJDIR = obj
|
OBJDIR = obj
|
||||||
OUTDIR = out
|
OUTDIR = out
|
||||||
|
|
||||||
|
|
@ -50,6 +52,11 @@ $(OBJDIR)/%.o: %.c
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CC) -c $(FLAGS) -o $@ $^
|
$(CC) -c $(FLAGS) -o $@ $^
|
||||||
|
|
||||||
|
$(OBJDIR)/connect4.o: connect4.c
|
||||||
|
@echo $(MSG_COMPILING) $^
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
$(CC) -c $(FLAGS) $(GITFLAG) -o $@ $^
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo $(MSG_CLEANING)
|
@echo $(MSG_CLEANING)
|
||||||
@echo $(MSG_CLEANING_OBJ)
|
@echo $(MSG_CLEANING_OBJ)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue