stagit-gopher

static git page generator for gopher (mirror)
git clone git://git.2f30.org/stagit-gopher.git
Log | Files | Refs | README | LICENSE

Makefile (2017B)


      1 include config.mk
      2 
      3 NAME = stagit-gopher
      4 VERSION = 0.9.2
      5 
      6 SRC = \
      7 	stagit-gopher.c\
      8 	stagit-gopher-index.c
      9 COMPATSRC = \
     10 	reallocarray.c\
     11 	strlcpy.c
     12 BIN = \
     13 	stagit-gopher\
     14 	stagit-gopher-index
     15 MAN1 = \
     16 	stagit-gopher.1\
     17 	stagit-gopher-index.1
     18 DOC = \
     19 	LICENSE\
     20 	README
     21 HDR = compat.h
     22 
     23 COMPATOBJ = \
     24 	reallocarray.o\
     25 	strlcpy.o
     26 
     27 OBJ = ${SRC:.c=.o} ${COMPATOBJ}
     28 
     29 all: ${BIN}
     30 
     31 .o:
     32 	${CC} ${LDFLAGS} -o $@ ${LIBS}
     33 
     34 .c.o:
     35 	${CC} -c ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
     36 
     37 dist:
     38 	rm -rf ${NAME}-${VERSION}
     39 	mkdir -p ${NAME}-${VERSION}
     40 	cp -f ${MAN1} ${HDR} ${SRC} ${COMPATSRC} ${DOC} \
     41 		Makefile config.mk \
     42 		example_create.sh example_post-receive.sh \
     43 		${NAME}-${VERSION}
     44 	# make tarball
     45 	tar -cf - ${NAME}-${VERSION} | \
     46 		gzip -c > ${NAME}-${VERSION}.tar.gz
     47 	rm -rf ${NAME}-${VERSION}
     48 
     49 ${OBJ}: config.mk ${HDR}
     50 
     51 stagit-gopher: stagit-gopher.o ${COMPATOBJ}
     52 	${CC} -o $@ stagit-gopher.o ${COMPATOBJ} ${LDFLAGS}
     53 
     54 stagit-gopher-index: stagit-gopher-index.o ${COMPATOBJ}
     55 	${CC} -o $@ stagit-gopher-index.o ${COMPATOBJ} ${LDFLAGS}
     56 
     57 clean:
     58 	rm -f ${BIN} ${OBJ} ${NAME}-${VERSION}.tar.gz
     59 
     60 install: all
     61 	# installing executable files.
     62 	mkdir -p ${DESTDIR}${PREFIX}/bin
     63 	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
     64 	for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
     65 	# installing example files.
     66 	mkdir -p ${DESTDIR}${DOCPREFIX}
     67 	cp -f example_create.sh\
     68 		example_post-receive.sh\
     69 		README\
     70 		${DESTDIR}${DOCPREFIX}
     71 	# installing manual pages.
     72 	mkdir -p ${DESTDIR}${MANPREFIX}/man1
     73 	cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
     74 	for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
     75 
     76 uninstall:
     77 	# removing executable files.
     78 	for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done
     79 	# removing example files.
     80 	rm -f \
     81 		${DESTDIR}${DOCPREFIX}/example_create.sh\
     82 		${DESTDIR}${DOCPREFIX}/example_post-receive.sh\
     83 		${DESTDIR}${DOCPREFIX}/README
     84 	-rmdir ${DESTDIR}${DOCPREFIX}
     85 	# removing manual pages.
     86 	for m in ${MAN1}; do rm -f ${DESTDIR}${MANPREFIX}/man1/$$m; done
     87 
     88 .PHONY: all clean dist install uninstall