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 \
213 trace/lib_tracebits \
257 libpanel-routines = \
274 headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \
276 others = clear infocmp tic toe tput tset
277 install-bin = $(others)
280 infocmp-objs = infocmp.o dump_entry.o
281 tic-objs = tic.o dump_entry.o
282 toe-objs = toe.o dump_entry.o
284 tset-objs = tset.o dump_entry.o
285 extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \
286 $(tput-objs) $(tset-objs)
288 test-srcs = blue bs cardfile ditto firework firstlast gdc hanoi hashtest knight \
289 lrtest ncurses newdemo rain tclock testaddch testcurs \
290 testscanw view worm xmas
295 tabsetdir = $(datadir)/tabset
297 ifndef inst_tabsetdir
298 inst_tabsetdir = $(install_root)/$(tabsetdir)
302 terminfodir = $(datadir)/terminfo
304 ifndef inst_terminfodir
305 inst_terminfodir = $(install_root)/$(terminfodir)
309 mandir = $(prefix)/man
313 inst_mandir = $(install_root)/$(mandir)
316 CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Iform -Incurses \
317 -Imenu -Ipanel -Iprogs -Itest
319 ifneq ($(strip $(objpfx)),)
320 CPPFLAGS += -I$(objpfx)
323 LDLIBS-tclock = math/libm
325 tests: $(test-srcs:%=$(objpfx)%)
327 $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs))
328 $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs))
329 $(objpfx)tic: $(addprefix $(objpfx),$(tic-objs))
330 $(objpfx)toe: $(addprefix $(objpfx),$(toe-objs))
331 $(objpfx)tput: $(addprefix $(objpfx),$(tput-objs))
332 $(objpfx)tset: $(addprefix $(objpfx),$(tset-objs))
334 ifeq ($(build-shared),yes)
335 $(others:%=$(objpfx)%): $(objpfx)libncurses.so
337 $(others:%=$(objpfx)%): $(objpfx)libncurses.a
340 $(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \
341 $(objpfx)libpanel.a $(objpfx)libncurses.a
343 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
344 # This ensures they will load libc.so for needed symbols if loaded by
345 # a statically-linked program that hasn't already loaded it.
346 $(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so
348 subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a \
349 $(inst_bindir)/reset $(inst_bindir)/captoinfo
351 $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \
352 $(inst_libdir)/libncurses.a
355 $(inst_bindir)/reset: $(inst_bindir)/tset
358 $(inst_bindir)/captoinfo: $(inst_bindir)/tic
361 ifeq (yes,$(build-shared))
362 subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so
364 $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \
365 $(inst_libdir)/libncurses.so
369 subdir_install: $(inst_mandir)/man5/terminfo.5
371 $(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*)
372 $(make-target-directory)
373 sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^
375 subdir_install: $(inst_tabsetdir)/std
377 $(inst_tabsetdir)/std: \
378 $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*))
379 $(make-target-directory)
381 echo installing $$f; \
382 $(INSTALL_DATA) $$f $(inst_tabsetdir); \
386 ifeq (no,$(cross-compiling))
387 subdir_install: $(inst_terminfodir)/v/vt100
389 $(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic
390 $(make-target-directory)
391 sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \
395 subdir_distclean subdir_realclean:
396 -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \
397 comp_captab.c confdefs.h config.log curses.h \
398 expanded.c fallback.c hashsize.h keys.tries \
399 lib_gen.c lib_keyname.c names.c ncurses_cfg.h \
400 nomacros.h parametrized.h term.h termcap.h \
401 terminfo.5 termsort.c unctrl.c unctrl.h)