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