Makefile (1738B)
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/pipe_command\ 23 components/ram\ 24 components/run_command\ 25 components/separator\ 26 components/swap\ 27 components/temperature\ 28 components/uptime\ 29 components/user\ 30 components/volume\ 31 components/wifi\ 32 components/wintitle 33 34 all: slstatus 35 36 $(COM:=.o): config.mk $(REQ:=.h) 37 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h) 38 39 .c.o: 40 $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< 41 42 config.h: 43 cp config.def.h $@ 44 45 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) 46 $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS) 47 48 clean: 49 rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o) 50 51 dist: 52 rm -rf "slstatus-$(VERSION)" 53 mkdir -p "slstatus-$(VERSION)/components" 54 cp -R LICENSE Makefile README config.mk config.def.h \ 55 arg.h slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \ 56 slstatus.1 "slstatus-$(VERSION)" 57 tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz" 58 rm -rf "slstatus-$(VERSION)" 59 60 install: all 61 mkdir -p "$(DESTDIR)$(PREFIX)/bin" 62 cp -f slstatus "$(DESTDIR)$(PREFIX)/bin" 63 chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus" 64 mkdir -p "$(DESTDIR)$(MANPREFIX)/man1" 65 cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1" 66 chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1" 67 68 uninstall: 69 rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus" 70 rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"