Makefile (1876B)
1 # See LICENSE file for copyright and license details 2 # swstatus - suckless status monitor 3 .POSIX: 4 5 include config.mk 6 7 REQ = util 8 X11COM = components/keyboard_indicators components/keymap 9 COM =\ 10 components/battery\ 11 components/cat\ 12 components/cpu\ 13 components/datetime\ 14 components/disk\ 15 components/entropy\ 16 components/hostname\ 17 components/ip\ 18 components/kernel_release\ 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: swstatus 32 33 $(COM:=.o) $(X11COM:=.o): config.mk $(REQ:=.h) slstatus.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 swstatus: slstatus.o $(COM:=.o) $(KEYBOARD:=.o) $(REQ:=.o) 43 $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(KEYBOARD:=.o) $(REQ:=.o) slstatus.o $(LDLIBS) 44 45 clean: 46 rm -f swstatus slstatus.o $(COM:=.o) $(X11COM:=.o) $(REQ:=.o) swstatus-${VERSION}.tar.gz 47 48 dist: 49 rm -rf "swstatus-$(VERSION)" 50 mkdir -p "swstatus-$(VERSION)/components" 51 cp -R LICENSE Makefile README config.mk config.def.h \ 52 arg.h slstatus.h slstatus.c $(REQ:=.c) $(REQ:=.h) \ 53 "swstatus-$(VERSION)" 54 cp -R $(COM:=.c) $(X11COM:=.c) "swstatus-$(VERSION)/components" 55 tar -cf - "swstatus-$(VERSION)" | gzip -c > "swstatus-$(VERSION).tar.gz" 56 rm -rf "swstatus-$(VERSION)" 57 58 install: all 59 mkdir -p "$(DESTDIR)$(PREFIX)/bin" 60 cp -f swstatus "$(DESTDIR)$(PREFIX)/bin" 61 chmod 755 "$(DESTDIR)$(PREFIX)/bin/swstatus" 62 #TODO: manpages (someday) 63 # mkdir -p "$(DESTDIR)$(MANPREFIX)/man1" 64 # cp -f swstatus.1 "$(DESTDIR)$(MANPREFIX)/man1" 65 # chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/swstatus.1" 66 67 uninstall: 68 rm -f "$(DESTDIR)$(PREFIX)/bin/swstatus" 69 # rm -f "$(DESTDIR)$(MANPREFIX)/man1/swstatus.1"