ncurses 5.6 - patch 20070428
[ncurses.git] / progs / Makefile.in
index a0a296ef935b47f1832945b82aa57c272c89de01..a7602ab9535f56f51e5a661f6f527435e5c3117d 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.41 2000/07/08 01:56:25 tom Exp $
+# $Id: Makefile.in,v 1.74 2007/04/28 15:47:19 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2000 Free Software Foundation, Inc.                     #
+# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -27,7 +27,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+# Author: Thomas E. Dickey 1996-on
 #
 # Makefile for ncurses source code.
 #
@@ -47,10 +47,13 @@ THIS                = Makefile
 
 CF_MFLAGS      = @cf_cv_makeflags@
 @SET_MAKE@
-x              = @PROG_EXT@
+
+x              = @EXEEXT@
+o              = .@OBJEXT@
 
 MODEL          = ../@DFT_OBJ_SUBDIR@
-INSTALL_PREFIX = @INSTALL_PREFIX@
+DESTDIR                = @DESTDIR@
+top_srcdir     = @top_srcdir@
 srcdir         = @srcdir@
 prefix         = @prefix@
 exec_prefix    = @exec_prefix@
@@ -59,10 +62,16 @@ libdir              = @libdir@
 includedir     = @includedir@
 datadir                = @datadir@
 
-ticdir         = $(datadir)/terminfo
+LIBTOOL                = @LIBTOOL@
+LIBTOOL_CLEAN  = @LIB_CLEAN@
+LIBTOOL_COMPILE        = @LIB_COMPILE@
+LIBTOOL_LINK   = @LIB_LINK@
+LIBTOOL_INSTALL        = @LIB_INSTALL@
+LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
 
 INSTALL                = @INSTALL@
-INSTALL_PROGRAM        = @INSTALL_PROGRAM@
+INSTALL_PROG   = @INSTALL_PROGRAM@
+transform      = @program_transform_name@
 
 AWK            = @AWK@
 LN_S           = @LN_S@
@@ -71,12 +80,12 @@ CC          = @CC@
 CPP            = @CPP@
 CFLAGS         = @CFLAGS@
 
-INCDIR         = $(srcdir)/../include
-CPPFLAGS       = -I../progs -I$(srcdir) @CPPFLAGS@ \
-                 -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
+INCDIR         = $(top_srcdir)/include
+CPPFLAGS       = -I../progs -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
 
 CCFLAGS                = $(CPPFLAGS) $(CFLAGS)
 
+CFLAGS_LIBTOOL = $(CCFLAGS)
 CFLAGS_NORMAL  = $(CCFLAGS)
 CFLAGS_DEBUG   = $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -84,15 +93,19 @@ CFLAGS_SHARED       = $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
 
+REL_VERSION    = @cf_cv_rel_version@
+ABI_VERSION    = @cf_cv_abi_version@
+LOCAL_LIBDIR   = @top_builddir@/lib
+
 LD             = @LD@
-LINK           = @LINK_PROGS@ $(CC)
-LDFLAGS                = @EXTRA_LDFLAGS@ \
-               @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
+LINK           = @LINK_PROGS@ $(LIBTOOL_LINK)
+LDFLAGS                = @EXTRA_LDFLAGS@ @LDFLAGS_STATIC@ @TICS_ARGS@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LDFLAGS@ @LD_MODEL@ @LIBS@
 
-LDFLAGS_NORMAL = $(LDFLAGS)
-LDFLAGS_DEBUG  = $(LDFLAGS) @CC_G_OPT@
-LDFLAGS_PROFILE        = $(LDFLAGS) -pg
-LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@
+LDFLAGS_LIBTOOL        = $(LDFLAGS) $(CFLAGS_LIBTOOL)
+LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL)
+LDFLAGS_DEBUG  = $(LDFLAGS) $(CFLAGS_DEBUG)
+LDFLAGS_PROFILE        = $(LDFLAGS) $(CFLAGS_PROFILE) 
+LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
 
 LDFLAGS_DEFAULT        = $(LDFLAGS_@DFT_UPR_MODEL@)
 
@@ -101,105 +114,139 @@ LINT_OPTS       = @LINT_OPTS@
 LINT_LIBS      = -lncurses @LIBS@
 
 AUTO_SRC = \
-       termsort.c
+       termsort.c \
+       transform.h
 
-PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x
-
-TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
+# tic relies on direct access to the terminfo database
+GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x
+PUT_PROGS = @MAKE_TERMINFO@ tic$x
+PROGS = $(PUT_PROGS) $(GET_PROGS)
 
 # Default library, for linking applications
 DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
 
+HEADER_DEPS    = \
+       ../include/curses.h \
+       $(INCDIR)/term_entry.h \
+       $(INCDIR)/tic.h \
+       $(INCDIR)/nc_alloc.h
+
 ################################################################################
-all:           $(AUTO_SRC) $(PROGS) 
+all:           $(AUTO_SRC) $(PROGS)
 
 sources:       $(AUTO_SRC)
 
-install: install.progs 
-uninstall: uninstall.progs 
+install:       $(AUTO_SRC) install.progs
+uninstall: uninstall.progs
 
 # this line simplifies the configure-script
 libs \
 install.libs \
 uninstall.libs:
 
