]> git.sur5r.net Git - i3/i3status/blob - Makefile
makefile: remove obsolete compilation flag
[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+=-Iinclude
7 LDFLAGS+=-lconfuse
8
9 VERSION=$(shell git describe --tags --abbrev=0)
10
11 ifeq ($(shell uname),Linux)
12 CFLAGS+=-DLINUX
13 CFLAGS+=-D_GNU_SOURCE
14 LDFLAGS+=-liw -lasound
15 endif
16
17 ifeq ($(shell uname),GNU/kFreeBSD)
18 CFLAGS+=-lbsd
19 endif
20
21 CFLAGS+=$(EXTRA_CFLAGS)
22
23 OBJS:=$(wildcard src/*.c *.c)
24 OBJS:=$(OBJS:.c=.o)
25
26 src/%.o: src/%.c
27         @$(CC) $(CFLAGS) -c -o $@ $<
28         @echo " CC $<"
29
30 %.o: %.c %.h
31         @$(CC) $(CFLAGS) -c -o $@ $<
32         @echo " CC $<"
33
34 all: i3status manpage
35
36 i3status: ${OBJS}
37         @$(CC) -o $@ src/*.o *.o $(LDFLAGS)
38         @echo " LD $@"
39
40 clean:
41         rm -f *.o src/*.o
42
43 distclean: clean
44         rm -f i3status
45
46 manpage:
47         make -C man
48
49 install:
50         install -m 755 -d $(DESTDIR)/usr/bin
51         install -m 755 -d $(DESTDIR)/etc
52         install -m 755 -d $(DESTDIR)/usr/share/man/man1
53         install -m 755 i3status $(DESTDIR)/usr/bin/i3status
54         # Allow network configuration for getting the link speed
55         (which setcap && setcap cap_net_admin=ep $(DESTDIR)/usr/bin/i3status) || true
56         install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
57         install -m 644 man/i3status.1 $(DESTDIR)/usr/share/man/man1
58
59 release:
60         [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
61         mkdir i3status-${VERSION}
62         find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|h\)" -or -name "Makefile" -or -name "LICENSE" \) -exec cp '{}' i3status-${VERSION} \;
63         mkdir i3status-${VERSION}/src
64         mkdir i3status-${VERSION}/man
65         find src -maxdepth 1 -type f \( -regex ".*\.\(c\|h\)" \) -exec cp '{}' i3status-${VERSION}/src \;
66         find man -maxdepth 1 -type f \( -regex ".*\.\(1\|man\|conf\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION}/man \;
67         tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
68         rm -rf i3status-${VERSION}