The repository formerly known as dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. PREFIX = ~/.local
  2. BIN += atch
  3. BIN += dtch
  4. BIN += glitch
  5. BIN += hnel
  6. BIN += modem
  7. BIN += open
  8. BIN += pbcopy
  9. BIN += pbd
  10. BIN += pbpaste
  11. BIN += pngo
  12. BIN += psf2png
  13. BIN += scheme
  14. BIN += ttpre
  15. BIN += wake
  16. BIN += xx
  17. BIN_BSD += rec
  18. BIN_LINUX += bri
  19. BIN_LINUX += fbatt
  20. BIN_LINUX += fbclock
  21. BIN_LINUX += psfed
  22. BIN_ALL = $(BIN) $(BIN_BSD) $(BIN_LINUX)
  23. MAN_ALL = $(BIN_ALL:%=man/%.1)
  24. CFLAGS += -Wall -Wextra -Wpedantic
  25. LDLIBS = -lm -lutil -lz
  26. any: .gitignore tags $(BIN)
  27. bsd: any $(BIN_BSD)
  28. linux: any $(BIN_LINUX)
  29. scheme.h: scheme
  30. ./scheme -c > scheme.h
  31. fbatt.o fbclock.o: scheme.h
  32. psf2png.o scheme.o: png.h
  33. atch: dtch
  34. ln -f dtch atch
  35. open pbcopy pbpaste: pbd
  36. ln -f pbd $@
  37. scheme.png: scheme
  38. ./scheme -t -g > scheme.png
  39. tags: *.h *.c
  40. ctags -w *.h *.c
  41. .gitignore: Makefile
  42. echo '*.o' scheme.h scheme.png tags $(BIN_ALL) \
  43. | tr ' ' '\n' \
  44. > .gitignore
  45. clean:
  46. rm -f *.o scheme.h scheme.png tags $(BIN_ALL)
  47. README: man/bin.7
  48. mandoc man/bin.7 | col -b -x > README
  49. setuid: bri
  50. chown root bri
  51. chmod u+s bri
  52. link:
  53. mkdir -p $(PREFIX)/bin $(PREFIX)/share/man/man1
  54. ln -s -f $(BIN_ALL:%=$(PWD)/%) $(PREFIX)/bin
  55. ln -s -f $(MAN_ALL:%=$(PWD)/%) $(PREFIX)/share/man/man1
  56. unlink:
  57. rm -f $(BIN_ALL:%=$(PREFIX)/bin/%)
  58. rm -f $(MAN_ALL:man/%=$(PREFIX)/share/man/man1/%)