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