From 4a66a7895ace01a8f1220614f0571d188421628e Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Thu, 26 Mar 2015 08:45:00 +0000 Subject: [PATCH] Add version constant --- Makefile | 3 ++- main.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9c6d836..4b4056a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -CC = gcc -Wall +GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags) +CC = gcc -Wall -DVERSION=\"$(GIT_VERSION)\" lib_inih := lib/inih libs := $(lib_inih) diff --git a/main.c b/main.c index 5524e79..35519e1 100644 --- a/main.c +++ b/main.c @@ -108,6 +108,7 @@ int read_button() int main (void) { + printf("hdmi-switcher %s\n", VERSION); init_config(&config); init_gpio(); switch_state = config.default_switch_state; -- 2.11.0