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