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