Makefile (1610B)
1 # geomyidae - a tiny, standalone gopherd written in C 2 # See LICENSE file for copyright and license details. 3 .POSIX: 4 5 NAME = geomyidae 6 VERSION = 0.96 7 8 PREFIX = /usr/local 9 BINDIR = ${PREFIX}/bin 10 MANDIR = ${PREFIX}/share/man/man8 11 12 # Comment to disable TLS support 13 TLS_CFLAGS = -DENABLE_TLS 14 # libtls is provided using for example LibreSSL. 15 TLS_LDFLAGS = -ltls 16 17 GEOM_CFLAGS = -D_DEFAULT_SOURCE -I. -I/usr/include ${TLS_CFLAGS} ${CFLAGS} 18 GEOM_LDFLAGS = -L/usr/lib -L. ${TLS_LDFLAGS} ${LDFLAGS} 19 20 # FreeBSD 21 # GEOM_CFLAGS = -D_DEFAULT_SOURCE -I. -I/usr/local/include ${TLS_CFLAGS} ${CFLAGS} 22 # GEOM_LDFLAGS = -L/usr/local/lib -L. ${TLS_LDFLAGS} ${LDFLAGS} 23 24 SRC = main.c ind.c handlr.c 25 OBJ = ${SRC:.c=.o} 26 27 all: ${NAME} 28 29 .c.o: 30 ${CC} ${GEOM_CFLAGS} -c $< 31 32 ${OBJ}: 33 34 ${NAME}: ${OBJ} 35 ${CC} -o $@ ${OBJ} ${GEOM_LDFLAGS} 36 37 clean: 38 rm -f ${NAME} ${OBJ} ${NAME}-${VERSION}.tar.gz 39 40 install: all 41 mkdir -p "${DESTDIR}${BINDIR}" 42 cp -f ${NAME} "${DESTDIR}${BINDIR}" 43 chmod 755 "${DESTDIR}${BINDIR}/${NAME}" 44 mkdir -p "${DESTDIR}${MANDIR}" 45 cp -f ${NAME}.8 "${DESTDIR}${MANDIR}" 46 chmod 644 "${DESTDIR}${MANDIR}/${NAME}.8" 47 48 uninstall: 49 rm -f "${DESTDIR}${BINDIR}/${NAME}" 50 rm -f "${DESTDIR}${MANDIR}/${NAME}.8" 51 52 telemetry: 53 printf "/telemetry/geomyidae/installed\r\n" | nc bitreich.org 70 54 55 dist: clean 56 mkdir -p ${NAME}-${VERSION} 57 cp -R rc.d CGI README LICENSE index.gph Makefile ${NAME}.8 \ 58 *.c *.h ${NAME}-${VERSION} 59 tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} 60 gzip ${NAME}-${VERSION}.tar 61 mv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}.tgz 62 rm -rf "${NAME}-${VERSION}" 63 64 .PHONY: all clean dist install uninstall