From b7de1adca2f52ab2de64c2ed52a73dfb2bb6d239 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Mon, 7 Mar 2016 17:18:23 -0800 Subject: [PATCH] Start to generate version.h --- adsbus/.gitignore | 3 +++ adsbus/Makefile | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/adsbus/.gitignore b/adsbus/.gitignore index 55c3eac..e4375ec 100644 --- a/adsbus/.gitignore +++ b/adsbus/.gitignore @@ -33,3 +33,6 @@ # Binaries adsbus + +# Generated +version.h diff --git a/adsbus/Makefile b/adsbus/Makefile index 61b62c4..b9953dd 100644 --- a/adsbus/Makefile +++ b/adsbus/Makefile @@ -24,6 +24,10 @@ clean: %.o: %.c *.h $(COMP) -c $(CFLAGS) $< -o $@ +version.h: + echo "#define GIT_LAST_CHANGE \"$$(git log --format=%H -n 1)\"" > version.h + echo "#define GIT_LOCAL_CLEAN $$(git diff --exit-code > /dev/null && echo true || echo false)" >> version.h + adsb.pb-c.c: ../proto/adsb.proto protoc-c --c_out=./ --proto_path=$(dir $<) $<