2015-12-05 20:07:52 +00:00
|
|
|
include config.mk
|
|
|
|
|
2015-12-26 20:05:55 +00:00
|
|
|
NAME = stagit
|
2016-01-06 10:56:52 +00:00
|
|
|
VERSION = 0.2
|
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\
|
|
|
|
README\
|
|
|
|
TODO
|
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
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} -c ${CFLAGS} $<
|
|
|
|
|
|
|
|
dist: $(BIN)
|
|
|
|
rm -rf release/${VERSION}
|
|
|
|
mkdir -p release/${VERSION}
|
|
|
|
cp -f ${MAN1} ${HDR} ${SCRIPTS} ${SRC} ${COMPATSRC} ${DOC} \
|
2016-01-06 10:24:29 +00:00
|
|
|
Makefile config.def.h config.mk \
|
|
|
|
favicon.png logo.png style.css \
|
|
|
|
example.sh \
|
2015-12-05 20:07:52 +00:00
|
|
|
release/${VERSION}/
|
|
|
|
# make tarball
|
2015-12-26 20:05:55 +00:00
|
|
|
rm -f stagit-${VERSION}.tar.gz
|
2015-12-05 20:07:52 +00:00
|
|
|
(cd release/${VERSION}; \
|
2015-12-26 20:05:55 +00:00
|
|
|
tar -czf ../../stagit-${VERSION}.tar.gz .)
|
2015-12-05 20:07:52 +00:00
|
|
|
|
2015-12-14 11:49:23 +00:00
|
|
|
${OBJ}: config.h config.mk ${HDR}
|
|
|
|
|
|
|
|
config.h:
|
|
|
|
@echo creating $@ from config.def.h
|
|
|
|
@cp config.def.h $@
|
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:
|
|
|
|
rm -f ${BIN} ${OBJ}
|
|
|
|
|
|
|
|
install: all
|
|
|
|
# installing executable files.
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
|
|
cp -f ${BIN} ${SCRIPTS} ${DESTDIR}${PREFIX}/bin
|
|
|
|
for f in $(BIN) $(SCRIPTS); do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
|
|
|
|
# installing example files.
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/share/${NAME}
|
|
|
|
cp -f style.css\
|
2016-01-06 10:24:29 +00:00
|
|
|
favicon.png\
|
2015-12-05 20:07:52 +00:00
|
|
|
logo.png\
|
2016-01-06 10:24:29 +00:00
|
|
|
example.sh\
|
2015-12-05 20:07:52 +00:00
|
|
|
README\
|
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}
|
|
|
|
# installing manual pages.
|
|
|
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
|
|
cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
|
|
|
|
for m in $(MAN1); do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
# removing executable files and scripts.
|
|
|
|
for f in $(BIN) $(SCRIPTS); do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
|
|
|
|
# removing example files.
|
|
|
|
rm -f \
|
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}/style.css\
|
2016-01-06 10:24:29 +00:00
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}/favicon.png\
|
2015-12-05 20:07:52 +00:00
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}/logo.png\
|
2016-01-06 10:24:29 +00:00
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}/example.sh\
|
2015-12-05 20:07:52 +00:00
|
|
|
${DESTDIR}${PREFIX}/share/${NAME}/README
|
|
|
|
-rmdir ${DESTDIR}${PREFIX}/share/${NAME}
|
|
|
|
# removing manual pages.
|
|
|
|
for m in $(MAN1); do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
|
|
|
|
|
|
|
|
.PHONY: all clean dist install uninstall
|