8 SYSCONFDIR=$(PREFIX)/etc
12 CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
16 CPPFLAGS+=-DSYSCONFDIR=\"$(SYSCONFDIR)\"
17 CPPFLAGS+=-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)
26 CPPFLAGS+=-D_GNU_SOURCE
31 ifeq ($(shell uname),GNU/kFreeBSD)
35 CFLAGS+=$(EXTRA_CFLAGS)
37 OBJS:=$(wildcard src/*.c *.c)
41 @$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
45 @$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
51 @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
64 install -m 755 -d $(DESTDIR)$(PREFIX)/bin
65 install -m 755 -d $(DESTDIR)$(SYSCONFDIR)
66 install -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1
67 install -m 755 i3status $(DESTDIR)$(PREFIX)/bin/i3status
68 # Allow network configuration for getting the link speed
69 (which setcap && setcap cap_net_admin=ep $(DESTDIR)$(PREFIX)/bin/i3status) || true
70 install -m 644 i3status.conf $(DESTDIR)$(SYSCONFDIR)/i3status.conf
71 install -m 644 man/i3status.1 $(DESTDIR)$(PREFIX)/share/man/man1
74 [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
75 mkdir i3status-${VERSION}
76 find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|h\)" -or -name "Makefile" -or -name "LICENSE" \) -exec cp '{}' i3status-${VERSION} \;
77 mkdir i3status-${VERSION}/src
78 mkdir i3status-${VERSION}/man
79 find src -maxdepth 1 -type f \( -regex ".*\.\(c\|h\)" \) -exec cp '{}' i3status-${VERSION}/src \;
80 find man -maxdepth 1 -type f \( -regex ".*\.\(1\|man\|conf\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION}/man \;
81 cp -r include i3status-${VERSION}
82 sed -e 's/^GIT_VERSION:=\(.*\)/GIT_VERSION=${GIT_VERSION}/g;s/^VERSION:=\(.*\)/VERSION=${VERSION}/g' Makefile > i3status-${VERSION}/Makefile
83 tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
84 rm -rf i3status-${VERSION}