Makefile revision 1.1
1#	$NetBSD: Makefile,v 1.1 2010/02/03 15:16:32 roy Exp $
2
3USE_SHLIBDIR=	yes
4
5LIB=		terminfo
6WARNS=		4
7
8SRCS=		term.c ti.c setupterm.c curterm.c tparm.c tputs.c
9SRCS+=		hash.c
10INCS=		term.h
11INCSDIR=	/usr/include
12
13LIBTIDIR?=	${.CURDIR}
14CPPFLAGS+=	-I${LIBTIDIR}
15
16# Generate our string and hash tables
17hash.c: genhash term.h
18		@echo "Generating terminfo hash"
19		cd ${LIBTIDIR}; ./genhash >${.OBJDIR}/$@
20
21# Update our man page with terminfo long names, short names and termcaps
22terminfo.5: genman terminfo.5.in term.h termcap.c
23		@echo "Generating terminfo man pages"
24		cd ${LIBTIDIR}; ./genman >${.OBJDIR}/$@
25
26MAN=		terminfo.3 terminfo.5
27CLEANFILES+=	terminfo.5 hash.c
28MLINKS=		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
39SRCS+=		termcap.c
40INCS+=		termcap.h
41CPPFLAGS+=	-I${.OBJDIR}
42MAN+=		termcap.3
43CLEANFILES+=	_termcap.c termcap_hash.c
44MLINKS+=	termcap.3 tgetent.3 termcap.3 tgetflag.3 termcap.3 tgetnum.3 \
45		termcap.3 tgetstr.3 termcap.3 tgoto.3
46
47# Generate our string and hash tables
48termcap_hash.c:	genthash termcap_map.c
49		@echo "Generating termcap hash"
50		cd ${LIBTIDIR}; ./genthash >${.OBJDIR}/$@
51
52# Depend on our hash table
53termcap.c:	termcap_hash.c
54
55.include <bsd.own.mk>
56.include <bsd.shlib.mk>
57
58.if ${MKLINKLIB} != "no"
59SYMLINKS+=	libterminfo.a ${LIBDIR}/libtermcap.a
60SYMLINKS+=	libterminfo.a ${LIBDIR}/libtermlib.a
61.endif
62
63.if ${MKPROFILE} != "no"
64SYMLINKS+=	libterminfo_p.a ${LIBDIR}/libtermcap_p.a
65SYMLINKS+=	libterminfo_p.a ${LIBDIR}/libtermlib_p.a
66.endif
67
68.if ${MKPIC} != "no"
69
70.if ${MKPICINSTALL} != "no"
71SYMLINKS+=	libterminfo_pic.a ${LIBDIR}/libtermcap_pic.a
72SYMLINKS+=	libterminfo_pic.a ${LIBDIR}/libtermlib_pic.a
73.endif
74
75.if exists(${.CURDIR}/shlib_version)
76SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
77		${_LIBSODIR}/libtermcap.so.0.6
78SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
79		${_LIBSODIR}/libtermlib.so.0.6
80.if ${_LIBSODIR} != ${LIBDIR}
81SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
82		${LIBDIR}/libtermcap.so.0.6
83SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
84		${LIBDIR}/libtermlib.so.0.6
85.endif
86
87.if (${OBJECT_FMT} == "ELF")
88SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
89		${_LIBSODIR}/libtermcap.so.0
90SYMLINKS+=	libterminfo.so ${_LIBSODIR}/libtermcap.so
91SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
92		${_LIBSODIR}/libtermlib.so.0
93SYMLINKS+=	libterminfo.so ${_LIBSODIR}/libtermlib.so
94.if ${_LIBSODIR} != ${LIBDIR}
95SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
96	${LIBDIR}/libtermcap.so.0
97SYMLINKS+=	libterminfo.so ${LIBDIR}/libtermcap.so
98SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
99		${LIBDIR}/libtermlib.so.0
100SYMLINKS+=	libterminfo.so ${LIBDIR}/libtermlib.so
101.endif
102.endif
103.endif	# exists shlib_version
104
105.endif	# ${MKPIC} != "no"
106
107.include <bsd.lib.mk>
108