xref: /dragonfly/lib/libncurses/Makefile.sources (revision ed183f8c)
1# All ncurses, ncursesw, panel, panelw, tic details
2
3############ Legend ##############
4# B - bootstrap tic specific
5# N - ncurses standard lib
6# P - libpanel
7# W - ncurses wide lib
8# T - reserved for future libtinfo
9# t - specific to -DTRACE
10##################################
11
12GENHDRS_NWP+=	curses.h
13GENHDRS_NWB+=	hashsize.h
14GENHDRS_NWB+=	init_keytry.h
15GENHDRS_NWP+=	ncurses_def.h
16GENHDRS_NWB+=	parametrized.h
17GENHDRS_NWP+=	term.h
18
19GENSRCS_NWB+=	codes.c
20GENSRCS_NWB+=	comp_captab.c
21GENSRCS_NW+=	expanded.c
22GENSRCS_NWB+=	fallback.c
23GENSRCS_NW+=	lib_gen.c
24GENSRCS_NWB+=	lib_keyname.c
25GENSRCS_NWB+=	names.c
26GENSRCS_NWB+=	unctrl.c
27
28# Headers to install
29.if defined(ZNCURSES) || defined(ZTIC)
30HEADERS=	curses.h term.h termcap.h unctrl.h
31SRCHDRS=	ncurses_dll.h
32.endif
33
34# Generators
35# Careful! Some of contrib scripts may invoke make_hash and make_keys internally.
36ncurses_def.h:	MKncurses_def.sh ncurses_defs
37	AWK=awk sh ${NCURSESDIR}/include/MKncurses_def.sh \
38	${NCURSESDIR}/include/ncurses_defs > ${.TARGET}
39
40curses.h: $(TERMINFO_CAPS) curses.head curses.tail MKkey_defs.sh
41	cat ${.CURDIR}/../include/curses.head | \
42	sed -e 's|SET_NEED_WCHAR_H|${SW_WIDEC}|' \
43	    -e 's|SET_NCURSES_CH_T|${SW_TYPE}|' > ${.TARGET}.new
44	AWK=awk sh ${NCURSESDIR}/include/MKkey_defs.sh $(TERMINFO_CAPS) >> ${.TARGET}.new
45.if defined(ENABLE_WIDEC)
46	cat ${NCURSESDIR}/include/curses.wide >> ${.TARGET}.new
47.endif
48	cat ${NCURSESDIR}/include/curses.tail >> ${.TARGET}.new
49	mv -f ${.TARGET}.new ${.TARGET}
50
51term.h: MKterm.h.awk edit_cfg.sh Caps
52	awk -f ${.CURDIR}/../include/MKterm.h.awk ${TERMINFO_CAPS} > ${.TARGET}.new
53	sh ${NCURSESDIR}/include/edit_cfg.sh ${.CURDIR}/../include/ncurses_cfg.h ${.TARGET}.new
54	mv -f ${.TARGET}.new ${.TARGET}
55
56.if defined(ZNCURSES) || defined(ZTIC)
57hashsize.h: MKhashsize.sh Caps
58	sh ${NCURSESDIR}/include/MKhashsize.sh ${TERMINFO_CAPS} > ${.TARGET}
59
60parametrized.h: MKparametrized.sh Caps
61	sh ${NCURSESDIR}/include/MKparametrized.sh ${TERMINFO_CAPS} > ${.TARGET}
62
63init_keytry.h: make_keys keys.list
64	./make_keys keys.list > ${.TARGET}
65
66make_keys: make_keys.c names.c ncurses_def.h ${VERSION_MAP} ${HEADERS}
67	${NXCC} ${NXCFLAGS:N-flto:N-W*} -static ${NCURSESTINFODIR}/make_keys.c ${NXLDLIBS} -o ${.TARGET}
68
69keys.list: MKkeys_list.sh Caps
70	sh ${NCURSESTINFODIR}/MKkeys_list.sh ${TERMINFO_CAPS} | LC_ALL=C sort > ${.TARGET}
71
72names.c: MKnames.awk Caps
73	awk -f ${NCURSESTINFODIR}/MKnames.awk bigstrings=1 ${TERMINFO_CAPS} > ${.TARGET}
74
75codes.c: MKcodes.awk Caps
76	awk -f ${NCURSESTINFODIR}/MKcodes.awk bigstrings=1 ${TERMINFO_CAPS} > ${.TARGET}
77
78comp_captab.c: make_hash MKcaptab.sh MKcaptab.awk Caps
79	sh -e ${NCURSESTINFODIR}/MKcaptab.sh awk 1 ${NCURSESTINFODIR}/MKcaptab.awk ${TERMINFO_CAPS} > ${.TARGET}
80
81make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS}
82	${NXCC} ${NXCFLAGS:N-flto:N-W*} -static -DMAIN_PROGRAM ${NCURSESTINFODIR}/make_hash.c ${NXLDLIBS} -o ${.TARGET}
83
84expanded.c: MKexpanded.sh ${GENHDRS_NWP}
85	${NXENV} sh ${NCURSESSERIALDIR}/MKexpanded.sh "${CC}" -E ${NXCFLAGS:N-W*} > ${.TARGET}
86
87fallback.c: MKfallback.sh
88	sh ${NCURSESTINFODIR}/MKfallback.sh /usr/share/terminfo ${NCURSESDIR}/misc/terminfo.src > ${.TARGET}
89
90lib_gen.c: MKlib_gen.sh curses.h ncurses_def.h term.h
91	${NXENV} sh ${NCURSESBASEDIR}/MKlib_gen.sh "${CC} -E ${NXCFLAGS:N-W*}" awk generated <curses.h > ${.TARGET}
92
93lib_keyname.c: MKkeyname.awk keys.list
94	awk -f ${NCURSESBASEDIR}/MKkeyname.awk bigstrings=1 keys.list > ${.TARGET}
95
96unctrl.c: MKunctrl.awk
97	echo | awk -f ${NCURSESBASEDIR}/MKunctrl.awk bigstrings=1 > ${.TARGET}
98.endif
99
100# Generated
101SRCS_ALL+=	${GENHDRS_NWP}
102.if defined(ZNCURSES) || defined(ZTIC)
103SRCS_ALL+=	${GENHDRS_NWB} ${GENSRCS_NWB}
104CLEANFILES+=	${GENHDRS_NWB} ${GENSRCS_NWB}
105CLEANFILES+=	make_keys make_hash keys.list
106.endif
107.if defined(ZNCURSES)
108SRCS_ALL+=	${GENSRCS_NW} ${GENHDRS_NW}
109CLEANFILES+=	${GENSRCS_NW} ${GENHDRS_NW}
110.endif
111CLEANFILES+=	${GENHDRS_NWP} term.h.new curses.h.new
112
113# Base
114SRCS_NW+=	define_key.c
115SRCS_NWB+=	key_defined.c
116SRCS_NWB+=	keybound.c
117SRCS_NW+=	keyok.c
118SRCS_NW+=	legacy_coding.c
119SRCS_NW+=	lib_addch.c
120SRCS_NW+=	lib_addstr.c
121SRCS_NW+=	lib_beep.c
122SRCS_NW+=	lib_bkgd.c
123SRCS_NW+=	lib_box.c
124SRCS_NW+=	lib_chgat.c
125SRCS_NW+=	lib_clear.c
126SRCS_NW+=	lib_clearok.c
127SRCS_NW+=	lib_clrbot.c
128SRCS_NW+=	lib_clreol.c
129SRCS_NW+=	lib_color.c
130SRCS_NW+=	lib_colorset.c
131SRCS_NW+=	lib_delch.c
132SRCS_NW+=	lib_delwin.c
133SRCS_NW+=	lib_dft_fgbg.c
134SRCS_NW+=	lib_echo.c
135SRCS_NW+=	lib_endwin.c
136SRCS_NW+=	lib_erase.c
137SRCS_NW+=	lib_flash.c
138SRCS_NW+=	lib_freeall.c
139SRCS_NW+=	lib_getch.c
140SRCS_NW+=	lib_getstr.c
141SRCS_NW+=	lib_hline.c
142SRCS_NW+=	lib_immedok.c
143SRCS_NW+=	lib_inchstr.c
144SRCS_NW+=	lib_initscr.c
145SRCS_NW+=	lib_insch.c
146SRCS_NW+=	lib_insdel.c
147SRCS_NW+=	lib_insnstr.c
148SRCS_NW+=	lib_instr.c
149SRCS_NW+=	lib_isendwin.c
150SRCS_NW+=	lib_leaveok.c
151SRCS_NW+=	lib_mouse.c
152SRCS_NW+=	lib_move.c
153SRCS_NW+=	lib_mvwin.c
154SRCS_NW+=	lib_newterm.c
155SRCS_NW+=	lib_newwin.c
156SRCS_NW+=	lib_nl.c
157SRCS_NW+=	lib_overlay.c
158SRCS_NW+=	lib_pad.c
159SRCS_NW+=	lib_printw.c
160SRCS_NW+=	lib_redrawln.c
161SRCS_NW+=	lib_refresh.c
162SRCS_NW+=	lib_restart.c
163SRCS_NW+=	lib_scanw.c
164SRCS_NW+=	lib_screen.c
165SRCS_NW+=	lib_scroll.c
166SRCS_NW+=	lib_scrollok.c
167SRCS_NW+=	lib_scrreg.c
168SRCS_NW+=	lib_set_term.c
169SRCS_NW+=	lib_slk.c
170SRCS_NW+=	lib_slkatr_set.c
171SRCS_NW+=	lib_slkatrof.c
172SRCS_NW+=	lib_slkatron.c
173SRCS_NW+=	lib_slkatrset.c
174SRCS_NW+=	lib_slkattr.c
175SRCS_NW+=	lib_slkclear.c
176SRCS_NW+=	lib_slkcolor.c
177SRCS_NW+=	lib_slkinit.c
178SRCS_NW+=	lib_slklab.c
179SRCS_NW+=	lib_slkrefr.c
180SRCS_NW+=	lib_slkset.c
181SRCS_NW+=	lib_slktouch.c
182SRCS_NW+=	lib_touch.c
183SRCS_NW+=	lib_ungetch.c
184SRCS_NW+=	lib_vline.c
185SRCS_NW+=	lib_wattroff.c
186SRCS_NW+=	lib_wattron.c
187SRCS_NW+=	lib_winch.c
188SRCS_NW+=	lib_window.c
189SRCS_NW+=	nc_panel.c
190SRCS_NW+=	resizeterm.c
191SRCS_NW+=	safe_sprintf.c
192SRCS_NWB+=	tries.c
193SRCS_NW+=	use_window.c
194SRCS_NWB+=	version.c
195SRCS_NW+=	vsscanf.c
196SRCS_NW+=	wresize.c
197
198# Serial
199SRCS_NW+=	hardscroll.c
200SRCS_NW+=	hashmap.c
201SRCS_NW+=	lib_mvcur.c
202SRCS_NW+=	lib_tstp.c
203SRCS_NW+=	lib_twait.c
204SRCS_NW+=	lib_vidattr.c
205SRCS_NW+=	tty_update.c
206
207# Tinfo
208SRCS_NWB+=	access.c
209SRCS_NWB+=	add_tries.c
210SRCS_NWB+=	alloc_entry.c
211SRCS_NWB+=	alloc_ttype.c
212SRCS_NWB+=	captoinfo.c
213SRCS_NWB+=	comp_error.c
214SRCS_NWB+=	comp_expand.c
215SRCS_NWB+=	comp_hash.c
216SRCS_NWB+=	comp_parse.c
217SRCS_NWB+=	comp_scan.c
218SRCS_NWB+=	db_iterator.c
219SRCS_NWB+=	doalloc.c
220SRCS_NWB+=	entries.c
221SRCS_NWB+=	free_ttype.c
222SRCS_NWB+=	getenv_num.c
223SRCS_NW+=	hashed_db.c
224SRCS_NWB+=	home_terminfo.c
225SRCS_NWB+=	init_keytry.c
226SRCS_NW+=	lib_acs.c
227SRCS_NWB+=	lib_baudrate.c
228SRCS_NWB+=	lib_cur_term.c
229SRCS_NWB+=	lib_data.c
230SRCS_NWB+=	lib_has_cap.c
231SRCS_NW+=	lib_kernel.c
232SRCS_NW+=	lib_longname.c
233SRCS_NWB+=	lib_napms.c
234SRCS_NWB+=	lib_options.c
235SRCS_NW+=	lib_print.c
236SRCS_NWB+=	lib_raw.c
237SRCS_NWB+=	lib_setup.c
238SRCS_NWB+=	lib_termcap.c
239SRCS_NW+=	lib_termname.c
240SRCS_NWB+=	lib_tgoto.c
241SRCS_NWB+=	lib_ti.c
242SRCS_NWB+=	lib_tparm.c
243SRCS_NWB+=	lib_tputs.c
244SRCS_NWB+=	lib_ttyflags.c
245SRCS_NWB+=	name_match.c
246SRCS_NW+=	obsolete.c
247SRCS_NWB+=	parse_entry.c
248SRCS_NWB+=	read_entry.c
249SRCS_NWB+=	read_termcap.c
250SRCS_NWB+=	strings.c
251SRCS_NWB+=	trim_sgr0.c
252SRCS_NW+=	use_screen.c
253SRCS_NWB+=	write_entry.c
254
255# Trace
256SRCS_NWB+=	lib_trace.c
257SRCS_NWt+=	lib_traceatr.c
258SRCS_NWt+=	lib_tracebits.c
259SRCS_NWt+=	lib_tracechr.c
260SRCS_NWt+=	lib_tracedmp.c
261SRCS_NWt+=	lib_tracemse.c
262SRCS_NWt+=	trace_buf.c
263SRCS_NWt+=	trace_tries.c
264SRCS_NWt+=	trace_xnames.c
265SRCS_NWt+=	varargs.c
266SRCS_NWB+=	visbuf.c
267
268# Whidechar
269SRCS_W+=	charable.c
270SRCS_W+=	lib_add_wch.c
271SRCS_W+=	lib_box_set.c
272SRCS_W+=	lib_cchar.c
273SRCS_W+=	lib_erasewchar.c
274SRCS_W+=	lib_get_wch.c
275SRCS_W+=	lib_get_wstr.c
276SRCS_W+=	lib_hline_set.c
277SRCS_W+=	lib_in_wch.c
278SRCS_W+=	lib_in_wchnstr.c
279SRCS_W+=	lib_ins_wch.c
280SRCS_W+=	lib_inwstr.c
281SRCS_W+=	lib_key_name.c
282SRCS_W+=	lib_pecho_wchar.c
283SRCS_W+=	lib_slk_wset.c
284SRCS_W+=	lib_unget_wch.c
285SRCS_W+=	lib_vid_attr.c
286SRCS_W+=	lib_vline_set.c
287SRCS_W+=	lib_wacs.c
288SRCS_W+=	lib_wunctrl.c
289
290# Panel
291SRCS_P+=	p_above.c
292SRCS_P+=	p_below.c
293SRCS_P+=	p_bottom.c
294SRCS_P+=	p_delete.c
295SRCS_P+=	p_hidden.c
296SRCS_P+=	p_hide.c
297SRCS_P+=	p_move.c
298SRCS_P+=	p_new.c
299SRCS_P+=	p_replace.c
300SRCS_P+=	p_show.c
301SRCS_P+=	p_top.c
302SRCS_P+=	p_update.c
303SRCS_P+=	p_user.c
304SRCS_P+=	p_win.c
305# only when TRACE
306#SRCS_P+=	panel.c
307
308# Sources to compile
309.if defined(ZTIC)
310SRCS_ALL+=	${SRCS_NWB}
311.endif
312.if defined(ZTRACE)
313SRCS_ALL+=	${SRCS_NWt}
314.endif
315.if defined(ZNCURSES)
316SRCS_ALL+=	${SRCS_NWB}
317SRCS_ALL+=	${SRCS_NW}
318.endif
319.if defined(ZNCURSES) && defined(ENABLE_WIDEC)
320SRCS_ALL+=	${SRCS_W}
321.endif
322.if defined(ZPANEL)
323SRCS_ALL+=	${SRCS_P}
324.endif
325
326# Sort objects for reproducible libs
327SRCS+=	${SRCS_ALL:O}
328