Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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/cat\
  9. components/cpu\
  10. components/datetime\
  11. components/disk\
  12. components/entropy\
  13. components/hostname\
  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/swap\
  23. components/temperature\
  24. components/uptime\
  25. components/user\
  26. components/volume\
  27. components/wifi
  28. all: slstatus
  29. $(COM:=.o): config.mk $(REQ:=.h) slstatus.h
  30. slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
  31. .c.o:
  32. $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<
  33. config.h:
  34. cp config.def.h $@
  35. slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
  36. $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS)
  37. clean:
  38. rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o)
  39. dist:
  40. rm -rf "slstatus-$(VERSION)"
  41. mkdir -p "slstatus-$(VERSION)/components"
  42. cp -R LICENSE Makefile README config.mk config.def.h \
  43. arg.h slstatus.c $(COM:=.c) $(REQ:=.c) $(REQ:=.h) \
  44. slstatus.1 "slstatus-$(VERSION)"
  45. tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
  46. rm -rf "slstatus-$(VERSION)"
  47. install: all
  48. mkdir -p "$(DESTDIR)$(PREFIX)/bin"
  49. cp -f slstatus "$(DESTDIR)$(PREFIX)/bin"
  50. chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus"
  51. mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
  52. cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1"
  53. chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"
  54. uninstall:
  55. rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
  56. rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"