Merge commit 'dfc115332c94a2f62058ac7f2bce7631fbd20b3d'
[unleashed/tickless.git] / lib / libncurses / ncurses / Makefile
blobcbee3ca4e6ca597f2b6915c13def72d47bcdb991
1 .include "${.CURDIR:H}/config.mk"
3 LIB= ncurses
4 LINKS= ${LIBDIR}/libncurses.${LD_so} ${LIBDIR}/libcurses.${LD_so}
5 SYMLINKS= libcurses.${LD_so} ${LIBDIR}/libcurses.so
6 SYMLINKS+= libcurses.${LD_so} ${LIBDIR}/libcurses.so.${SHLIB_MAJOR}
7 SYMLINKS+= curses.h ${INCDIR}/ncurses.h
9 # does not include init_keytry.h, which is generated later
10 GENHDRS= \
11 curses.h \
12 hashsize.h \
13 ncurses_def.h \
14 parametrized.h
16 GENSRCS= \
17 codes.c \
18 comp_captab.c \
19 expanded.c \
20 fallback.c \
21 lib_gen.c \
22 lib_keyname.c \
23 names.c \
24 unctrl.c
26 BUILDFIRST = ${GENHDRS} init_keytry.h
27 # includes generated <init_keytry.h>
28 COPTS.init_keytry.c += -I.
29 .NOPATH: curses.h
31 INCS= curses.h \
32 ${NCURSES_INC}/termcap.h \
33 ${NCURSES_INC}/unctrl.h \
34 ${NCURSES_INC}/ncurses_dll.h \
35 ${NCURSES_INC}/term.h
37 .PATH: ${.CURDIR}
39 curses.h: Caps \
40 curses.head \
41 curses.tail \
42 MKkey_defs.sh
43 cat ${NCURSES_INC}/curses.head >$@
44 AWK=${AWK} ${SHELL} ${NCURSES_INC}/MKkey_defs.sh ${TERMINFO_CAPS} >> $@
45 ${SHELL} -c 'if test "cchar_t" = "cchar_t" ; then cat ${NCURSES_INC}/curses.wide >> $@ ; fi'
46 cat ${NCURSES_INC}/curses.tail >> $@
48 hashsize.h: MKhashsize.sh Caps
49 ${SHELL} ${NCURSES_INC}/MKhashsize.sh ${TERMINFO_CAPS} > $@
51 ncurses_def.h: ncurses_defs MKncurses_def.sh
52 AWK=${AWK} ${SHELL} ${NCURSES_INC}/MKncurses_def.sh ${NCURSES_INC}/ncurses_defs > $@
54 parametrized.h: MKparametrized.sh Caps
55 AWK=${AWK} ${SHELL} ${NCURSES_INC}/MKparametrized.sh ${TERMINFO_CAPS} > $@
57 names.c: MKnames.awk Caps
58 ${AWK} -f ${NCURSES_TINFO}/MKnames.awk bigstrings=${USE_BIG_STRINGS} ${TERMINFO_CAPS} >$@
60 codes.c: MKcodes.awk Caps
61 ${AWK} -f ${NCURSES_TINFO}/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${TERMINFO_CAPS} >$@
63 fallback.c : MKfallback.sh Caps
64 ${SHELL} -e ${NCURSES_TINFO}/MKfallback.sh ${TERMINFO} ${TERMINFO_SRC} ${TIC_PATH} >$@
66 lib_gen.c : MKlib_gen.sh curses.h
67 ${SHELL} -e ${NCURSES_BASE}/MKlib_gen.sh "${CPP} ${CFLAGS}" ${AWK} generated < curses.h >$@
69 init_keytry.h: make_keys keys.list
70 ./make_keys keys.list >$@
72 keys.list: MKkeys_list.sh Caps
73 AWK=${AWK} ${SHELL} ${NCURSES_TINFO}/MKkeys_list.sh ${TERMINFO_CAPS} | LC_ALL=C sort >$@
75 expanded.c: curses.priv.h MKexpanded.sh
76 ${SHELL} -e ${NCURSES_SERIAL}/MKexpanded.sh "${CPP} ${CFLAGS}" >$@
78 # includes <names.c> so add -I.
79 make_keys: ${GENHDRS} make_keys.c names.c
80 ${CC} -o $@ ${CFLAGS} -I. ${NCURSES_TINFO}/make_keys.c
82 make_hash: ${GENHDRS} \
83 make_hash.c \
84 hashsize.h \
85 ncurses_def.h
86 ${CC} -o $@ ${CFLAGS} ${NCURSES_TINFO}/make_hash.c
88 # expects 'make_hash' in PATH
89 comp_captab.c: ${GENHDRS} \
90 hashsize.h \
91 MKcaptab.sh \
92 MKcaptab.awk \
93 make_hash
94 PATH=.:${PATH} ${SHELL} -e ${NCURSES_TINFO}/MKcaptab.sh ${AWK} ${USE_BIG_STRINGS} ${NCURSES_TINFO}/MKcaptab.awk ${TERMINFO_CAPS} >$@
96 lib_keyname.c: keys.list MKkeyname.awk
97 ${AWK} -f ${NCURSES_BASE}/MKkeyname.awk bigstrings=${USE_BIG_STRINGS} keys.list >$@
99 unctrl.c: MKunctrl.awk
100 echo | ${AWK} -f ${NCURSES_BASE}/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} >$@
102 SRCS= ${GENHDRS} ${GENSRCS}
104 # Base
105 SRCS+= \
106 define_key.c \
107 key_defined.c \
108 keybound.c \
109 keyok.c \
110 legacy_coding.c \
111 lib_addch.c \
112 lib_addstr.c \
113 lib_beep.c \
114 lib_bkgd.c \
115 lib_box.c \
116 lib_chgat.c \
117 lib_clear.c \
118 lib_clearok.c \
119 lib_clrbot.c \
120 lib_clreol.c \
121 lib_color.c \
122 lib_colorset.c \
123 lib_delch.c \
124 lib_delwin.c \
125 lib_dft_fgbg.c \
126 lib_echo.c \
127 lib_endwin.c \
128 lib_erase.c \
129 lib_flash.c \
130 lib_freeall.c \
131 lib_getch.c \
132 lib_getstr.c \
133 lib_hline.c \
134 lib_immedok.c \
135 lib_inchstr.c \
136 lib_initscr.c \
137 lib_insch.c \
138 lib_insdel.c \
139 lib_insnstr.c \
140 lib_instr.c \
141 lib_isendwin.c \
142 lib_keyname.c \
143 lib_leaveok.c \
144 lib_mouse.c \
145 lib_move.c \
146 lib_mvwin.c \
147 lib_newterm.c \
148 lib_newwin.c \
149 lib_nl.c \
150 lib_overlay.c \
151 lib_pad.c \
152 lib_printw.c \
153 lib_redrawln.c \
154 lib_refresh.c \
155 lib_restart.c \
156 lib_scanw.c \
157 lib_screen.c \
158 lib_scroll.c \
159 lib_scrollok.c \
160 lib_scrreg.c \
161 lib_set_term.c \
162 lib_slk.c \
163 lib_slkatr_set.c \
164 lib_slkatrof.c \
165 lib_slkatron.c \
166 lib_slkatrset.c \
167 lib_slkattr.c \
168 lib_slkclear.c \
169 lib_slkcolor.c \
170 lib_slkinit.c \
171 lib_slklab.c \
172 lib_slkrefr.c \
173 lib_slkset.c \
174 lib_slktouch.c \
175 lib_touch.c \
176 lib_ungetch.c \
177 lib_vline.c \
178 lib_wattroff.c \
179 lib_wattron.c \
180 lib_winch.c \
181 lib_window.c \
182 nc_panel.c \
183 new_pair.c \
184 resizeterm.c \
185 safe_sprintf.c \
186 wresize.c \
187 tries.c \
188 use_window.c \
189 version.c \
190 vsscanf.c \
191 wresize.c
193 # Serial
194 SRCS+= \
195 hardscroll.c \
196 hashmap.c \
197 lib_mvcur.c \
198 lib_tstp.c \
199 lib_twait.c \
200 lib_vidattr.c \
201 tty_update.c
203 # Tinfo
204 SRCS+= access.c \
205 add_tries.c \
206 alloc_entry.c \
207 alloc_ttype.c \
208 captoinfo.c \
209 comp_error.c \
210 comp_expand.c \
211 comp_hash.c \
212 comp_parse.c \
213 comp_scan.c \
214 db_iterator.c \
215 doalloc.c \
216 entries.c \
217 free_ttype.c \
218 getenv_num.c \
219 hashed_db.c \
220 home_terminfo.c \
221 init_keytry.c \
222 lib_acs.c \
223 lib_baudrate.c \
224 lib_cur_term.c \
225 lib_data.c \
226 lib_has_cap.c \
227 lib_kernel.c \
228 lib_longname.c \
229 lib_napms.c \
230 lib_options.c \
231 lib_print.c \
232 lib_raw.c \
233 lib_setup.c \
234 lib_termcap.c \
235 lib_termname.c \
236 lib_tgoto.c \
237 lib_ti.c \
238 lib_tparm.c \
239 lib_tputs.c \
240 lib_ttyflags.c \
241 name_match.c \
242 obsolete.c \
243 parse_entry.c \
244 read_entry.c \
245 read_termcap.c \
246 strings.c \
247 trim_sgr0.c \
248 use_screen.c \
249 write_entry.c
251 # Trace
252 SRCS+= lib_trace.c \
253 lib_traceatr.c \
254 lib_tracebits.c \
255 lib_tracechr.c \
256 lib_tracedmp.c \
257 lib_tracemse.c \
258 trace_buf.c \
259 trace_tries.c \
260 trace_xnames.c \
261 varargs.c \
262 visbuf.c \
264 # Widechar
265 SRCS+= charable.c \
266 lib_add_wch.c \
267 lib_box_set.c \
268 lib_cchar.c \
269 lib_erasewchar.c \
270 lib_get_wch.c \
271 lib_get_wstr.c \
272 lib_hline_set.c \
273 lib_in_wch.c \
274 lib_in_wchnstr.c \
275 lib_ins_wch.c \
276 lib_inwstr.c \
277 lib_key_name.c \
278 lib_pecho_wchar.c \
279 lib_slk_wset.c \
280 lib_unget_wch.c \
281 lib_vid_attr.c \
282 lib_vline_set.c \
283 lib_wacs.c \
284 lib_wunctrl.c \
285 widechars.c
287 includes: curses.h
288 .if !empty(INCS)
289 ${INSTALL} -d ${INC_INSTALL_OWN} -m 755 ${DESTDIR}${INCSDIR}
290 ${INSTALL} ${INC_COPY} ${INC_INSTALL_OWN} -m ${INCMODE} ${INCS} ${DESTDIR}${INCSDIR}
291 .endif
293 pc_files:
294 @test -d ${DESTDIR}/usr/lib/pkgconfig || \
295 mkdir -p ${DESTDIR}/usr/lib/pkgconfig
296 ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
297 -m 0644 ${NCURSES_SRC}/ncurses.pc ${DESTDIR}/usr/lib/pkgconfig/
300 tabset= std stdcrt vt100 vt300
302 misc_files:
303 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \
304 -m 555 ${NCURSES_DIR}/misc/ncurses-config ${DESTDIR}/usr/bin/
305 @test -d ${DESTDIR}/usr/share/tabset || \
306 mkdir -p ${DESTDIR}/usr/share/tabset
307 @for i in ${tabset}; do \
308 j="${INSTALL} ${INSTALL_COPY} ${INC_INSTALL_OWN} -m 0644 ${NCURSES_DIR}/misc/tabset/$$i \
309 ${DESTDIR}/usr/share/tabset"; \
310 echo $$j; \
311 eval "$$j"; \
312 done;
315 CLEANFILES= ${GENSRCS} ${GENHDRS} fallback.c lib_gen.c init_keytry.h keys.list make_hash \
316 make_keys make_hash.dep make_keys.dep
319 SHLIB_LDADD+= -M${NCURSES_SRC}/mapfile
320 realbuild: ${MAPFILE}
322 afterinstall: incinstall pc_files misc_files
323 .if !empty(SYMLINKS)
324 @set ${SYMLINKS}; ${_SYMLINKS_SCRIPT}
325 .endif
326 .include <bsd.lib.mk>