1 # Copyright (C) 1997,1998 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)
82 libncurses-routines = \
137 base/lib_slkatr_set \
184 tinfo/home_terminfo \
212 trace/lib_tracebits \
256 libpanel-routines = \
273 headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \
275 others = clear infocmp tic toe tput tset
276 install-bin = $(others)
279 infocmp-objs = infocmp.o dump_entry.o
280 tic-objs = tic.o dump_entry.o
281 toe-objs = toe.o dump_entry.o
283 tset-objs = tset.o dump_entry.o
284 extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \
285 $(tput-objs) $(tset-objs)
287 test-srcs = blue bs cardfile ditto firework firstlast gdc hanoi hashtest knight \
288 lrtest ncurses newdemo rain tclock testaddch testcurs \
289 testscanw view worm xmas
294 tabsetdir = $(datadir)/tabset
296 ifndef inst_tabsetdir
297 inst_tabsetdir = $(install_root)/$(tabsetdir)
301 terminfodir = $(datadir)/terminfo
303 ifndef inst_terminfodir
304 inst_terminfodir = $(install_root)/$(terminfodir)
308 mandir = $(prefix)/man
312 inst_mandir = $(install_root)/$(mandir)
315 CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Iform -Incurses \
316 -Imenu -Ipanel -Iprogs -Itest
318 ifneq ($(strip $(objpfx)),)
319 CPPFLAGS += -I$(objpfx)
322 LDLIBS-tclock = math/libm
324 tests: $(test-srcs:%=$(objpfx)%)
326 $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs))
327 $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs))
328 $(objpfx)tic: $(addprefix $(objpfx),$(tic-objs))
329 $(objpfx)toe: $(addprefix $(objpfx),$(toe-objs))
330 $(objpfx)tput: $(addprefix $(objpfx),$(tput-objs))
331 $(objpfx)tset: $(addprefix $(objpfx),$(tset-objs))
333 ifeq ($(build-shared),yes)
334 $(others:%=$(objpfx)%): $(objpfx)libncurses.so
336 $(others:%=$(objpfx)%): $(objpfx)libncurses.a
339 $(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \
340 $(objpfx)libpanel.a $(objpfx)libncurses.a
342 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
343 # This ensures they will load libc.so for needed symbols if loaded by
344 # a statically-linked program that hasn't already loaded it.
345 $(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so
347 subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a \
348 $(inst_bindir)/reset $(inst_bindir)/captoinfo
350 $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \
351 $(inst_libdir)/libncurses.a
354 $(inst_bindir)/reset: $(inst_bindir)/tset
357 $(inst_bindir)/captoinfo: $(inst_bindir)/tic
360 ifeq (yes,$(build-shared))
361 subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so
363 $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \
364 $(inst_libdir)/libncurses.so
368 subdir_install: $(inst_mandir)/man5/terminfo.5
370 $(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*)
371 $(make-target-directory)
372 sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^
374 subdir_install: $(inst_tabsetdir)/std
376 $(inst_tabsetdir)/std: \
377 $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*))
378 $(make-target-directory)
380 echo installing $$f; \
381 $(INSTALL_DATA) $$f $(inst_tabsetdir); \
385 ifeq (no,$(cross-compiling))
386 subdir_install: $(inst_terminfodir)/v/vt100
388 $(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic
389 $(make-target-directory)
390 sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \
394 subdir_distclean subdir_realclean:
395 -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \
396 comp_captab.c confdefs.h config.log curses.h \
397 expanded.c fallback.c hashsize.h keys.tries \
398 lib_gen.c lib_keyname.c names.c ncurses_cfg.h \
399 nomacros.h parametrized.h term.h termcap.h \
400 terminfo.5 termsort.c unctrl.c unctrl.h)