pop3

Tiny pop3 client designed to be tunneled through ssh
git clone git://jacobedwards.org/pop3
Log | Files | Refs

commit 58014800625d7facfac52c0d73fdc2a8759dd166
parent efd6fce48b8421886d9345297e5fe67c4910e1a6
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Sun, 14 May 2023 02:46:17 +0000

Make setting extra compiler options more convenient

By using uncommon names for variables, e.g. cflags instead of CFLAGS,
the cflags variable can be set to CFLAGS plus the flags deemed
necessary to compile to program. With this method, the user can
supply additional flags using the common CFLAGS variable without
overwritting what was previously set, possibly disabiling compilation.

Diffstat:
MMakefile | 45+++++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,36 +1,45 @@ -# $Id: Makefile,v 1.1 2022/03/07 07:42:39 jacob Exp $ +# $Id: Makefile,v 1.2 2023/05/14 02:46:17 jacob Exp $ -NAME = pop3 -SRC = pop3.c -OBJ = ${SRC:.c=.o} +name = pop3 +src = pop3.c +obj = ${src:.c=.o} -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/man +.if PREFIX + prefix = ${PREFIX} +.else + prefix = /usr/local +.endif -CC = cc -CFLAGS = -Wall -Wno-write-strings -LDFLAGS = -static +.if MANPREFIX + prefix = ${MANPREFIX} +.else + manprefix = ${prefix}/man +.endif -all: ${NAME} +cc = ${CC} +cflags = ${CFLAGS} -Wall -Wno-write-strings +ldflags = ${LDFLAGS} -${NAME}: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} +all: ${name} + +${name}: ${obj} + ${cc} -o $@ ${obj} ${ldflags} ${OBJ}: Makefile .c.o: - ${CC} ${CFLAGS} -c -o $@ $< + ${cc} ${cflags} -c -o $@ $< clean: - rm -f ${NAME} ${OBJ} + rm -f ${name} ${obj} install: ${NAME} - cp -f ${NAME} ${PREFIX}/bin - cp -f ${NAME}.1 ${MANPREFIX}/man1 + cp -f ${name} ${prefix}/bin + cp -f ${name}.1 ${manprefix}/man1 uninstall: - rm -f ${PREFIX}/bin/${NAME} - rm -f ${MANPREFIX}/man1/${NAME}.1 + rm -f ${prefix}/bin/${name} + rm -f ${manprefix}/man1/${name}.1 .SUFFIXES: .c .o .PHONY: clean install uninstall