Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # dwm - dynamic window manager
  2. # See LICENSE file for copyright and license details.
  3. include config.mk
  4. SRC = drw.c dwm.c util.c stackctl.c
  5. OBJ = ${SRC:.c=.o}
  6. all: options dwm
  7. options:
  8. @echo dwm build options:
  9. @echo "CFLAGS = ${CFLAGS}"
  10. @echo "LDFLAGS = ${LDFLAGS}"
  11. @echo "CC = ${CC}"
  12. .c.o:
  13. @echo CC $<
  14. @${CC} -c ${CFLAGS} $<
  15. ${OBJ}: config.h config.mk
  16. config.h:
  17. @echo creating $@ from config.def.h
  18. @cp config.def.h $@
  19. dwm: ${OBJ}
  20. @echo CC -o $@
  21. @${CC} -o $@ ${OBJ} ${LDFLAGS}
  22. object-clean:
  23. @rm -vf *.o
  24. config-clean:
  25. @rm -vf config.h
  26. source-clean:
  27. @rm -vf dwm-${VERSION}.tar.gz
  28. binary-clean:
  29. @rm -vf dwm
  30. clean: object-clean config-clean source-clean binary-clean
  31. dist: clean
  32. @echo creating dist tarball
  33. @mkdir -p dwm-${VERSION}
  34. @cp -R LICENSE TODO BUGS Makefile README config.def.h config.mk \
  35. dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
  36. @tar -cf dwm-${VERSION}.tar dwm-${VERSION}
  37. @gzip dwm-${VERSION}.tar
  38. @rm -rf dwm-${VERSION}
  39. install-dwm: dwm
  40. @echo installing executable file to ${DESTDIR}${PREFIX}/bin
  41. @mkdir -p ${DESTDIR}${PREFIX}/bin
  42. @cp -f ${PWD}/dwm ${DESTDIR}${PREFIX}/bin
  43. @chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
  44. install-scripts: xsetroot.sh trackpad-toggle.sh
  45. @echo installing scripts to ${DESTDIR}${PREFIX}/bin
  46. @ln -svf ${PWD}/xsetroot.sh ${DESTDIR}${PREFIX}/bin
  47. @chmod 755 ${DESTDIR}${PREFIX}/bin/xsetroot.sh
  48. @ln -svf ${PWD}/trackpad-toggle.sh ${DESTDIR}${PREFIX}/bin/trackpad-toggle
  49. @chmod 755 ${DESTDIR}${PREFIX}/bin/trackpad-toggle
  50. install-man: dwm.1
  51. @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
  52. @mkdir -p ${DESTDIR}${MANPREFIX}/man1
  53. @sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
  54. @chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
  55. install: install-dwm install-scripts install-man
  56. uninstall-dwm:
  57. @echo removing executable file from ${DESTDIR}${PREFIX}/bin
  58. @rm -vf ${DESTDIR}${PREFIX}/bin/dwm
  59. uninstall-scripts:
  60. @echo removing scripts from ${DESTDIR}${PREFIX}/bin
  61. @rm -vf ${DESTDIR}${PREFIX}/bin/xsetroot.sh
  62. @rm -vf ${DESTDIR}${PREFIX}/bin/trackpad-toggle
  63. uninstall-man:
  64. @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
  65. @rm -vf ${DESTDIR}${MANPREFIX}/man1/dwm.1
  66. uninstall: uninstall-dwm uninstall-scripts uninstall-man
  67. docs: Doxyfile
  68. doxygen Doxyfile
  69. .PHONY: all options clean dist install-dwm install-scripts install-man install uninstall-dwm uninstall-scripts uninstall-man uninstall object-clean config-clean source-clean binary-clean docs