xref: /dragonfly/lib/libncurses/Makefile.sources (revision 26abf81d25b288cf3df0b6b041a85af68a3a9316)
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+= new_pair.c
191SRCS_NW+= resizeterm.c
192SRCS_NW+= safe_sprintf.c
193SRCS_NWB+=          tries.c
194SRCS_NW+= use_window.c
195SRCS_NWB+=          version.c
196SRCS_NW+= vsscanf.c
197SRCS_NW+= wresize.c
198
199# Serial
200SRCS_NW+= hardscroll.c
201SRCS_NW+= hashmap.c
202SRCS_NW+= lib_mvcur.c
203SRCS_NW+= lib_tstp.c
204SRCS_NW+= lib_twait.c
205SRCS_NW+= lib_vidattr.c
206SRCS_NW+= tty_update.c
207
208# Tinfo
209SRCS_NWB+=          access.c
210SRCS_NWB+=          add_tries.c
211SRCS_NWB+=          alloc_entry.c
212SRCS_NWB+=          alloc_ttype.c
213SRCS_NWB+=          captoinfo.c
214SRCS_NWB+=          comp_error.c
215SRCS_NWB+=          comp_expand.c
216SRCS_NWB+=          comp_hash.c
217SRCS_NWB+=          comp_parse.c
218SRCS_NWB+=          comp_scan.c
219SRCS_NWB+=          comp_userdefs.c
220SRCS_NWB+=          db_iterator.c
221SRCS_NWB+=          doalloc.c
222SRCS_NWB+=          entries.c
223SRCS_NWB+=          free_ttype.c
224SRCS_NWB+=          getenv_num.c
225SRCS_NW+= hashed_db.c
226SRCS_NWB+=          home_terminfo.c
227SRCS_NWB+=          init_keytry.c
228SRCS_NW+= lib_acs.c
229SRCS_NWB+=          lib_baudrate.c
230SRCS_NWB+=          lib_cur_term.c
231SRCS_NWB+=          lib_data.c
232SRCS_NWB+=          lib_has_cap.c
233SRCS_NW+= lib_kernel.c
234SRCS_NW+= lib_longname.c
235SRCS_NWB+=          lib_napms.c
236SRCS_NWB+=          lib_options.c
237SRCS_NW+= lib_print.c
238SRCS_NWB+=          lib_raw.c
239SRCS_NWB+=          lib_setup.c
240SRCS_NWB+=          lib_termcap.c
241SRCS_NW+= lib_termname.c
242SRCS_NWB+=          lib_tgoto.c
243SRCS_NWB+=          lib_ti.c
244SRCS_NWB+=          lib_tparm.c
245SRCS_NWB+=          lib_tputs.c
246SRCS_NWB+=          lib_ttyflags.c
247SRCS_NWB+=          name_match.c
248SRCS_NW+= obsolete.c
249SRCS_NWB+=          parse_entry.c
250SRCS_NWB+=          read_entry.c
251SRCS_NWB+=          read_termcap.c
252SRCS_NWB+=          strings.c
253SRCS_NWB+=          trim_sgr0.c
254SRCS_NW+= use_screen.c
255SRCS_NWB+=          write_entry.c
256
257# Trace
258SRCS_NWB+=          lib_trace.c
259SRCS_NWt+=          lib_traceatr.c
260SRCS_NWt+=          lib_tracebits.c
261SRCS_NWt+=          lib_tracechr.c
262SRCS_NWt+=          lib_tracedmp.c
263SRCS_NWt+=          lib_tracemse.c
264SRCS_NWt+=          trace_buf.c
265SRCS_NWt+=          trace_tries.c
266SRCS_NWt+=          trace_xnames.c
267SRCS_NWt+=          varargs.c
268SRCS_NWB+=          visbuf.c
269
270# Widechar
271SRCS_W+=  charable.c
272SRCS_W+=  lib_add_wch.c
273SRCS_W+=  lib_box_set.c
274SRCS_W+=  lib_cchar.c
275SRCS_W+=  lib_erasewchar.c
276SRCS_W+=  lib_get_wch.c
277SRCS_W+=  lib_get_wstr.c
278SRCS_W+=  lib_hline_set.c
279SRCS_W+=  lib_in_wch.c
280SRCS_W+=  lib_in_wchnstr.c
281SRCS_W+=  lib_ins_wch.c
282SRCS_W+=  lib_inwstr.c
283SRCS_W+=  lib_key_name.c
284SRCS_W+=  lib_pecho_wchar.c
285SRCS_W+=  lib_slk_wset.c
286SRCS_W+=  lib_unget_wch.c
287SRCS_W+=  lib_vid_attr.c
288SRCS_W+=  lib_vline_set.c
289SRCS_W+=  lib_wacs.c
290SRCS_W+=  lib_wunctrl.c
291
292# Panel
293SRCS_P+=  p_above.c
294SRCS_P+=  p_below.c
295SRCS_P+=  p_bottom.c
296SRCS_P+=  p_delete.c
297SRCS_P+=  p_hidden.c
298SRCS_P+=  p_hide.c
299SRCS_P+=  p_move.c
300SRCS_P+=  p_new.c
301SRCS_P+=  p_replace.c
302SRCS_P+=  p_show.c
303SRCS_P+=  p_top.c
304SRCS_P+=  p_update.c
305SRCS_P+=  p_user.c
306SRCS_P+=  p_win.c
307# only when TRACE
308#SRCS_P+= panel.c
309
310# Sources to compile
311.if defined(ZTIC)
312SRCS_ALL+=          ${SRCS_NWB}
313.endif
314.if defined(ZTRACE)
315SRCS_ALL+=          ${SRCS_NWt}
316.endif
317.if defined(ZNCURSES)
318SRCS_ALL+=          ${SRCS_NWB}
319SRCS_ALL+=          ${SRCS_NW}
320.endif
321.if defined(ZNCURSES) && defined(ENABLE_WIDEC)
322SRCS_ALL+=          ${SRCS_W}
323.endif
324.if defined(ZPANEL)
325SRCS_ALL+=          ${SRCS_P}
326.endif
327
328# Sort objects for reproducible libs
329SRCS+=    ${SRCS_ALL:O}
330