From 94b3e32c2775808bc49ac949615a252b5c636b14 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 24 Nov 2011 16:17:23 +0100 Subject: lua,build: define version --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6eaa516..aaac99a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,15 @@ -include config.mk +VERSION = 0.1 +GIT_REV := $(shell test -d .git && git describe --always --dirty || echo exported) + +ifneq ($(GIT_REV), exported) +FULL_VERSION := $(GIT_REV) +FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION)) +else +FULL_VERSION := $(VERSION) +endif + ABI_VERSION := 0 SONAME := libuniso.so.$(ABI_VERSION) @@ -9,7 +19,7 @@ INCLUDES := uniso.h TARGETS = libuniso.a $(progs-y) $(shlibs-y) $(lualibs-y) CFLAGS ?= -g -Wall -Werror -CFLAGS += -fPIC +CFLAGS += -fPIC -I. -DVERSION=\"$(FULL_VERSION)\" CFLAGS += -I. LDFLAGS += -L. -- cgit v1.2.3