From f6523bc6bc58665a38b34a8b00bae048f0a0923d Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 28 Sep 2013 16:38:04 +0200 Subject: ltunify: Add --version (-V) option, use git version if possible --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b68ddfd..8116950 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,13 @@ udevrulesdir ?= /etc/udev/rules.d udevrule = 42-logitech-unify-permissions.rules +PACKAGE_VERSION ?= $(shell git describe --dirty 2>/dev/null | sed s/^v//) +ifeq (PACKAGE_VERSION, "") + LTUNIFY_DEFINES := +else + LTUNIFY_DEFINES := -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" +endif + %: %.c $(CC) $(CFLAGS) -o $(OUTDIR)$@ $< @@ -17,7 +24,7 @@ all: ltunify read-dev-usbmon read-dev-usbmon: read-dev-usbmon.c hidraw.c ltunify: ltunify.c hidpp20.c - $(CC) $(CFLAGS) -o $(OUTDIR)$@ $< -lrt + $(CC) $(CFLAGS) -o $(OUTDIR)$@ $< -lrt $(LTUNIFY_DEFINES) .PHONY: all clean install-home install install-udevrule uninstall clean: -- cgit v1.2.1