Xinqi Bao's Git

fmt_human: Improve types
[slstatus.git] / Makefile
1 # See LICENSE file for copyright and license details
2 # slstatus - suckless status monitor
3 .POSIX:
4
5 include config.mk
6
7 REQ = util
8 COM =\
9 components/battery\
10 components/cpu\
11 components/datetime\
12 components/disk\
13 components/entropy\
14 components/hostname\
15 components/ip\
16 components/kernel_release\
17 components/keyboard_indicators\
18 components/keymap\
19 components/load_avg\
20 components/netspeeds\
21 components/num_files\
22 components/ram\
23 components/run_command\
24 components/swap\
25 components/temperature\
26 components/uptime\
27 components/user\
28 components/volume\
29 components/wifi
30
31 all: slstatus
32
33 $(COM:=.o): config.mk $(REQ:=.h)
34 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
35
36 .c.o:
37 $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<
38
39 config.h:
40 cp config.def.h $@
41
42 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
43 $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS)
44
45 clean:
46 rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o)
47
48 dist:
49 rm -rf "slstatus-$(VERSION)"
50 mkdir -p "slstatus-$(VERSION)/components"
51 cp -R LICENSE Makefile README config.mk config.def.h \
52 arg.h slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \
53 slstatus.1 "slstatus-$(VERSION)"
54 tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
55 rm -rf "slstatus-$(VERSION)"
56
57 install: all
58 mkdir -p "$(DESTDIR)$(PREFIX)/bin"
59 cp -f slstatus "$(DESTDIR)$(PREFIX)/bin"
60 chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus"
61 mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
62 cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1"
63 chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"
64
65 uninstall:
66 rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
67 rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"