-install.progs: $(PROGS) $(INSTALL_PREFIX)$(bindir)
-       $(INSTALL_PROGRAM) tic$x     $(INSTALL_PREFIX)$(bindir)/tic$x
-       $(INSTALL_PROGRAM) toe$x     $(INSTALL_PREFIX)$(bindir)/toe$x
-       $(INSTALL_PROGRAM) infocmp$x $(INSTALL_PREFIX)$(bindir)/infocmp$x
-       $(INSTALL_PROGRAM) clear$x   $(INSTALL_PREFIX)$(bindir)/clear$x
-       $(INSTALL_PROGRAM) tput$x    $(INSTALL_PREFIX)$(bindir)/tput$x
-       $(INSTALL_PROGRAM) tset$x    $(INSTALL_PREFIX)$(bindir)/tset$x
-       @echo "linking captoinfo to tic"
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
-       (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x captoinfo$x)
-       @echo "linking infotocap to tic"
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
-       (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x infotocap$x)
-       @echo "linking reset to tset"
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
-       (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tset$x reset$x)
+TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
+
+# transformed names for installing files
+actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
+actual_clear     = `echo clear$x|     $(TRANSFORM)`
+actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
+actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
+actual_init      = `echo init$x|      $(TRANSFORM)`
+actual_reset     = `echo reset$x|     $(TRANSFORM)`
+actual_tic       = `echo tic$x|       $(TRANSFORM)`
+actual_toe       = `echo toe$x|       $(TRANSFORM)`
+actual_tput      = `echo tput$x|      $(TRANSFORM)`
+actual_tset      = `echo tset$x|      $(TRANSFORM)`
+
+# transformed names for comparing at runtime
+define_captoinfo = `echo captoinfo|   $(TRANSFORM)`
+define_infotocap = `echo infotocap|   $(TRANSFORM)`
+define_init      = `echo init|        $(TRANSFORM)`
+define_reset     = `echo reset|       $(TRANSFORM)`
+
+transform.h :
+       echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@
+       echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@
+       echo "#define PROG_RESET     \"$(define_reset)\""     >>$@
+       echo "#define PROG_INIT      \"$(define_init)\""      >>$@
+
+install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
+@MAKE_TERMINFO@        $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
+@MAKE_TERMINFO@        $(LIBTOOL_INSTALL) $(INSTALL_PROG) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
+@MAKE_TERMINFO@        @echo "linking $(actual_infotocap) to $(actual_tic)"
+@MAKE_TERMINFO@        -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
+@MAKE_TERMINFO@        (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
+@MAKE_TERMINFO@        @echo "linking $(actual_captoinfo) to $(actual_tic)"
+@MAKE_TERMINFO@        -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
+@MAKE_TERMINFO@        (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
+       $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
+       $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
+       $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
+       $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
+       @echo "linking $(actual_reset) to $(actual_tset)"
+       -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
+       (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
 
 uninstall.progs:
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/tic$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/toe$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/infocmp$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/clear$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/tput$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/tset$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
-       -@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
-
-$(INSTALL_PREFIX)$(bindir) :
-       $(srcdir)/../mkinstalldirs $@
+@MAKE_TERMINFO@        -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
+@MAKE_TERMINFO@        -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
+@MAKE_TERMINFO@        -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
+@MAKE_TERMINFO@        -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
+       -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
+       -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
+       -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
+       -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
+       -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
+
+$(DESTDIR)$(bindir) :
+       sh $(srcdir)/../mkdirs.sh $@
 
 #
 # Utilities normally built by make all start here
 #
 
 DEPS_TIC = \
-       $(MODEL)/tic.o \
-       $(MODEL)/dump_entry.o
+       $(MODEL)/tic$o \
+       $(MODEL)/dump_entry$o
 
-tic$x: $(DEPS_TIC) $(DEPS_CURSES)
+tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
        @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_TOE = \
-       $(MODEL)/toe.o \
-       $(MODEL)/dump_entry.o
+       $(MODEL)/toe$o \
+       $(MODEL)/dump_entry$o
 
 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
        @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_CLEAR = \
-       $(MODEL)/clear.o
+       $(MODEL)/clear$o
 
 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
        @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_TPUT = \
-       $(MODEL)/tput.o
+       $(MODEL)/tput$o
 
-tput$x: $(DEPS_TPUT) $(DEPS_CURSES)
+tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
        @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_INFOCMP = \
-       $(MODEL)/infocmp.o \
-       $(MODEL)/dump_entry.o
+       $(MODEL)/infocmp$o \
+       $(MODEL)/dump_entry$o
 
 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
        @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
 
 DEPS_TSET = \
-       $(MODEL)/tset.o \
-       $(MODEL)/dump_entry.o
+       $(MODEL)/tset$o \
+       $(MODEL)/dump_entry$o
 
-tset$x: $(DEPS_TSET) $(DEPS_CURSES)
+tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
        @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
 
 termsort.c: $(srcdir)/MKtermsort.sh
-       sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
+       sh $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
 
 #
 # Utility productions start here
@@ -208,16 +255,17 @@ termsort.c: $(srcdir)/MKtermsort.sh
 tags:
        ctags *.[ch]
 
-TAGS:
-       etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@      etags *.[ch]
 
 mostlyclean ::
-       -rm -f core tags TAGS *~ *.ln *.atac trace
-       -rm -f $(TESTPROGS)
+       -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
 
 clean :: mostlyclean
+       -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
        -rm -f $(AUTO_SRC)
        -rm -f $(PROGS)
+       -rm -rf .libs
 
 distclean :: clean
        -rm -f Makefile
@@ -233,10 +281,10 @@ $(DEPS_CURSES) :
        cd ../ncurses; $(MAKE) $(CF_MFLAGS)
 
 lint:
+@MAKE_TERMINFO@        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
+@MAKE_TERMINFO@        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
-       $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
-       $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)