1# PUBLIC DOMAIN - NO WARRANTY, see: 2# <http://creativecommons.org/publicdomain/zero/1.0/> 3# 4# Written in 2021 by Alfonso Sabato Siciliano 5 6OUTPUT= bsddialog 7SOURCES= bsddialog.c 8OBJECTS= ${SOURCES:.c=.o} 9LIBPATH= ${.CURDIR}/lib 10LIBBSDDIALOG= ${LIBPATH}/libbsddialog.so 11 12CFLAGS+= -I${LIBPATH} -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter 13# `make -DDEBUG` 14.if defined(DEBUG) 15CFLAGS= -g -Wall -I${LIBPATH} 16LIBDEBUG= -DDEBUG 17.endif 18LDFLAGS+= -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog 19 20BINDIR= /usr/local/bin 21MAN= ${OUTPUT}.1 22GZIP= gzip -cn 23MANDIR= /usr/local/share/man/man1 24 25INSTALL= install 26RM= rm -f 27 28all : ${OUTPUT} 29 30${OUTPUT}: ${LIBBSDDIALOG} ${OBJECTS} 31 ${CC} ${LDFLAGS} ${OBJECTS} -o ${.PREFIX} 32 33${LIBBSDDIALOG}: 34 make -C ${LIBPATH} ${LIBDEBUG} 35 36.c.o: 37 ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} 38 39install: 40 ${INSTALL} -s -m 555 ${OUTPUT} ${BINDIR} 41 ${GZIP} ${MAN} > ${MAN}.gz 42 ${INSTALL} -m 444 ${MAN}.gz ${MANDIR} 43 44unistall: 45 ${RM} ${BINDIR}/${OUTPUT} 46 ${RM} ${MANDIR}/${MAN}.gz 47 48clean: 49 make -C ${LIBPATH} clean 50 ${RM} ${OUTPUT} *.o *~ *.core ${MAN}.gz 51