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/battery\
  8. components/cpu\
  9. components/datetime\
  10. components/disk\
  11. components/entropy\
  12. components/hostname\
  13. components/ip\
  14. components/kernel_release\
  15. components/keyboard_indicators\
  16. components/keymap\
  17. components/load_avg\
  18. components/netspeeds\
  19. components/num_files\
  20. components/ram\
  21. components/run_command\
  22. components/separator\
  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"