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