Xinqi Bao's Git

Revert "Add basic backlight percentage support"
[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 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
34 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
35 $(COM:=.o): config.mk $(REQ:=.h)
36
37 config.h:
38 cp config.def.h $@
39
40 .o:
41 $(CC) -o $@ $(LDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(LDLIBS)
42
43 .c.o:
44 $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<
45
46 clean:
47 rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o)
48
49 dist:
50 rm -rf "slstatus-$(VERSION)"
51 mkdir -p "slstatus-$(VERSION)/components"
52 cp -R LICENSE Makefile README config.mk config.def.h \
53 arg.h slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \
54 slstatus.1 "slstatus-$(VERSION)"
55 tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
56 rm -rf "slstatus-$(VERSION)"
57
58 install: all
59 mkdir -p "$(DESTDIR)$(PREFIX)/bin"
60 cp -f slstatus "$(DESTDIR)$(PREFIX)/bin"
61 chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus"
62 mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
63 cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1"
64 chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"
65
66 uninstall:
67 rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
68 rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"