1 # $NetBSD: Makefile,v 1.25 2025/09/18 03:36:00 mrg Exp $ 2 3 .include <bsd.own.mk> 4 5 USE_SHLIBDIR= yes 6 7 LIB= terminfo 8 WARNS?= 5 9 10 CPPFLAGS+= -I${.CURDIR} 11 12 SRCS= term.c ti.c setupterm.c curterm.c tparm.c tputs.c 13 SRCS+= hash.c 14 INCS= term.h 15 INCSDIR= /usr/include 16 17 # For ramdisks there is no database to read from so remove compat 18 # and the need to read from them. 19 # While here, remove the ability to compile terminfo descriptions 20 # from $TERMINFO as well. 21 # This means the library requires any terminal needed built into it. 22 .if !defined(SMALLPROG) 23 CPPFLAGS+= -DTERMINFO_COMPILE -DTERMINFO_DB -DTERMINFO_COMPAT 24 SRCS+= compile.c 25 26 COPTS.compile.c+= ${CC_WNO_CALLOC_TRANSPOSED_ARGS} 27 .endif 28 29 COPTS.tparm.c+= -Wno-format-nonliteral 30 31 MAN= terminfo.3 terminfo.5 32 MLINKS= terminfo.3 setupterm.3 \ 33 terminfo.3 set_curterm.3 terminfo.3 del_curterm.3 \ 34 terminfo.3 termname.3 terminfo.3 longname.3 \ 35 terminfo.3 tigetnum.3 terminfo.3 tigetflag.3 \ 36 terminfo.3 tigetstr.3 terminfo.3 tparm.3 terminfo.3 tputs.3 \ 37 terminfo.3 putp.3 \ 38 terminfo.3 ti_setupterm.3 terminfo.3 ti_getflag.3 \ 39 terminfo.3 ti_getnum.3 terminfo.3 ti_getstr.3 \ 40 terminfo.3 tiparm.3 terminfo.3 ti_tiparm.3 \ 41 terminfo.3 ti_puts.3 terminfo.3 ti_putp.3 42 43 # Build in termcap emulation 44 SRCS+= termcap.c 45 INCS+= termcap.h 46 MAN+= termcap.3 47 MLINKS+= termcap.3 tgetent.3 termcap.3 tgetflag.3 termcap.3 tgetnum.3 \ 48 termcap.3 tgetstr.3 termcap.3 tgoto.3 49 50 CPPFLAGS+= -I${.OBJDIR} 51 52 .include "Makefile.hash" 53 54 # Generate our man pages 55 terminfo.5: genman terminfo.5.in term.h termcap_map.c 56 @echo "Generating terminfo man pages" 57 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} > ${.TARGET} 58 59 CLEANFILES+= terminfo.5 60 61 man: terminfo.5 62 63 .include <bsd.shlib.mk> 64 65 .if ${MKLINKLIB} != "no" 66 SYMLINKS+= libterminfo.a ${LIBDIR}/libtermcap.a 67 SYMLINKS+= libterminfo.a ${LIBDIR}/libtermlib.a 68 .endif 69 70 .if ${MKPROFILE} != "no" 71 SYMLINKS+= libterminfo_p.a ${LIBDIR}/libtermcap_p.a 72 SYMLINKS+= libterminfo_p.a ${LIBDIR}/libtermlib_p.a 73 .endif 74 75 .if ${MKPIC} != "no" 76 77 .if ${MKPICINSTALL} != "no" 78 SYMLINKS+= libterminfo_pic.a ${LIBDIR}/libtermcap_pic.a 79 SYMLINKS+= libterminfo_pic.a ${LIBDIR}/libtermlib_pic.a 80 .endif 81 82 .if exists(${.CURDIR}/shlib_version) 83 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 84 ${_LIBSODIR}/libtermcap.so.0.6 85 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 86 ${_LIBSODIR}/libtermlib.so.0.6 87 .if ${_LIBSODIR} != ${LIBDIR} 88 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 89 ${LIBDIR}/libtermcap.so.0.6 90 SYMLINKS+= libterminfo.so.${SHLIB_FULLVERSION} \ 91 ${LIBDIR}/libtermlib.so.0.6 92 .endif 93 94 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 95 ${_LIBSODIR}/libtermcap.so.0 96 SYMLINKS+= libterminfo.so ${_LIBSODIR}/libtermcap.so 97 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 98 ${_LIBSODIR}/libtermlib.so.0 99 SYMLINKS+= libterminfo.so ${_LIBSODIR}/libtermlib.so 100 .if ${_LIBSODIR} != ${LIBDIR} 101 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 102 ${LIBDIR}/libtermcap.so.0 103 SYMLINKS+= libterminfo.so ${LIBDIR}/libtermcap.so 104 SYMLINKS+= libterminfo.so.${SHLIB_MAJOR} \ 105 ${LIBDIR}/libtermlib.so.0 106 SYMLINKS+= libterminfo.so ${LIBDIR}/libtermlib.so 107 .endif 108 .endif # exists shlib_version 109 110 .endif # ${MKPIC} != "no" 111 112 .include <bsd.lib.mk> 113