summaryrefslogtreecommitdiff
path: root/share/termtypes/Makefile
blob: e11faaec5b931c046c2e9fd3b1b444e1c2cefa74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#	$OpenBSD: Makefile,v 1.20 2011/07/06 18:49:08 millert Exp $
#
# Take termcap/terminfo master file and generate termcap/terminfo .db files

MAN=	termcap.5
CLEANFILES+= terminfo.src termcap.src terminfo.db termcap.db termcap
TIC=	/usr/bin/tic

all: terminfo.db termcap.db termcap

terminfo.src: termtypes.master
	${TIC} -I -x ${.ALLSRC} | sed -e '/^#/d' -e '/^$$/d' > ${.TARGET}
	@if [ ! -s ${.TARGET} ]; then \
	    echo ${.TARGET} is zero length!  You need to update ${TIC} ;\
	    rm -f ${.TARGET} ;\
	    exit 1 ;\
	fi

terminfo.db: terminfo.src
	cap_mkdb -i -f terminfo terminfo.src

termcap.src: termtypes.master
	${TIC} -C -x ${.ALLSRC} | sed -e '/^#/d' -e '/^$$/d' > ${.TARGET}
	@if [ ! -s ${.TARGET} ]; then \
	    echo ${.TARGET} is zero length!  You need to update ${TIC} ;\
	    rm -f ${.TARGET} ;\
	    exit 1 ;\
	fi

termcap.db: termcap.src
	cap_mkdb -f termcap termcap.src

termcap: termtypes.master
	${TIC} -C -x ${.ALLSRC} > ${.TARGET}

realinstall:
	${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 terminfo.db \
	     ${DESTDIR}${BINDIR}/misc/terminfo.db
	${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 termcap.db \
	     ${DESTDIR}${BINDIR}/misc/termcap.db
	${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 termcap \
	     ${DESTDIR}${BINDIR}/misc/termcap
	ln -fs ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap

.include <bsd.prog.mk>