ncurses: Fix parallel buildworld race.
[dragonfly.git] / lib / libncurses / libncurses / Makefile
blob570ed7b9f0bad74789f77351154242fc96671dcf
1 LIB= private_ncurses${LIB_SUFFIX}
2 PRIVATELIB=
4 SHLIBDIR?= /lib
6 NCURSESBASEDIR= ${NCURSESDIR}/ncurses/base
7 NCURSESSERIALDIR= ${NCURSESDIR}/ncurses/tty
8 NCURSESTINFODIR= ${NCURSESDIR}/ncurses/tinfo
10 ZNCURSES= yes
11 CFLAGS+= -DTRACE
12 CFLAGS+= -DDRAGONFLY_NATIVE
14 GENHDRS= \
15 curses.h \
16 hashsize.h \
17 init_keytry.h \
18 ncurses_def.h \
19 parametrized.h \
20 term.h
22 GENSRCS= \
23 codes.c \
24 comp_captab.c \
25 expanded.c \
26 fallback.c \
27 lib_gen.c \
28 lib_keyname.c \
29 names.c \
30 unctrl.c
32 HEADERS= curses.h term.h termcap.h unctrl.h
33 SRCHDRS= ncurses_dll.h
35 term.h: MKterm.h.awk edit_cfg.sh Caps
36 awk -f ${.CURDIR}/../include/MKterm.h.awk ${TERMINFO_CAPS} > ${.TARGET}.new
37 sh ${NCURSESDIR}/include/edit_cfg.sh ${.CURDIR}/../include/ncurses_cfg.h ${.TARGET}.new
38 mv -f ${.TARGET}.new ${.TARGET}
40 hashsize.h: MKhashsize.sh Caps
41 sh ${NCURSESDIR}/include/MKhashsize.sh ${TERMINFO_CAPS} > ${.TARGET}
43 parametrized.h: MKparametrized.sh Caps
44 sh ${NCURSESDIR}/include/MKparametrized.sh ${TERMINFO_CAPS} > ${.TARGET}
46 init_keytry.h: make_keys keys.list
47 ./make_keys keys.list > ${.TARGET}
49 make_keys: make_keys.c names.c ncurses_def.h ${VERSION_MAP} ${HEADERS}
50 ${NXCC} ${NXCFLAGS} -static ${NCURSESTINFODIR}/make_keys.c ${NXLDLIBS} -o ${.TARGET}
52 keys.list: MKkeys_list.sh Caps
53 sh ${NCURSESTINFODIR}/MKkeys_list.sh ${TERMINFO_CAPS} | LC_ALL=C sort > ${.TARGET}
55 names.c: MKnames.awk Caps
56 awk -f ${NCURSESTINFODIR}/MKnames.awk bigstrings=1 ${TERMINFO_CAPS} > ${.TARGET}
58 codes.c: MKcodes.awk Caps
59 awk -f ${NCURSESTINFODIR}/MKcodes.awk bigstrings=1 ${TERMINFO_CAPS} > ${.TARGET}
61 comp_captab.c: make_hash MKcaptab.sh MKcaptab.awk Caps
62 sh -e ${NCURSESTINFODIR}/MKcaptab.sh awk 1 ${NCURSESTINFODIR}/MKcaptab.awk ${TERMINFO_CAPS} > ${.TARGET}
64 make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS}
65 ${NXCC} ${NXCFLAGS} -static -DMAIN_PROGRAM ${NXLDLIBS} -o ${.TARGET} ${NCURSESTINFODIR}/make_hash.c
67 expanded.c: MKexpanded.sh ${GENHDRS}
68 sh ${NCURSESSERIALDIR}/MKexpanded.sh "${CC}" -E ${CFLAGS} > ${.TARGET}
70 fallback.c: MKfallback.sh
71 sh ${NCURSESTINFODIR}/MKfallback.sh /usr/share/terminfo ${NCURSESDIR}/misc/terminfo.src > ${.TARGET}
73 lib_gen.c: MKlib_gen.sh curses.h
74 sh ${NCURSESBASEDIR}/MKlib_gen.sh "${CC} -E ${CFLAGS}" awk generated <curses.h > ${.TARGET}
76 lib_keyname.c: MKkeyname.awk keys.list
77 awk -f ${NCURSESBASEDIR}/MKkeyname.awk bigstrings=1 keys.list > ${.TARGET}
79 unctrl.c: MKunctrl.awk
80 echo | awk -f ${NCURSESBASEDIR}/MKunctrl.awk bigstrings=1 > ${.TARGET}
82 CLEANFILES= ${GENSRCS} ${GENHDRS} term.h.new curses.h.new
83 CLEANFILES+= make_keys make_hash keys.list
85 # Base
86 SRCS= define_key.c \
87 key_defined.c \
88 keybound.c \
89 keyok.c \
90 legacy_coding.c \
91 lib_addch.c \
92 lib_addstr.c \
93 lib_beep.c \
94 lib_bkgd.c \
95 lib_box.c \
96 lib_chgat.c \
97 lib_clear.c \
98 lib_clearok.c \
99 lib_clrbot.c \
100 lib_clreol.c \
101 lib_color.c \
102 lib_colorset.c \
103 lib_delch.c \
104 lib_delwin.c \
105 lib_dft_fgbg.c \
106 lib_echo.c \
107 lib_endwin.c \
108 lib_erase.c \
109 lib_flash.c \
110 lib_freeall.c \
111 lib_getch.c \
112 lib_getstr.c \
113 lib_hline.c \
114 lib_immedok.c \
115 lib_inchstr.c \
116 lib_initscr.c \
117 lib_insch.c \
118 lib_insdel.c \
119 lib_insnstr.c \
120 lib_instr.c \
121 lib_isendwin.c \
122 lib_leaveok.c \
123 lib_mouse.c \
124 lib_move.c \
125 lib_mvwin.c \
126 lib_newterm.c \
127 lib_newwin.c \
128 lib_nl.c \
129 lib_overlay.c \
130 lib_pad.c \
131 lib_printw.c \
132 lib_redrawln.c \
133 lib_refresh.c \
134 lib_restart.c \
135 lib_scanw.c \
136 lib_screen.c \
137 lib_scroll.c \
138 lib_scrollok.c \
139 lib_scrreg.c \
140 lib_set_term.c \
141 lib_slk.c \
142 lib_slkatr_set.c \
143 lib_slkatrof.c \
144 lib_slkatron.c \
145 lib_slkatrset.c \
146 lib_slkattr.c \
147 lib_slkclear.c \
148 lib_slkcolor.c \
149 lib_slkinit.c \
150 lib_slklab.c \
151 lib_slkrefr.c \
152 lib_slkset.c \
153 lib_slktouch.c \
154 lib_touch.c \
155 lib_ungetch.c \
156 lib_vline.c \
157 lib_wattroff.c \
158 lib_wattron.c \
159 lib_winch.c \
160 lib_window.c \
161 nc_panel.c \
162 resizeterm.c \
163 safe_sprintf.c \
164 tries.c \
165 use_window.c \
166 version.c \
167 vsscanf.c \
168 wresize.c
170 # Serial
171 SRCS+= hardscroll.c \
172 hashmap.c \
173 lib_mvcur.c \
174 lib_tstp.c \
175 lib_twait.c \
176 lib_vidattr.c \
177 tty_update.c
179 # Tinfo
180 SRCS+= access.c \
181 add_tries.c \
182 alloc_entry.c \
183 alloc_ttype.c \
184 captoinfo.c \
185 comp_error.c \
186 comp_expand.c \
187 comp_hash.c \
188 comp_parse.c \
189 comp_scan.c \
190 db_iterator.c \
191 doalloc.c \
192 entries.c \
193 free_ttype.c \
194 getenv_num.c \
195 hashed_db.c \
196 home_terminfo.c \
197 init_keytry.c \
198 lib_acs.c \
199 lib_baudrate.c \
200 lib_cur_term.c \
201 lib_data.c \
202 lib_has_cap.c \
203 lib_kernel.c \
204 lib_longname.c \
205 lib_napms.c \
206 lib_options.c \
207 lib_print.c \
208 lib_raw.c \
209 lib_setup.c \
210 lib_termcap.c \
211 lib_termname.c \
212 lib_tgoto.c \
213 lib_ti.c \
214 lib_tparm.c \
215 lib_tputs.c \
216 lib_ttyflags.c \
217 name_match.c \
218 obsolete.c \
219 parse_entry.c \
220 read_entry.c \
221 read_termcap.c \
222 strings.c \
223 trim_sgr0.c \
224 use_screen.c \
225 write_entry.c
227 # Trace
228 SRCS+= lib_trace.c \
229 lib_traceatr.c \
230 lib_tracebits.c \
231 lib_tracechr.c \
232 lib_tracedmp.c \
233 lib_tracemse.c \
234 trace_buf.c \
235 trace_tries.c \
236 trace_xnames.c \
237 varargs.c \
238 visbuf.c \
240 # Generated
241 SRCS+= ${GENSRCS} ${GENHDRS}
243 NCSTATIC= libprivate_ncurses${LIB_SUFFIX}.a
244 NCDYN= libprivate_ncurses${LIB_SUFFIX}.so
246 .if defined(ENABLE_WIDEC)
247 INCS= ${HEADERS} ${SRCHDRS}
248 INCSDIR= ${INCLUDEDIR}/priv/ncurses
249 INCSLINKS= curses.h ${INCLUDEDIR}/priv/ncurses/ncurses.h
251 SRCS+= charable.c \
252 lib_add_wch.c \
253 lib_box_set.c \
254 lib_cchar.c \
255 lib_erasewchar.c \
256 lib_get_wch.c \
257 lib_get_wstr.c \
258 lib_hline_set.c \
259 lib_in_wch.c \
260 lib_in_wchnstr.c \
261 lib_ins_wch.c \
262 lib_inwstr.c \
263 lib_key_name.c \
264 lib_pecho_wchar.c \
265 lib_slk_wset.c \
266 lib_unget_wch.c \
267 lib_vid_attr.c \
268 lib_vline_set.c \
269 lib_wacs.c \
270 lib_wunctrl.c
271 .endif
273 .include <bsd.lib.mk>