Makefile (1690B)
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/separator\ 25 components/swap\ 26 components/temperature\ 27 components/uptime\ 28 components/user\ 29 components/volume\ 30 components/wifi 31 32 all: slstatus 33 34 $(COM:=.o): config.mk $(REQ:=.h) 35 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h) 36 37 .c.o: 38 $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< 39 40 config.h: 41 cp config.def.h $@ 42 43 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) 44 $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS) 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"