Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # tabbed - tabbing interface
  2. # See LICENSE file for copyright and license details.
  3. include config.mk
  4. SRC = tabbed.c xembed.c
  5. OBJ = ${SRC:.c=.o}
  6. BIN = ${OBJ:.o=}
  7. all: options ${BIN}
  8. options:
  9. @echo tabbed build options:
  10. @echo "CFLAGS = ${CFLAGS}"
  11. @echo "LDFLAGS = ${LDFLAGS}"
  12. @echo "CC = ${CC}"
  13. .c.o:
  14. @echo CC $<
  15. @${CC} -c ${CFLAGS} $<
  16. ${OBJ}: config.h config.mk
  17. config.h:
  18. @echo creating $@ from config.def.h
  19. @cp config.def.h $@
  20. .o:
  21. @echo CC -o $@
  22. @${CC} -o $@ $< ${LDFLAGS}
  23. clean:
  24. @echo cleaning
  25. @rm -f ${BIN} ${OBJ} tabbed-${VERSION}.tar.gz
  26. dist: clean
  27. @echo creating dist tarball
  28. @mkdir -p tabbed-${VERSION}
  29. @cp -R LICENSE Makefile README config.def.h config.mk \
  30. tabbed.1 arg.h ${SRC} tabbed-${VERSION}
  31. @tar -cf tabbed-${VERSION}.tar tabbed-${VERSION}
  32. @gzip tabbed-${VERSION}.tar
  33. @rm -rf tabbed-${VERSION}
  34. install: all
  35. @echo installing executable files to ${DESTDIR}${PREFIX}/bin
  36. @mkdir -p "${DESTDIR}${PREFIX}/bin"
  37. @cp -f ${BIN} "${DESTDIR}${PREFIX}/bin"
  38. @chmod 755 "${DESTDIR}${PREFIX}/bin/tabbed"
  39. @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
  40. @mkdir -p "${DESTDIR}${MANPREFIX}/man1"
  41. @sed "s/VERSION/${VERSION}/g" < tabbed.1 > "${DESTDIR}${MANPREFIX}/man1/tabbed.1"
  42. @chmod 644 "${DESTDIR}${MANPREFIX}/man1/tabbed.1"
  43. @sed "s/VERSION/${VERSION}/g" < xembed.1 > "${DESTDIR}${MANPREFIX}/man1/xembed.1"
  44. @chmod 644 "${DESTDIR}${MANPREFIX}/man1/xembed.1"
  45. uninstall:
  46. @echo removing executable files from ${DESTDIR}${PREFIX}/bin
  47. @rm -f "${DESTDIR}${PREFIX}/bin/tabbed"
  48. @rm -f "${DESTDIR}${PREFIX}/bin/xembed"
  49. @echo removing manual pages from ${DESTDIR}${MANPREFIX}/man1
  50. @rm -f "${DESTDIR}${MANPREFIX}/man1/tabbed.1"
  51. @rm -f "${DESTDIR}${MANPREFIX}/man1/xembed.1"
  52. .PHONY: all options clean dist install uninstall