logo

stagit

STAtic GIT web view generator (in C) git clone https://hacktivis.me/git/stagit.git

Makefile (2796B)


  1. .POSIX:
  2. NAME = stagit
  3. VERSION = 1.2
  4. # paths
  5. PREFIX = /usr/local
  6. MANPREFIX = ${PREFIX}/man
  7. DOCPREFIX = ${PREFIX}/share/doc/${NAME}
  8. LIBGIT_INC = -I/usr/local/include
  9. LIBGIT_LIB = -L/usr/local/lib -lgit2
  10. # use system flags.
  11. STAGIT_CFLAGS = ${LIBGIT_INC} ${CFLAGS}
  12. STAGIT_LDFLAGS = ${LIBGIT_LIB} ${LDFLAGS}
  13. STAGIT_CPPFLAGS = -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_BSD_SOURCE
  14. # Uncomment to enable workaround for older libgit2 which don't support this
  15. # option. This workaround will be removed in the future *pinky promise*.
  16. #STAGIT_CFLAGS += -DGIT_OPT_SET_OWNER_VALIDATION=-1
  17. SRC = \
  18. stagit.c\
  19. stagit-index.c
  20. COMPATSRC = \
  21. reallocarray.c\
  22. strlcat.c\
  23. strlcpy.c
  24. BIN = \
  25. stagit\
  26. stagit-index
  27. MAN1 = \
  28. stagit.1\
  29. stagit-index.1
  30. DOC = \
  31. LICENSE\
  32. README
  33. HDR = compat.h
  34. COMPATOBJ = \
  35. reallocarray.o\
  36. strlcat.o\
  37. strlcpy.o
  38. OBJ = ${SRC:.c=.o} ${COMPATOBJ}
  39. all: ${BIN}
  40. .o:
  41. ${CC} -o $@ ${LDFLAGS}
  42. .c.o:
  43. ${CC} -o $@ -c $< ${STAGIT_CFLAGS} ${STAGIT_CPPFLAGS}
  44. dist:
  45. rm -rf ${NAME}-${VERSION}
  46. mkdir -p ${NAME}-${VERSION}
  47. cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \
  48. Makefile favicon.png logo.png style.css sorttable.css sorttable.js \
  49. example_create.sh example_post-receive.sh \
  50. ${NAME}-${VERSION}
  51. # make tarball
  52. tar -cf - ${NAME}-${VERSION} | \
  53. gzip -c > ${NAME}-${VERSION}.tar.gz
  54. rm -rf ${NAME}-${VERSION}
  55. ${OBJ}: ${HDR}
  56. stagit: stagit.o ${COMPATOBJ}
  57. ${CC} -o $@ stagit.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
  58. stagit-index: stagit-index.o ${COMPATOBJ}
  59. ${CC} -o $@ stagit-index.o ${COMPATOBJ} ${STAGIT_LDFLAGS}
  60. clean:
  61. rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
  62. install: all
  63. # installing executable files.
  64. mkdir -p ${DESTDIR}${PREFIX}/bin
  65. cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
  66. for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
  67. # installing example files.
  68. mkdir -p ${DESTDIR}${DOCPREFIX}
  69. cp -f style.css\
  70. sorttable.css\
  71. sorttable.js\
  72. favicon.png\
  73. logo.png\
  74. example_create.sh\
  75. example_post-receive.sh\
  76. README\
  77. ${DESTDIR}${DOCPREFIX}
  78. # installing manual pages.
  79. mkdir -p ${DESTDIR}${MANPREFIX}/man1
  80. cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
  81. for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
  82. uninstall:
  83. # removing executable files.
  84. for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
  85. # removing example files.
  86. rm -f \
  87. ${DESTDIR}${DOCPREFIX}/style.css\
  88. ${DESTDIR}${DOCPREFIX}/sorttable.css\
  89. ${DESTDIR}${DOCPREFIX}/sorttable.js\
  90. ${DESTDIR}${DOCPREFIX}/favicon.png\
  91. ${DESTDIR}${DOCPREFIX}/logo.png\
  92. ${DESTDIR}${DOCPREFIX}/example_create.sh\
  93. ${DESTDIR}${DOCPREFIX}/example_post-receive.sh\
  94. ${DESTDIR}${DOCPREFIX}/README
  95. -rmdir ${DESTDIR}${DOCPREFIX}
  96. # removing manual pages.
  97. for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
  98. .PHONY: all clean dist install uninstall