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 \
185 tinfo/home_terminfo \
215 trace/lib_tracebits \
259 libpanel-routines = \
276 headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \
278 others = clear infocmp tic toe tput tset
279 install-bin = $(others)
282 infocmp-objs = infocmp.o dump_entry.o
283 tic-objs = tic.o dump_entry.o
284 toe-objs = toe.o dump_entry.o
286 tset-objs = tset.o dump_entry.o
287 extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \
288 $(tput-objs) $(tset-objs)
290 test-srcs = blue bs cardfile ditto firework firstlast gdc hanoi hashtest knight \
291 lrtest ncurses newdemo rain tclock testaddch testcurs \
292 testscanw view worm xmas
297 tabsetdir = $(datadir)/tabset
299 ifndef inst_tabsetdir
300 inst_tabsetdir = $(install_root)/$(tabsetdir)
304 terminfodir = $(datadir)/terminfo
306 ifndef inst_terminfodir
307 inst_terminfodir = $(install_root)/$(terminfodir)
311 mandir = $(prefix)/man
315 inst_mandir = $(install_root)/$(mandir)
318 CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Iform -Incurses \
319 -Imenu -Ipanel -Iprogs -Itest
321 ifneq ($(strip $(objpfx)),)
322 CPPFLAGS += -I$(objpfx)
325 LDLIBS-tclock = math/libm
327 tests: $(test-srcs:%=$(objpfx)%)
329 $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs))
330 $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs))
331 $(objpfx)tic: $(addprefix $(objpfx),$(tic-objs))
332 $(objpfx)toe: $(addprefix $(objpfx),$(toe-objs))
333 $(objpfx)tput: $(addprefix $(objpfx),$(tput-objs))
334 $(objpfx)tset: $(addprefix $(objpfx),$(tset-objs))
336 ifeq ($(build-shared),yes)
337 $(others:%=$(objpfx)%): $(objpfx)libncurses.so
339 $(others:%=$(objpfx)%): $(objpfx)libncurses.a
342 $(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \
343 $(objpfx)libpanel.a $(objpfx)libncurses.a
345 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
346 # This ensures they will load libc.so for needed symbols if loaded by
347 # a statically-linked program that hasn't already loaded it.
348 $(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so
350 subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a \
351 $(inst_bindir)/reset $(inst_bindir)/captoinfo
353 $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \
354 $(inst_libdir)/libncurses.a
357 $(inst_bindir)/reset: $(inst_bindir)/tset
360 $(inst_bindir)/captoinfo: $(inst_bindir)/tic
363 ifeq (yes,$(build-shared))
364 subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so
366 $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \
367 $(inst_libdir)/libncurses.so
371 subdir_install: $(inst_mandir)/man5/terminfo.5
373 $(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*)
374 $(make-target-directory)
375 sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^
377 subdir_install: $(inst_tabsetdir)/std
379 $(inst_tabsetdir)/std: \
380 $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*))
381 $(make-target-directory)
383 echo installing $$f; \
384 $(INSTALL_DATA) $$f $(inst_tabsetdir); \
388 ifeq (no,$(cross-compiling))
389 subdir_install: $(inst_terminfodir)/v/vt100
391 $(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic
392 $(make-target-directory)
393 sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \
397 subdir_distclean subdir_realclean:
398 -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \
399 comp_captab.c confdefs.h config.log curses.h \
400 expanded.c fallback.c hashsize.h keys.tries \
401 lib_gen.c lib_keyname.c names.c ncurses_cfg.h \
402 nomacros.h parametrized.h term.h termcap.h \
403 terminfo.5 termsort.c unctrl.c unctrl.h)