8 SYSCONFDIR=$(PREFIX)/etc
12 CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
16 CFLAGS+=-DSYSCONFDIR=\"$(SYSCONFDIR)\"
17 CFLAGS+=-DVERSION=\"${GIT_VERSION}\"
21 VERSION:=$(shell git describe --tags --abbrev=0)
22 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
24 ifeq ($(shell uname),Linux)
27 LDFLAGS+=-liw -lasound
30 ifeq ($(shell uname),GNU/kFreeBSD)
34 CFLAGS+=$(EXTRA_CFLAGS)
36 OBJS:=$(wildcard src/*.c *.c)
40 @$(CC) $(CFLAGS) -c -o $@ $<
44 @$(CC) $(CFLAGS) -c -o $@ $<
50 @$(CC) -o $@ src/*.o *.o $(LDFLAGS)
63 install -m 755 -d $(DESTDIR)/usr/bin
64 install -m 755 -d $(DESTDIR)/etc
65 install -m 755 -d $(DESTDIR)/usr/share/man/man1
66 install -m 755 i3status $(DESTDIR)/usr/bin/i3status
67 # Allow network configuration for getting the link speed
68 (which setcap && setcap cap_net_admin=ep $(DESTDIR)/usr/bin/i3status) || true
69 install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
70 install -m 644 man/i3status.1 $(DESTDIR)/usr/share/man/man1
73 [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
74 mkdir i3status-${VERSION}
75 find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|h\)" -or -name "Makefile" -or -name "LICENSE" \) -exec cp '{}' i3status-${VERSION} \;
76 mkdir i3status-${VERSION}/src
77 mkdir i3status-${VERSION}/man
78 find src -maxdepth 1 -type f \( -regex ".*\.\(c\|h\)" \) -exec cp '{}' i3status-${VERSION}/src \;
79 find man -maxdepth 1 -type f \( -regex ".*\.\(1\|man\|conf\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION}/man \;
80 cp -r include i3status-${VERSION}
81 sed -e 's/^GIT_VERSION:=\(.*\)/GIT_VERSION=${GIT_VERSION}/g;s/^VERSION:=\(.*\)/VERSION=${VERSION}/g' Makefile > i3status-${VERSION}/Makefile
82 tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
83 rm -rf i3status-${VERSION}