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)
83 libncurses-routines = \
237 libpanel-routines = \
254 headers = curses.h eti.h form.h menu.h panel.h term.h termcap.h \
256 others = clear infocmp tic toe tput tset
257 install-bin = $(others)
260 infocmp-objs = infocmp.o dump_entry.o
261 tic-objs = tic.o dump_entry.o
262 toe-objs = toe.o dump_entry.o
264 tset-objs = tset.o dump_entry.o
265 extra-objs = $(tic-objs) $(toe-objs) $(infocmp-objs) $(clear-objs) \
266 $(tput-objs) $(tset-objs)
268 # mvcur won't compile
269 test-srcs = tctest thardscroll thashmap \
270 blue bs firework firstlast gdc hanoi hashtest knight \
271 lrtest ncurses newdemo rain tclock testaddch testcurs \
272 testscanw view worm xmas
273 mvcur-objs = mvcur.o dump_entry.o
274 tctest-objs = tctest.o
275 thardscroll-objs = thardscroll.o
276 thashmap-objs = thashmap.o hhardscroll.o
281 tabsetdir = $(datadir)/tabset
283 ifndef inst_tabsetdir
284 inst_tabsetdir = $(install_root)/$(tabsetdir)
288 terminfodir = $(datadir)/terminfo
290 ifndef inst_terminfodir
291 inst_terminfodir = $(install_root)/$(terminfodir)
295 mandir = $(prefix)/man
299 inst_mandir = $(install_root)/$(mandir)
302 CPPFLAGS += -DTERMINFO='"$(terminfodir)"' -Iinclude -Iform -Incurses \
303 -Imenu -Ipanel -Iprogs -Itest
305 ifneq ($(strip $(objpfx)),)
306 CPPFLAGS += -I$(objpfx)
309 LDLIBS-tclock = math/libm
311 tests: $(test-srcs:%=$(objpfx)%)
313 $(objpfx)mvcur.d: ncurses/lib_mvcur.c
314 $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? | \
315 sed -e 's/^lib_mvcur.o/mvcur.o/' > $@
317 $(objpfx)mvcur.o: ncurses/lib_mvcur.c
318 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $?
320 $(objpfx)tctest.d: ncurses/captoinfo.c
321 $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $? | \
322 sed -e 's/^captoinfo.o/tctest.o/' > $@
324 $(objpfx)tctest.o: ncurses/captoinfo.c
325 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DMAIN $?
327 $(objpfx)thardscroll.d: ncurses/hardscroll.c
328 $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DSCROLLDEBUG $? | \
329 sed -e 's/^hardscroll.o/thardscroll.o/' > $@
331 $(objpfx)thardscroll.o: ncurses/hardscroll.c
332 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DSCROLLDEBUG $?
334 $(objpfx)thashmap.d: ncurses/hashmap.c
335 $(CC) -M $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $? | \
336 sed -e 's/^hashmap.o/thashmap.o/' > $@
338 $(objpfx)thashmap.o: ncurses/hashmap.c
339 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $?
341 $(objpfx)hhardscroll.o: ncurses/hardscroll.c
342 $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) -DTRACE -DHASHDEBUG $?
344 $(objpfx)mvcur: $(addprefix $(objpfx),$(mvcur-objs))
345 $(objpfx)tctest: $(addprefix $(objpfx),$(tctest-objs))
346 $(objpfx)thardscroll: $(addprefix $(objpfx),$(thardscroll-objs))
347 $(objpfx)thashmap: $(addprefix $(objpfx),$(thashmap-objs))
349 $(objpfx)clear: $(addprefix $(objpfx),$(clear-objs))
350 $(objpfx)infocmp: $(addprefix $(objpfx),$(infocmp-objs))
351 $(objpfx)tic: $(addprefix $(objpfx),$(tic-objs))
352 $(objpfx)toe: $(addprefix $(objpfx),$(toe-objs))
353 $(objpfx)tput: $(addprefix $(objpfx),$(tput-objs))
354 $(objpfx)tset: $(addprefix $(objpfx),$(tset-objs))
356 ifeq ($(build-shared),yes)
357 $(others:%=$(objpfx)%): $(objpfx)libncurses.so
359 $(others:%=$(objpfx)%): $(objpfx)libncurses.a
362 $(test-srcs:%=$(objpfx)%): $(objpfx)libform.a $(objpfx)libmenu.a \
363 $(objpfx)libpanel.a $(objpfx)libncurses.a
365 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
366 # This ensures they will load libc.so for needed symbols if loaded by
367 # a statically-linked program that hasn't already loaded it.
368 $(extras:%=$(objpfx)lib%.so): $(common-objpfx)libc.so
370 subdir_install: $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a \
371 $(inst_bindir)/reset $(inst_bindir)/captoinfo
373 $(inst_libdir)/libtermcap.a $(inst_libdir)/libcurses.a: \
374 $(inst_libdir)/libncurses.a
377 $(inst_bindir)/reset: $(inst_bindir)/tset
380 $(inst_bindir)/captoinfo: $(inst_bindir)/tic
383 ifeq (yes,$(build-shared))
384 subdir_install: $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so
386 $(inst_libdir)/libtermcap.so $(inst_libdir)/libcurses.so: \
387 $(inst_libdir)/libncurses.so
391 subdir_install: $(inst_mandir)/man5/terminfo.5
393 $(inst_mandir)/man5/terminfo.5: $(objpfx)terminfo.5 $(wildcard man/*.[0-9]*)
394 $(make-target-directory)
395 sh $(edit_man-sh) $(prefix) $(inst_mandir) $(edit_man-sed) $^
397 subdir_install: $(inst_tabsetdir)/std
399 $(inst_tabsetdir)/std: \
400 $(filter-out misc/tabset/CVS, $(wildcard misc/tabset/*))
401 $(make-target-directory)
403 echo installing $$f; \
404 $(INSTALL_DATA) $$f $(inst_tabsetdir); \
408 ifeq (no,$(cross-compiling))
409 subdir_install: $(inst_terminfodir)/v/vt100
411 $(inst_terminfodir)/v/vt100: misc/terminfo.src $(objpfx)tic
412 $(make-target-directory)
413 sh $(run_tic-sh) $(common-objpfx) misc $(terminfodir) \
417 subdir_distclean subdir_realclean:
418 -rm -f $(addprefix $(objpfx), MKterm.h.awk codes.c \
419 comp_captab.c confdefs.h config.log curses.h \
420 expanded.c fallback.c hashsize.h keys.tries \
421 lib_gen.c lib_keyname.c names.c ncurses_cfg.h \
422 nomacros.h parametrized.h term.h termcap.h \
423 terminfo.5 termsort.c unctrl.c unctrl.h)