aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ce1eb37..ec2acc0 100644
--- a/Makefile
+++ b/Makefile
@@ -19,13 +19,17 @@ CFLAGS_EXTRA += $(shell pkg-config --cflags --libs libnotify)
CFLAGS_LIBAV := $(shell pkg-config --cflags --libs libavformat libavutil 2>/dev/null)
ifneq ($(CFLAGS_LIBAV),)
CFLAGS_EXTRA += -DHAVE_LIBAV $(CFLAGS_LIBAV)
-CFLAGS_EXTRA += -lmagic
+CFLAGS_MAGIC := $(shell pkg-config --cflags --libs libmagic 2>/dev/null)
+ifneq ($(CFLAGS_MAGIC),)
+CFLAGS_EXTRA += -DHAVE_MAGIC $(CFLAGS_MAGIC)
+endif
endif
LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
# this is just a fallback in case you do not use git but downloaded
# a release tarball...
-VERSION := 0.9.0
+DISTVER := 0.9.3
+VERSION ?= $(shell git describe --long 2>/dev/null || echo $(DISTVER))
all: mpd-notification README.html
@@ -36,7 +40,7 @@ config.h:
$(CP) config.def.h config.h
version.h: $(wildcard .git/HEAD .git/index .git/refs/tags/*) Makefile
- printf "#ifndef VERSION\n#define VERSION \"%s\"\n#endif\n" $(shell git describe --long 2>/dev/null || echo ${VERSION}) > $@
+ printf "#ifndef VERSION\n#define VERSION \"%s\"\n#endif\n" "$(VERSION)" > $@
README.html: README.md
$(MD) README.md > README.html
@@ -47,6 +51,7 @@ install-bin: mpd-notification
$(INSTALL) -D -m0755 mpd-notification $(DESTDIR)/usr/bin/mpd-notification
ifneq ($(CFLAGS_SYSTEMD),)
$(INSTALL) -D -m0644 systemd/mpd-notification.service $(DESTDIR)/usr/lib/systemd/user/mpd-notification.service
+ $(INSTALL) -D -m0644 systemd/Upholds-mpd-notification.conf $(DESTDIR)/usr/lib/systemd/user/mpd.service.d/Upholds-mpd-notification.conf
endif
install-doc: README.html
@@ -62,6 +67,6 @@ distclean:
$(RM) -f *.o *~ README.html mpd-notification version.h config.h
release:
- git archive --format=tar.xz --prefix=mpd-notification-$(VERSION)/ $(VERSION) > mpd-notification-$(VERSION).tar.xz
- gpg --armor --detach-sign --comment mpd-notification-$(VERSION).tar.xz mpd-notification-$(VERSION).tar.xz
- git notes --ref=refs/notes/signatures/tar add -C $$(git archive --format=tar --prefix=mpd-notification-$(VERSION)/ $(VERSION) | gpg --armor --detach-sign --comment mpd-notification-$(VERSION).tar | git hash-object -w --stdin) $(VERSION)
+ git archive --format=tar.xz --prefix=mpd-notification-$(DISTVER)/ $(DISTVER) > mpd-notification-$(DISTVER).tar.xz
+ gpg --armor --detach-sign --comment mpd-notification-$(DISTVER).tar.xz mpd-notification-$(DISTVER).tar.xz
+ git notes --ref=refs/notes/signatures/tar add -C $$(git archive --format=tar --prefix=mpd-notification-$(DISTVER)/ $(DISTVER) | gpg --armor --detach-sign --comment mpd-notification-$(DISTVER).tar | git hash-object -w --stdin) $(DISTVER)