2015-12-05 20:07:52 +00:00
|
|
|
include config.mk
|
|
|
|
|
2015-12-26 20:05:55 +00:00
|
|
|
NAME = stagit
|
2018-12-25 12:44:02 +00:00
|
|
|
VERSION = 0.9
|
2019-02-09 14:02:38 +00:00
|
|
|
|
2015-12-05 20:07:52 +00:00
|
|
|
SRC = \
|
2015-12-26 20:05:55 +00:00
|
|
|
stagit.c\
|
|
|
|
stagit-index.c
|
2015-12-25 16:48:46 +00:00
|
|
|
COMPATSRC = \
|
2016-01-06 17:02:28 +00:00
|
|
|
reallocarray.c\
|
2015-12-25 16:48:46 +00:00
|
|
|
strlcat.c\
|
|
|
|
strlcpy.c
|
2015-12-05 20:07:52 +00:00
|
|
|
BIN = \
|
2015-12-26 20:05:55 +00:00
|
|
|
stagit\
|
|
|
|
stagit-index
|
2015-12-05 20:07:52 +00:00
|
|
|
MAN1 = \
|
2015-12-26 20:05:55 +00:00
|
|
|
stagit.1\
|
|
|
|
stagit-index.1
|
2015-12-05 20:07:52 +00:00
|
|
|
DOC = \
|
|
|
|
LICENSE\
|
2017-06-25 10:28:59 +00:00
|
|
|
README
|
2015-12-25 16:48:46 +00:00
|
|
|
HDR = compat.h
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2016-01-06 17:05:46 +00:00
|
|
|
COMPATOBJ = \
|
|
|
|
reallocarray.o\
|
|
|
|
strlcat.o\
|
|
|
|
strlcpy.o
|
|
|
|
|
2015-12-26 19:11:59 +00:00
|
|
|
OBJ = ${SRC:.c=.o} ${COMPATOBJ}
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2017-03-25 12:14:26 +00:00
|
|
|
all: ${BIN}
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2016-03-20 15:23:33 +00:00
|
|
|
.o:
|
|
|
|
${CC} ${LDFLAGS} -o $@ ${LIBS}
|
|
|
|
|
2015-12-05 20:07:52 +00:00
|
|
|
.c.o:
|
2016-03-20 15:23:33 +00:00
|
|
|
${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2016-03-20 14:36:21 +00:00
|
|
|
dist:
|
2016-03-20 16:29:31 +00:00
|
|
|
rm -rf ${NAME}-${VERSION}
|
|
|
|
mkdir -p ${NAME}-${VERSION}
|
2017-11-11 00:34:50 +00:00
|
|
|
cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \
|
2017-05-04 22:23:50 +00:00
|
|
|
Makefile config.mk favicon.png logo.png style.css \
|
2017-07-30 15:21:42 +00:00
|
|
|
example_create.sh example_post-receive.sh \
|
2016-03-20 16:29:31 +00:00
|
|
|
${NAME}-${VERSION}
|
2015-12-05 20:07:52 +00:00
|
|
|
# make tarball
|
2016-03-20 16:29:31 +00:00
|
|
|
tar -cf - ${NAME}-${VERSION} | \
|
|
|
|
gzip -c > ${NAME}-${VERSION}.tar.gz
|
|
|
|
rm -rf ${NAME}-${VERSION}
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2016-05-02 22:38:33 +00:00
|
|
|
${OBJ}: config.mk ${HDR}
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2015-12-26 20:05:55 +00:00
|
|
|
stagit: stagit.o ${COMPATOBJ}
|
|
|
|
${CC} -o $@ stagit.o ${COMPATOBJ} ${LDFLAGS}
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2015-12-26 20:05:55 +00:00
|
|
|
stagit-index: stagit-index.o ${COMPATOBJ}
|
|
|
|
${CC} -o $@ stagit-index.o ${COMPATOBJ} ${LDFLAGS}
|
2015-12-20 16:11:25 +00:00
|
|
|
|
2015-12-05 20:07:52 +00:00
|
|
|
clean:
|
2016-03-25 09:30:19 +00:00
|
|
|
rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
|
2015-12-05 20:07:52 +00:00
|
|
|
|
|
|
|
install: all
|
|
|
|
# installing executable files.
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
2017-11-11 00:34:50 +00:00
|
|
|
cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
|
|
|
|
for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
|
2015-12-05 20:07:52 +00:00
|
|
|
# installing example files.
|
2019-02-09 14:02:38 +00:00
|
|
|
mkdir -p ${DESTDIR}${DOCPREFIX}
|
2015-12-05 20:07:52 +00:00
|
|
|
cp -f style.css\
|
2016-01-06 10:24:29 +00:00
|
|
|
favicon.png\
|
2015-12-05 20:07:52 +00:00
|
|
|
logo.png\
|
2017-07-30 15:21:42 +00:00
|
|
|
example_create.sh\
|
|
|
|
example_post-receive.sh\
|
2015-12-05 20:07:52 +00:00
|
|
|
README\
|
2019-02-09 14:02:38 +00:00
|
|
|
${DESTDIR}${DOCPREFIX}
|
2015-12-05 20:07:52 +00:00
|
|
|
# installing manual pages.
|
|
|
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
|
|
cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
|
2017-03-25 12:14:26 +00:00
|
|
|
for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
|
2015-12-05 20:07:52 +00:00
|
|
|
|
|
|
|
uninstall:
|
2017-11-11 00:34:50 +00:00
|
|
|
# removing executable files.
|
|
|
|
for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
|
2015-12-05 20:07:52 +00:00
|
|
|
# removing example files.
|
|
|
|
rm -f \
|
2019-02-09 14:02:38 +00:00
|
|
|
${DESTDIR}${DOCPREFIX}/style.css\
|
|
|
|
${DESTDIR}${DOCPREFIX}/favicon.png\
|
|
|
|
${DESTDIR}${DOCPREFIX}/logo.png\
|
|
|
|
${DESTDIR}${DOCPREFIX}/example_create.sh\
|
|
|
|
${DESTDIR}${DOCPREFIX}/example_post-receive.sh\
|
|
|
|
${DESTDIR}${DOCPREFIX}/README
|
|
|
|
-rmdir ${DESTDIR}${DOCPREFIX}
|
2015-12-05 20:07:52 +00:00
|
|
|
# removing manual pages.
|
2017-03-25 12:14:26 +00:00
|
|
|
for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
|
2015-12-05 20:07:52 +00:00
|
|
|
|
|
|
|
.PHONY: all clean dist install uninstall
|