]> git.sur5r.net Git - i3/i3status/blob - Makefile
Bump version in manpage
[i3/i3status] / Makefile
1 CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
2 CFLAGS+=-g
3 CFLAGS+=-std=gnu99
4 CFLAGS+=-pedantic
5 CFLAGS+=-DPREFIX=\"\"
6 CFLAGS+=-DVERSION=\"${GIT_VERSION}\"
7 CFLAGS+=-Iinclude
8 LDFLAGS+=-lconfuse
9
10 VERSION:=$(shell git describe --tags --abbrev=0)
11 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
12
13 ifeq ($(shell uname),Linux)
14 CFLAGS+=-DLINUX
15 CFLAGS+=-D_GNU_SOURCE
16 LDFLAGS+=-liw -lasound
17 endif
18
19 ifeq ($(shell uname),GNU/kFreeBSD)
20 CFLAGS+=-lbsd
21 endif
22
23 CFLAGS+=$(EXTRA_CFLAGS)
24
25 OBJS:=$(wildcard src/*.c *.c)
26 OBJS:=$(OBJS:.c=.o)
27
28 src/%.o: src/%.c
29         @$(CC) $(CFLAGS) -c -o $@ $<
30         @echo " CC $<"
31
32 %.o: %.c %.h
33         @$(CC) $(CFLAGS) -c -o $@ $<
34         @echo " CC $<"
35
36 all: i3status manpage
37
38 i3status: ${OBJS}
39         @$(CC) -o $@ src/*.o *.o $(LDFLAGS)
40         @echo " LD $@"
41
42 clean:
43         rm -f *.o src/*.o
44
45 distclean: clean
46         rm -f i3status
47
48 manpage:
49         make -C man
50
51 install:
52         install -m 755 -d $(DESTDIR)/usr/bin
53         install -m 755 -d $(DESTDIR)/etc
54         install -m 755 -d $(DESTDIR)/usr/share/man/man1
55         install -m 755 i3status $(DESTDIR)/usr/bin/i3status
56         # Allow network configuration for getting the link speed
57         (which setcap && setcap cap_net_admin=ep $(DESTDIR)/usr/bin/i3status) || true
58         install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
59         install -m 644 man/i3status.1 $(DESTDIR)/usr/share/man/man1
60
61 release:
62         [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
63         mkdir i3status-${VERSION}
64         find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|h\)" -or -name "Makefile" -or -name "LICENSE" \) -exec cp '{}' i3status-${VERSION} \;
65         mkdir i3status-${VERSION}/src
66         mkdir i3status-${VERSION}/man
67         find src -maxdepth 1 -type f \( -regex ".*\.\(c\|h\)" \) -exec cp '{}' i3status-${VERSION}/src \;
68         find man -maxdepth 1 -type f \( -regex ".*\.\(1\|man\|conf\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION}/man \;
69         sed -e 's/^GIT_VERSION:=\(.*\)/GIT_VERSION=${GIT_VERSION}/g;s/^VERSION:=\(.*\)/VERSION=${VERSION}/g' Makefile > i3status-${VERSION}/Makefile
70         tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
71         rm -rf i3status-${VERSION}