rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 1dad292522c01d37fe78185877a577388ae36a77
parent 1e5149467eabdf2c76e7a31466c6e988d002218e
Author: Quentin Rameau <quinq@fifth.space>
Date:   Sun,  7 Jun 2020 13:31:18 +0200

Makefile: clean up a bit

Signed-off-by: Christoph Lohmann <20h@r-36.net>

Diffstat:
Makefile | 46++++++++++++++++++----------------------------
1 file changed, 18 insertions(+), 28 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,5 +1,6 @@ # rohrpost - a commandline mail client # See LICENSE file for copyright and license details. +.POSIX: NAME = rohrpost VERSION = 0.5 @@ -8,20 +9,18 @@ VERSION = 0.5 # paths PREFIX = /usr/local -SHAREPREFIX= ${PREFIX}/share/${NAME} -MANPREFIX = ${PREFIX}/share/man +SHAREPREFIX = ${PREFIX}/share/${NAME} # includes and libs -INCS = -I. -I/usr/include -LIBS = -L/usr/lib -lc -ltls +LIBS = -ltls # OpenBSD -#LIBS = -L/usr/lib -lc -lssl -lcrypto -liconv +#LIBS = -lssl -lcrypto -liconv # flags RP_CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -D_GNU_SOURCE ${CPPFLAGS} -RP_CFLAGS = -g -std=gnu99 -pedantic -Wall -O0 ${INCS} ${RP_CPPFLAGS} ${CFLAGS} -RP_LDFLAGS = -g ${LIBS} ${LDFLAGS} -#RP_LDFLAGS = -s ${LIBS} +RP_CFLAGS = -g -pedantic -Wall -O0 ${RP_CPPFLAGS} ${CFLAGS} +RP_LDFLAGS = -g ${LDFLAGS} +#RP_LDFLAGS = -s SRC = ${NAME}.c ind.c llist.c cfg.c txtdb.c mark.c cur.c \ select.c sieve.c net.c base64.c strio.c parser.c pager.c \ @@ -34,17 +33,17 @@ OBJ = ${SRC:.c=.o} all: ${NAME} .c.o: - ${CC} -c ${RP_CFLAGS} $< + ${CC} ${RP_CFLAGS} -c $< ${OBJ}: ${NAME}: ${OBJ} - ${CC} -o $@ ${OBJ} ${RP_LDFLAGS} + ${CC} ${RP_LDFLAGS} -o $@ ${OBJ} ${LIBS} clean: rm -f ${NAME} ${OBJ} ${NAME}-${VERSION}.tar.gz rm -f bin/${NAME} - find bin -type l -exec rm {} \; + find bin -type l -exec rm -f {} + dist: clean mkdir -p ${NAME}-${VERSION} @@ -54,24 +53,18 @@ dist: clean gzip ${NAME}-${VERSION}.tar rm -rf ${NAME}-${VERSION} -etc: - mkdir -p ${DESTDIR}/etc/${NAME} - cp -R etc/${NAME}/* ${DESTDIR}/etc/${NAME} - bin: ${NAME} - mkdir -p ./bin cp ${NAME} bin cd bin; \ for i in `./${NAME} -i`; \ do \ ln -sf ${NAME} $$i; \ - done; true + done install: all bin mkdir -p ${DESTDIR}${PREFIX}/bin cd bin; \ cp ${NAME} ${DESTDIR}${PREFIX}/bin; \ - chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}; \ for i in `ls -1`; \ do \ if [ -e ${DESTDIR}${PREFIX}/bin/$$i ]; \ @@ -82,17 +75,14 @@ install: all bin if [ ! -L $$i ]; \ then \ cp $$i ${DESTDIR}${PREFIX}/bin; \ - chmod 755 ${DESTDIR}${PREFIX}/bin/$$i; \ else \ - ln -sf ${DESTDIR}${PREFIX}/bin/${NAME} \ + ln -sf ${NAME} \ ${DESTDIR}${PREFIX}/bin/$$i; \ fi \ - done; \ - true; + done mkdir -p ${DESTDIR}${SHAREPREFIX} cp -rf tmpl ${DESTDIR}${SHAREPREFIX} - chmod 644 ${DESTDIR}${SHAREPREFIX}/tmpl/* - sed "s,SHAREPREFIX,${SHAREPREFIX},g" < bin/rpinit > ${DESTDIR}${PREFIX}/bin/rpinit + sed 's,SHAREPREFIX,${SHAREPREFIX},g' < bin/rpinit > ${DESTDIR}${PREFIX}/bin/rpinit chmod 755 ${DESTDIR}${PREFIX}/bin/rpinit uninstall: clean @@ -101,10 +91,10 @@ uninstall: clean do \ rm -f ${DESTDIR}${PREFIX}/bin/$$i; \ done; \ - [ -e ${DESTDIR}${PREFIX}/bin/${NAME} ] && \ - rm ${DESTDIR}${PREFIX}/bin/${NAME}; \ - true; - rm -rf ${DESTDIR}${PREFIX} + if [ -e ${DESTDIR}${PREFIX}/bin/${NAME} ]; \ + then \ + rm -f ${DESTDIR}${PREFIX}/bin/${NAME}; \ + fi .PHONY: all clean dist install uninstall bin