diff options
-rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,12 +1,21 @@ VERSION = 0.1 +GIT_REV := $(shell test -d .git && git describe || echo exported) +ifneq ($(GIT_REV), exported) +FULL_VERSION := $(GIT_REV) +FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION)) +else +FULL_VERSION := $(VERSION) +endif + + OBJS = rc.o LIBS = -lrc DEBUGFLAGS = -g -Wall -Werror CFLAGS += $(DEBUGFLAGS) -CFLAGS += -DVERSION=\"$(VERSION)\" +CFLAGS += -DVERSION=\"$(FULL_VERSION)\" LDFLAGS += -L/lib |