From 2b81b63a40f057e1241fd5a9a4d0d02f3893d230 Mon Sep 17 00:00:00 2001 From: "Oliver, Jonathan" Date: Fri, 3 Jun 2016 11:07:33 -0600 Subject: [PATCH] Added Makefile to help automate build, test, and publish. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b3bf9a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +SOURCE_VERSION := 1.0 + +version: + $(eval PREFIX := $(SOURCE_VERSION).) + $(eval CURRENT := $(shell git describe 2>/dev/null)) + $(eval EXPECTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr -1 +)) + $(eval INCREMENTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr 0 +)) + @if [ "$(CURRENT)" != "$(EXPECTED)" ]; then git tag -a "$(INCREMENTED)" -m "" 2>/dev/null || true; fi