1 # $NetBSD: Makefile,v 1.5 2010/02/11 00:27:09 roy Exp $ 2 3 USE_SHLIBDIR= yes 4 5 LIB= terminfo 6 WARNS= 4 7 8 CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} 9 10 SRCS= term.c ti.c setupterm.c curterm.c tparm.c tputs.c 11 SRCS+= hash.c 12 INCS= term.h 13 INCSDIR= /usr/include 14 15 .include <bsd.own.mk> 16 17 rescue.c: ${NETBSDSRCDIR}/share/terminfo/terminfo 18 @echo "static const char *rescue_terms[] = {" >$@ 19 ${TOOL_TIC} -Sx ${NETBSDSRCDIR}/share/terminfo/terminfo \ 20 ansi dumb vt100 vt220 wsvt25 >>$@ 21 @echo " NULL," >>$@ 22 @echo " NULL" >>$@ 23 @echo "};" >>$@ 24 25 term.c: rescue.c 26 27 MAN= terminfo.3 terminfo.5 28 MLINKS= terminfo.3 setupterm.3 \ 29 terminfo.3 set_curterm.3 terminfo.3 del_curterm.3 \ 30 terminfo.3 tigetnum.3 terminfo.3 tigetflag.3 \ 31 terminfo.3 tigetstr.3 terminfo.3 tparm.3 terminfo.3 tputs.3 \ 32 terminfo.3 putp.3 \ 33 terminfo.3 ti_setupterm.3 terminfo.3 ti_getflag.3 \ 34 terminfo.3 ti_getnum.3 terminfo.3 ti_getstr.3 \ 35 terminfo.3 t_parm.3 terminfo.3 t_vparm.3 \ 36 terminfo.3 ti_puts.3 terminfo.3 ti_putp.3 37 38 # Build in termcap emulation 39 SRCS+= termcap.c 40 INCS+= termcap.h 41 MAN+= termcap.3 42 MLINKS+= termcap.3 tgetent.3 termcap.3 tgetflag.3 termcap.3 tgetnum.3 \ 43 termcap.3 tgetstr.3 termcap.3 tgoto.3 44 45 # Generate our string and hash tables 46 hash: 47 @echo "Generating terminfo hash" 48 cd ${.CURDIR} && ${HOST_SH} ./genhash >hash.c 49 @echo "Generating termcap hash" 50 cd ${.CURDIR} && ${HOST_SH} ./genthash >termcap_hash.c 51 52 # Generate our man pages 53 terminfo.5: terminfo.5.in term.h termcap_map.c 54 @echo "Generating terminfo man pages" 55 cd ${.CURDIR} && ${HOST_SH} ./genman >${.OBJDIR}/$@ 56 57 man: terminfo.5 58 59 gen: hash man 60 61 .include <bsd.shlib.mk> 62 63 .if ${MKLINKLIB} != "no" 64 SYMLINKS+= libterminfo.a ${LIBDIR}/libtermcap.a 65 SYMLINKS+= libterminfo.a ${LIBDIR}/libtermlib.a 66 .endif 67 68 .if ${MKPROFILE} != "no" 69 SYMLINKS+= libterminfo_p.a ${LIBDIR}/libtermcap_p.a 70 SYMLINKS+= libterminfo_p.a ${LIBDIR}/libtermlib_p.a 71 .endif 72 73 .if ${MKPIC} != "no" 74 75 .if ${MKPICINSTALL} != "no" 76 SYMLINKS+= libterminfo_pic.a ${LIBDIR}/libtermcap_pic.a 77 SYMLINKS+= libterminfo_pic.a ${LIBDIR}/libtermlib_pic.a 78 .endif 79 80 .if exists(${.CURDIR}/shlib_version) 81 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 82 ${_LIBSODIR}/libtermcap.so.0.6 83 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 84 ${_LIBSODIR}/libtermlib.so.0.6 85 .if ${_LIBSODIR} != ${LIBDIR} 86 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 87 ${LIBDIR}/libtermcap.so.0.6 88 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 89 ${LIBDIR}/libtermlib.so.0.6 90 .endif 91 92 .if (${OBJECT_FMT} == "ELF") 93 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 94 ${_LIBSODIR}/libtermcap.so.0 95 SYMLINKS+= libterminfo.so ${_LIBSODIR}/libtermcap.so 96 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 97 ${_LIBSODIR}/libtermlib.so.0 98 SYMLINKS+= libterminfo.so ${_LIBSODIR}/libtermlib.so 99 .if ${_LIBSODIR} != ${LIBDIR} 100 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 101 ${LIBDIR}/libtermcap.so.0 102 SYMLINKS+= libterminfo.so ${LIBDIR}/libtermcap.so 103 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 104 ${LIBDIR}/libtermlib.so.0 105 SYMLINKS+= libterminfo.so ${LIBDIR}/libtermlib.so 106 .endif 107 .endif 108 .endif # exists shlib_version 109 110 .endif # ${MKPIC} != "no" 111 112 .include <bsd.lib.mk> 113