]> git.sur5r.net Git - i3/i3status/blob - Makefile
Fix linking (Thanks Atsutane)
[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 LDFLAGS+=-liw
14 endif
15
16 ifeq ($(shell uname),GNU/kFreeBSD)
17 CFLAGS+=-lbsd
18 endif
19
20 # Define this if you want i3status to spit out dzen2-compatible output on stdout
21 #CFLAGS+=-DDZEN
22 CFLAGS+=$(EXTRA_CFLAGS)
23
24 src/%.o: src/%.c
25         @$(CC) $(CFLAGS) -c -o $@ $<
26         @echo " CC $<"
27
28 %.o: %.c %.h
29         @$(CC) $(CFLAGS) -c -o $@ $<
30         @echo " CC $<"
31
32 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
33         @$(CC) -o $@ src/*.o *.o $(LDFLAGS)
34         @echo " LD $@"
35
36 clean:
37         rm -f *.o src/*.o
38
39 distclean: clean
40         rm -f i3status
41
42 install:
43         install -m 755 -d $(DESTDIR)/usr/bin
44         install -m 755 -d $(DESTDIR)/etc
45         install -m 755 -d $(DESTDIR)/usr/share/man/man1
46         install -m 755 i3status $(DESTDIR)/usr/bin/i3status
47         install -m 644 i3status.conf $(DESTDIR)/etc/i3status.conf
48         install -m 644 i3status.1 $(DESTDIR)/usr/share/man/man1
49
50 release:
51         [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
52         mkdir i3status-${VERSION}
53         find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|1\|h\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION} \;
54         tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION}
55         rm -rf i3status-${VERSION}
56
57 all: i3status