xref: /dragonfly/share/terminfo/Makefile (revision 58645856)
1.include "Makefile.entries"
2
3NOMAN=
4
5CLEANFILES+=	run_tic.sed run_tic.sh terminfo.tmp
6CLEANDIRS+=	terminfo
7
8TINFODIR=	${SHAREDIR}/terminfo
9MISCDIR=	${.CURDIR}/../../contrib/ncurses/misc
10TSOURCE=	${MISCDIR}/terminfo.src
11TICBOOTSTRAP=	${.OBJDIR}/../../lib/libncurses/tic_next/tic_next.nx
12
13# Allow to override to reduce breakage surface (just in case)
14.if exists(${TICBOOTSTRAP})
15TIC?=	${TICBOOTSTRAP}
16.else
17TIC?=	tic
18.endif
19
20all: terminfo
21
22run_tic.sed:
23	WHICH_XTERM=xterm-new \
24	ticdir=${FILESDIR}/terminfo \
25	sh ${MISCDIR}/gen_edit.sh > ${.TARGET}
26
27run_tic.sh:
28	cat ${MISCDIR}/run_tic.in | sed \
29	  -e 's;@PROG_EXT@;;g' \
30	  -e 's;@DESTDIR@;;g' \
31	  -e 's;@TERMINFO@;${.CURDIR}/terminfo;g' \
32	  -e 's;@TERMINFO_SRC@;${TSOURCE};g' \
33	  -e 's;@TIC@;${TIC};g' \
34	  -e 's;@NCURSES_EXT_FUNCS@;1;g' \
35	  -e 's;@LN_S@;ln -s -f;g' \
36	  -e 's;@prefix@;/usr;g' \
37	  -e 's;@exec_prefix@;/usr;g' \
38	  -e 's;@bindir@;/usr/bin;g' \
39	  -e 's;@datadir@;/usr/share;g' \
40	  -e 's;@top_srcdir@;..;g' \
41	  -e 's;@srcdir@;.;g' \
42	> ${.TARGET}
43
44
45terminfo.tmp: run_tic.sed ${TSOURCE}
46	sed -f run_tic.sed ${TSOURCE} > ${.TARGET}
47
48terminfo: run_tic.sh terminfo.tmp
49	sh run_tic.sh
50
51install:
52	for ITEM in ${TERMINFO_ENTRIES}; do \
53		${INSTALL} -m 644 -o ${BINOWN} -g ${BINGRP}  \
54		terminfo/$${ITEM} ${DESTDIR}${TINFODIR}/$${ITEM}; \
55	done
56
57.include <bsd.lib.mk>
58