Makefile revision 1.13
1#	$NetBSD: Makefile,v 1.13 2011/08/16 10:36:30 christos Exp $
2
3USE_SHLIBDIR=	yes
4
5LIB=		terminfo
6WARNS=		4
7
8CPPFLAGS+=	-I${.CURDIR}
9
10SRCS=		term.c ti.c setupterm.c curterm.c tparm.c tputs.c
11SRCS+=		compile.c hash.c
12INCS=		term.h
13INCSDIR=	/usr/include
14
15MAN=		terminfo.3 terminfo.5
16MLINKS=		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
27SRCS+=		termcap.c
28INCS+=		termcap.h
29MAN+=		termcap.3
30MLINKS+=	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
34hash:
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
41terminfo.5: terminfo.5.in term.h termcap_map.c
42		@echo "Generating terminfo man pages"
43		cd ${.CURDIR} && ${HOST_SH} ./genman >${.OBJDIR}/$@
44
45CLEANFILES+=	terminfo.5
46
47# Allow terminfo descriptions to be compiled into libterminfo
48compiled_terms:
49		@echo "Generating compiled terminfo descriptions"
50		cd ${.CURDIR} && ${HOST_SH} ./genterms >compiled_terms.c
51
52COPTS.tparm.c = -Wno-format-nonliteral
53man: terminfo.5
54
55gen: hash compiled_terms man
56
57.include <bsd.own.mk>
58.include <bsd.shlib.mk>
59
60.if ${MKLINKLIB} != "no"
61SYMLINKS+=	libterminfo.a ${LIBDIR}/libtermcap.a
62SYMLINKS+=	libterminfo.a ${LIBDIR}/libtermlib.a
63.endif
64
65.if ${MKPROFILE} != "no"
66SYMLINKS+=	libterminfo_p.a ${LIBDIR}/libtermcap_p.a
67SYMLINKS+=	libterminfo_p.a ${LIBDIR}/libtermlib_p.a
68.endif
69
70.if ${MKPIC} != "no"
71
72.if ${MKPICINSTALL} != "no"
73SYMLINKS+=	libterminfo_pic.a ${LIBDIR}/libtermcap_pic.a
74SYMLINKS+=	libterminfo_pic.a ${LIBDIR}/libtermlib_pic.a
75.endif
76
77.if exists(${.CURDIR}/shlib_version)
78SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
79		${_LIBSODIR}/libtermcap.so.0.6
80SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
81		${_LIBSODIR}/libtermlib.so.0.6
82.if ${_LIBSODIR} != ${LIBDIR}
83SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
84		${LIBDIR}/libtermcap.so.0.6
85SYMLINKS+=	libterminfo.so.${SHLIB_FULLVERSION} \
86		${LIBDIR}/libtermlib.so.0.6
87.endif
88
89SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
90		${_LIBSODIR}/libtermcap.so.0
91SYMLINKS+=	libterminfo.so ${_LIBSODIR}/libtermcap.so
92SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
93		${_LIBSODIR}/libtermlib.so.0
94SYMLINKS+=	libterminfo.so ${_LIBSODIR}/libtermlib.so
95.if ${_LIBSODIR} != ${LIBDIR}
96SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
97		${LIBDIR}/libtermcap.so.0
98SYMLINKS+=	libterminfo.so ${LIBDIR}/libtermcap.so
99SYMLINKS+=	libterminfo.so.${SHLIB_MAJOR} \
100		${LIBDIR}/libtermlib.so.0
101SYMLINKS+=	libterminfo.so ${LIBDIR}/libtermlib.so
102.endif
103.endif	# exists shlib_version
104
105.endif	# ${MKPIC} != "no"
106
107.include <bsd.lib.mk>
108