Makefile 1.7 KB

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