diff options
author | Peter Wu <lekensteyn@gmail.com> | 2013-09-28 16:38:04 +0200 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2013-09-28 16:38:04 +0200 |
commit | f6523bc6bc58665a38b34a8b00bae048f0a0923d (patch) | |
tree | 273fabc8a0db6dfc2ad13697682eb4aa96626875 /Makefile | |
parent | 89dce898377abfdde54d784b050841a282ca3151 (diff) | |
download | ltunify-f6523bc6bc58665a38b34a8b00bae048f0a0923d.tar.gz |
ltunify: Add --version (-V) option, use git version if possible
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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: |