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