suckless/slstatus

Makefile in master
Repositories | Summary | Log | Files | README | LICENSE

Makefile (1773B) download


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