xref: /freebsd/contrib/bsddialog/Makefile (revision e9e8876a4d6afc1ad5315faaa191b25121a813d7)
1# Any copyright is dedicated to the Public Domain, see:
2#     <http://creativecommons.org/publicdomain/zero/1.0/>
3#
4# Written by Alfonso Sabato Siciliano
5
6OUTPUT=  bsddialog
7SOURCES= bsddialog.c
8OBJECTS= ${SOURCES:.c=.o}
9LIBPATH= ${.CURDIR}/lib
10LIBBSDDIALOG= ${LIBPATH}/libbsddialog.so
11
12CFLAGS= -Wall -I${LIBPATH}
13LDFLAGS= -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog
14
15BINDIR= /usr/local/bin
16MAN= ${OUTPUT}.1
17GZIP= gzip -cn
18MANDIR= /usr/local/share/man/man1
19
20INSTALL= install
21RM= rm -f
22
23all : ${OUTPUT}
24
25${OUTPUT}: ${LIBBSDDIALOG} ${OBJECTS}
26	${CC} ${LDFLAGS} ${OBJECTS} -o ${.PREFIX}
27
28${LIBBSDDIALOG}:
29.if defined(PORTNCURSES)
30	make -C ${LIBPATH} -DPORTNCURSES
31.else
32	make -C ${LIBPATH}
33.endif
34
35.c.o:
36	${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
37
38install:
39	${INSTALL} -s -m 555 ${OUTPUT} ${BINDIR}
40	${GZIP} ${MAN} > ${MAN}.gz
41	${INSTALL} -m 444 ${MAN}.gz ${MANDIR}
42
43unistall:
44	${RM} ${BINDIR}/${OUTPUT}
45	${RM} ${MANDIR}/${MAN}.gz
46
47clean:
48	make -C ${LIBPATH} clean
49	${RM} ${OUTPUT} *.o *~ *.core ${MAN}.gz
50