]> git.sur5r.net Git - i3/i3status/blob - Makefile
debian: fix issues with initscript
[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+=-I.
7
8 VERSION=$(shell git describe --tags --abbrev=0)
9
10 ifeq ($(shell uname),Linux)
11 CFLAGS+=-DLINUX
12 CFLAGS+=-D_GNU_SOURCE
13 endif
14
15 # Define this if you want i3status to spit out dzen2-compatible output on stdout
16 CFLAGS+=-DDZEN
17 CFLAGS+=$(EXTRA_CFLAGS)
18
19 src/%.o: src/%.c
20         @$(CC) $(CFLAGS) -c -o $@ $<
21         @echo " CC $<"
22
23 %.o: %.c %.h
24         @$(CC) $(CFLAGS) -c -o $@ $<
25         @echo " CC $<"
26
27 i3status: src/general.o src/config.o src/get_load.o src/output.o src/get_cpu_temperature.o src/process_runs.o src/get_eth_info.o src/get_ip_addr.o src/get_wireless_info.o src/get_battery_info.o src/get_ipv6_addr.o i3status.o
28         @$(CC) $(LDFLAGS) -o $@ src/*.o *.o
29         @echo " LD $@"
30
31 clean:
32         rm -f *.o src/*.o
33
34 distclean: clean
35         rm -f i3status
36
37 install:
38         install -m 755 -d $(DESTDIR)/usr/bin
39         install -m 755 -d $(DESTDIR)/etc
40         install -m 755 -d $(DESTDIR)/usr/share/man/man1
41         install -m 755 i3status $(DESTDIR)/usr/bin/i3status
42         install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
43         install -m 644 i3status.1 $(DESTDIR)/usr/share/man/man1
44
45 release:
46         [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
47         mkdir i3status-${VERSION}
48         find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|1\|h\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION} \;
49         tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
50         rm -rf i3status-${VERSION}
51
52 all: i3status