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