Enable wide character support in ncurses, since we have it, better make
[games.git] / lib / libncurses / libncurses / Makefile
1 # $DragonFly: src/lib/libncurses/libncurses/Makefile,v 1.7 2005/09/22 11:14:44 asmodai Exp $
2
3 LIB=    ncurses
4
5 .include "../Makefile.inc"
6
7 NCURSESBASEDIR=${NCURSESDIR}/ncurses/base
8 NCURSESSERIALDIR=${NCURSESDIR}/ncurses/tty
9 NCURSESTINFODIR=${NCURSESDIR}/ncurses/tinfo
10 NCURSESTRACEDIR=${NCURSESDIR}/ncurses/trace
11 .PATH: ${NCURSESBASEDIR} ${NCURSESSERIALDIR} ${NCURSESTINFODIR} \
12         ${NCURSESTRACEDIR} ${.OBJDIR} ${NCURSESDIR}/include/
13
14 CFLAGS+=        -I${NCURSESDIR}/ncurses/
15 CFLAGS+=        -DTRACE
16
17 TERMINFO_CAPS=  ${NCURSESDIR}/include/Caps
18 ncurses_def.h:
19         ${NCURSESDIR}/include/MKncurses_def.sh ${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
20 curses.h:
21         cat ${.CURDIR}/../include/curses.head >$@
22         ${NCURSESDIR}/include/MKkey_defs.sh $(TERMINFO_CAPS) >>$@
23         cat ${NCURSESDIR}/include/curses.wide >>$@
24         cat ${NCURSESDIR}/include/curses.tail >>$@
25 term.h:
26         awk -f ${.CURDIR}/../include/MKterm.h.awk ${TERMINFO_CAPS} > $@
27         ${NCURSESDIR}/include/edit_cfg.sh ${.CURDIR}/../include/ncurses_cfg.h $@
28 hashsize.h:
29         ${NCURSESDIR}/include/MKhashsize.sh ${TERMINFO_CAPS} >$@
30 parametrized.h:
31         ${NCURSESDIR}/include/MKparametrized.sh ${TERMINFO_CAPS} >$@
32 init_keytry.h: make_keys keys.list
33         ./make_keys keys.list > $@
34
35 make_keys: make_keys.c
36         ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} ${NCURSESTINFODIR}/make_keys.c ${NXLDLIBS} -o ${.TARGET}
37 make_keys.c: names.c ncurses_def.h
38
39 keys.list:
40         ${NCURSESTINFODIR}/MKkeys_list.sh ${TERMINFO_CAPS} | sort > $@
41
42 names.c codes.c:
43         awk -f ${NCURSESTINFODIR}/MKnames.awk ${TERMINFO_CAPS}
44         cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >names.c
45         cat namehdr boolcodes numcodes strcodes codeftr >codes.c
46 comp_captab.c: make_hash
47         sh ${NCURSESTINFODIR}/MKcaptab.awk awk ${TERMINFO_CAPS} > $@
48
49 make_hash: ${NCURSESTINFODIR}/comp_hash.c
50         ${NXCC} ${NXCFLAGS} ${NXLDFLAGS} -DMAIN_PROGRAM ${NXLDLIBS} -o ${.TARGET} ${NCURSESTINFODIR}/comp_hash.c
51
52 make_hash: hashsize.h ncurses_def.h curses.h
53
54 expanded.c:
55         sh ${NCURSESSERIALDIR}/MKexpanded.sh "${CC}" -E ${CFLAGS} > $@
56 fallback.c:
57         sh ${NCURSESTINFODIR}/MKfallback.sh /usr/share/terminfo ${NCURSESDIR}/misc/terminfo.src >$@
58 lib_gen.c: curses.h
59         sh ${NCURSESBASEDIR}/MKlib_gen.sh "${CC} -E ${CFLAGS}" awk generated <curses.h >$@
60 lib_keyname.c: keys.list
61         awk -f ${NCURSESBASEDIR}/MKkeyname.awk keys.list > $@
62 unctrl.c:
63         echo | awk -f ${NCURSESBASEDIR}/MKunctrl.awk >$@
64
65 CLEANFILES=     curses.h ncurses_def.h term.h hashsize.h parametrized.h comp_captab.c
66 CLEANFILES+=    namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr
67 CLEANFILES+=    codes.c init_keytry.h numcodes strcodes boolcodes codeftr make_keys names.c
68 CLEANFILES+=    make_hash expanded.c fallback.c lib_gen.c lib_keyname.c unctrl.c keys.list
69
70 SRCS=   \
71         curses.h \
72         ncurses_def.h \
73         term.h \
74         hashsize.h \
75         parametrized.h \
76         init_keytry.h
77
78 # Base
79 SRCS+=  \
80         define_key.c \
81         key_defined.c \
82         keybound.c \
83         keyok.c \
84         lib_addch.c \
85         lib_addstr.c \
86         lib_beep.c \
87         lib_bkgd.c \
88         lib_box.c \
89         lib_chgat.c \
90         lib_clear.c \
91         lib_clearok.c \
92         lib_clrbot.c \
93         lib_clreol.c \
94         lib_color.c \
95         lib_colorset.c \
96         lib_delch.c \
97         lib_delwin.c \
98         lib_dft_fgbg.c \
99         lib_echo.c \
100         lib_endwin.c \
101         lib_erase.c \
102         lib_flash.c \
103         lib_freeall.c \
104         lib_getch.c \
105         lib_getstr.c \
106         lib_hline.c \
107         lib_immedok.c \
108         lib_inchstr.c \
109         lib_initscr.c \
110         lib_insch.c \
111         lib_insdel.c \
112         lib_instr.c \
113         lib_isendwin.c \
114         lib_leaveok.c \
115         lib_mouse.c \
116         lib_move.c \
117         lib_mvwin.c \
118         lib_newterm.c \
119         lib_newwin.c \
120         lib_nl.c \
121         lib_overlay.c \
122         lib_pad.c \
123         lib_printw.c \
124         lib_redrawln.c \
125         lib_refresh.c \
126         lib_restart.c \
127         lib_scanw.c \
128         lib_screen.c \
129         lib_scroll.c \
130         lib_scrollok.c \
131         lib_scrreg.c \
132         lib_set_term.c \
133         lib_slk.c \
134         lib_slkatr_set.c \
135         lib_slkatrof.c \
136         lib_slkatron.c \
137         lib_slkatrset.c \
138         lib_slkattr.c \
139         lib_slkclear.c \
140         lib_slkcolor.c \
141         lib_slkinit.c \
142         lib_slklab.c \
143         lib_slkrefr.c \
144         lib_slkset.c \
145         lib_slktouch.c \
146         lib_touch.c \
147         lib_ungetch.c \
148         lib_vline.c \
149         lib_wattroff.c \
150         lib_wattron.c \
151         lib_winch.c \
152         lib_window.c \
153         memmove.c \
154         nc_panel.c \
155         resizeterm.c \
156         safe_sprintf.c \
157         tries.c \
158         version.c \
159         vsscanf.c \
160         wresize.c
161
162 # Serial
163 SRCS+=  \
164         hardscroll.c \
165         hashmap.c \
166         lib_mvcur.c \
167         lib_tstp.c \
168         lib_twait.c \
169         lib_vidattr.c \
170         tty_update.c
171
172 # Tinfo
173 SRCS+=  \
174         access.c \
175         add_tries.c \
176         alloc_entry.c \
177         alloc_ttype.c \
178         captoinfo.c \
179         comp_error.c \
180         comp_expand.c \
181         comp_hash.c \
182         comp_parse.c \
183         comp_scan.c \
184         doalloc.c \
185         free_ttype.c \
186         getenv_num.c \
187         home_terminfo.c \
188         init_keytry.c \
189         lib_acs.c \
190         lib_baudrate.c \
191         lib_cur_term.c \
192         lib_data.c \
193         lib_has_cap.c \
194         lib_kernel.c \
195         lib_longname.c \
196         lib_napms.c \
197         lib_options.c \
198         lib_print.c \
199         lib_raw.c \
200         lib_setup.c \
201         lib_termcap.c \
202         lib_termname.c \
203         lib_tgoto.c \
204         lib_ti.c \
205         lib_tparm.c \
206         lib_tputs.c \
207         lib_ttyflags.c \
208         name_match.c \
209         parse_entry.c \
210         read_entry.c \
211         setbuf.c \
212         strings.c \
213         write_entry.c
214
215 # Trace
216 SRCS+=  \
217         lib_trace.c \
218         lib_traceatr.c \
219         lib_tracebits.c \
220         lib_tracechr.c \
221         lib_tracedmp.c \
222         lib_tracemse.c \
223         trace_buf.c \
224         trace_tries.c \
225         trace_xnames.c \
226         varargs.c \
227         visbuf.c \
228
229 # Generated
230 SRCS+=  \
231         codes.c \
232         comp_captab.c \
233         expanded.c \
234         fallback.c \
235         lib_gen.c \
236         lib_keyname.c \
237         names.c \
238         unctrl.c
239
240 # Use instead of read_termcap.c.
241 # From our old libtermcap.
242 SRCS+=  termcap.c
243
244 SYMLINKS+=libncurses.a ${LIBDIR}/libcurses.a
245 SYMLINKS+=libncurses.a ${LIBDIR}/libtinfo.a
246 SYMLINKS+=libncurses.a ${LIBDIR}/libmytinfo.a
247 SYMLINKS+=libncurses.a ${LIBDIR}/libtermlib.a
248 SYMLINKS+=libncurses.a ${LIBDIR}/libtermcap.a
249 .if !defined(NOPIC)
250 # no need for major at all, it's an ld-time redirection only
251 SYMLINKS+=libncurses.so ${SHLIBDIR}/libcurses.so
252 SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermcap.so
253 SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermlib.so
254 SYMLINKS+=libncurses.so ${SHLIBDIR}/libmytinfo.so
255 SYMLINKS+=libncurses.so ${SHLIBDIR}/libtinfo.so
256 .endif
257 .if !defined(NOPROFILE)
258 SYMLINKS+=libncurses.a ${PROFLIBDIR}/libcurses.a
259 SYMLINKS+=libncurses.a ${PROFLIBDIR}/libtermcap.a
260 SYMLINKS+=libncurses.a ${PROFLIBDIR}/libtermlib.a
261 SYMLINKS+=libncurses.a ${PROFLIBDIR}/libmytinfo.a
262 SYMLINKS+=libncurses.a ${PROFLIBDIR}/libtinfo.aa
263 .endif
264
265 INCS=   term.h ${.CURDIR}/../include/termcap.h \
266         ${.CURDIR}/../include/unctrl.h curses.h
267 INCSLINKS=curses.h ${INCLUDEDIR}/ncurses.h
268
269 .include <bsd.lib.mk>