1 # Copyright (C) 1997 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
20 # Makefile for ncurses part.
25 form-version = $(ncurses-version)
26 menu-version = $(ncurses-version)
27 panel-version = $(ncurses-version)
29 extras := form menu ncurses panel
31 extra-libs = $(extras:%=lib%)
32 # These libraries will be built in the `others' pass rather than
33 # the `lib' pass, because they depend on libc.so being built already.
34 extra-libs-others = $(extra-libs)
36 # The sources are found in the appropriate subdir.
37 subdir-dirs = $(extras) progs test
38 vpath %.c $(subdir-dirs)
39 vpath %.h $(subdir-dirs)
41 libform-routines = fld_def fld_stat fld_type fld_user \
42 frm_adabind frm_data frm_def \
43 frm_driver frm_hook frm_opts \
44 frm_req_name frm_user frm_win \
45 fty_alnum fty_alpha fty_enum fty_int \
46 fty_ipv4 fty_num fty_regex
48 libncurses-routines = alloc_entry captoinfo comp_error comp_hash \
49 comp_parse comp_scan hardscroll \
50 hashmap lib_acs lib_adabind lib_addch \
51 lib_addstr lib_baudrate \
52 lib_beep lib_bkgd lib_box lib_clear \
53 lib_clrbot lib_clreol lib_color \
54 lib_data lib_delch lib_delwin \
55 lib_dft_fgbg lib_doupdate lib_endwin \
56 lib_erase lib_freeall lib_getch \
57 lib_getstr lib_inchstr lib_initscr \
58 lib_insch lib_insdel lib_insstr \
59 lib_instr lib_isendwin lib_kernel \
60 lib_longname lib_mouse lib_move \
61 lib_mvcur lib_mvwin lib_newterm \
62 lib_newwin lib_options lib_overlay \
63 lib_pad lib_print lib_printw lib_raw \
64 lib_refresh lib_restart lib_scanw \
65 lib_screen lib_scroll lib_scrreg \
66 lib_set_term lib_setup lib_slk \
67 lib_termcap lib_ti lib_touch \
68 lib_tparm lib_tputs lib_trace \
69 lib_traceatr lib_tracechr \
70 lib_tracedmp lib_tracemse lib_tstp \
71 lib_twait lib_vidattr \
72 lib_window names parse_entry \
73 read_entry read_termcap resizeterm \
75 codes comp_captab expanded fallback \
76 lib_gen names lib_keyname unctrl
78 libmenu-routines = m_adabind m_attribs m_cursor m_driver \
79 m_format m_global m_hook m_item_cur \
80 m_item_nam m_item_new m_item_opt \
81 m_item_use m_item_val m_item_vis \
82 m_items m_new m_opts m_post \
83 m_req_name m_spacing m_userptr m_win
85 libpanel-routines = panel
87 headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \
89 others = clear infocmp tic toe tput tset
90 install-bin = $(others)
93 infocmp-objs = infocmp.o dump_entry.o
94 tic-objs = tic.o dump_entry.o
95 toe-objs = toe.o dump_entry.o
97 tset-objs = tset.o dump_entry.o
98 extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \
99 $(tput-objs) $(tset-objs)
101 # mvcur won't compile
102 test-srcs = tctest thardscroll thashmap \
103 blue bs firework gdc hanoi hashtest knight lrtest \
104 ncurses newdemo rain tclock testcurs view worm xmas
105 mvcur-objs = mvcur.o dump_entry.o
106 tctest-objs = tctest.o
107 thardscroll-objs = thardscroll.o
108 thashmap-objs = thashmap.o hhardscroll.o
113 tabsetdir = $(datadir)/tabset
115 ifndef inst_tabsetdir
116 inst_tabsetdir = $(install_root)/$(tabsetdir)
120 terminfodir = $(datadir)/terminfo
122 ifndef inst_terminfodir
123 inst_terminfodir = $(install_root)/$(terminfodir)
127 mandir = $(prefix)/man
131 inst_mandir = $(install_root)/$(mandir)
134 CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Incurses \
135 -Imenu -Iprogs -Itest -I$(objpfx)
137 $(objpfx)mvcur.o: ncurses/lib_mvcur.c
138 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $?
140 $(objpfx)tctest.o: ncurses/captoinfo.c
141 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $?
143 $(objpfx)thardscroll.o: ncurses/hardscroll.c
144 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DSCROLLDEBUG $?
146 $(objpfx)thashmap.o: ncurses/hashmap.c
147 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $?
149 $(objpfx)hhardscroll.o: ncurses/hardscroll.c
150 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $?
152 $(objpfx)mvcur: $(addprefix $(objpfx),$(mvcur-objs))
153 $(objpfx)tctest: $(addprefix $(objpfx),$(tctest-objs))
154 $(objpfx)thardscroll: $(addprefix $(objpfx),$(thardscroll-objs))
155 $(objpfx)thashmap: $(addprefix $(objpfx),$(thashmap-objs))
157 $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs))
158 $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs))
159 $(objpfx)tic: $(addprefix $(objpfx),$(tic-objs))
160 $(objpfx)toe: $(addprefix $(objpfx),$(toe-objs))
161 $(objpfx)tput: $(addprefix $(objpfx),$(tput-objs))
162 $(objpfx)tset: $(addprefix $(objpfx),$(tset-objs))
164 ifeq ($(build-shared),yes)
165 $(others:%=$(objpfx)%): $(objpfx)libncurses.so
167 $(others:%=$(objpfx)%): $(objpfx)libncurses.a
170 $(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \
171 $(objpfx)libpanel.a $(objpfx)libncurses.a
173 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
174 # This ensures they will load libc.so for needed symbols if loaded by
175 # a statically-linked program that hasn't already loaded it.
176 $(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so
178 subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a
180 $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \
181 $(inst_libdir)/libncurses.a
184 ifeq (yes,$(build-shared))
185 subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so
187 $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \
188 $(inst_libdir)/libncurses.so
192 subdir_install: $(inst_mandir)/man5/terminfo.5
194 $(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*)
195 $(make-target-directory)
196 sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^
198 subdir_install: $(inst_tabsetdir)/std
200 $(inst_tabsetdir)/std: \
201 $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*))
202 $(make-target-directory)
204 echo installing $$f; \
205 $(INSTALL_DATA) $$f $(inst_tabsetdir); \
209 ifeq (no,$(cross-compiling))
210 subdir_install: $(inst_terminfodir)/v/vt100
212 $(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic
213 $(make-target-directory)
214 sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \
218 subdir_distclean subdir_realclean:
219 -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \
220 comp_captab.c confdefs.h config.log curses.h \
221 expanded.c fallback.c hashsize.h keys.tries \
222 lib_gen.c lib_keyname.c names.c ncurses_cfg.h \
223 nomacros.h parametrized.h term.h termcap.h \
224 terminfo.5 termsort.c unctrl.c unctrl.h)