]> git.sur5r.net Git - i3/i3status/blobdiff - Makefile
add yajl compat code
[i3/i3status] / Makefile
index 644edd1c2719ff3166093e2ec46098d633ec1ca5..807b321f5bf5b3376a82aa887e02f00678f8959f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ CPPFLAGS+=-DSYSCONFDIR=\"$(SYSCONFDIR)\"
 CPPFLAGS+=-DVERSION=\"${GIT_VERSION}\"
 CFLAGS+=-Iinclude
 LIBS+=-lconfuse
+LIBS+=-lyajl
 
 VERSION:=$(shell git describe --tags --abbrev=0)
 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
@@ -34,6 +35,10 @@ endif
 
 CFLAGS+=$(EXTRA_CFLAGS)
 
+# Fallback for libyajl 1 which did not include yajl_version.h. We need
+# YAJL_MAJOR from that file to decide which code path should be used.
+CFLAGS += -idirafter $(TOPDIR)/yajl-fallback
+
 OBJS:=$(wildcard src/*.c *.c)
 OBJS:=$(OBJS:.c=.o)
 
@@ -61,14 +66,14 @@ manpage:
        $(MAKE) -C man
 
 install:
-       install -m 755 -d $(DESTDIR)/usr/bin
-       install -m 755 -d $(DESTDIR)/etc
-       install -m 755 -d $(DESTDIR)/usr/share/man/man1
-       install -m 755 i3status $(DESTDIR)/usr/bin/i3status
+       install -m 755 -d $(DESTDIR)$(PREFIX)/bin
+       install -m 755 -d $(DESTDIR)$(SYSCONFDIR)
+       install -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1
+       install -m 755 i3status $(DESTDIR)$(PREFIX)/bin/i3status
        # Allow network configuration for getting the link speed
-       (which setcap && setcap cap_net_admin=ep $(DESTDIR)/usr/bin/i3status) || true
-       install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
-       install -m 644 man/i3status.1 $(DESTDIR)/usr/share/man/man1
+       (which setcap && setcap cap_net_admin=ep $(DESTDIR)$(PREFIX)/bin/i3status) || true
+       install -m 644 i3status.conf $(DESTDIR)$(SYSCONFDIR)/i3status.conf
+       install -m 644 man/i3status.1 $(DESTDIR)$(PREFIX)/share/man/man1
 
 release:
        [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}