ncurses 6.2 - patch 20210418
[ncurses.git] / progs / Makefile.in
index 5e211c281715616912391a0198859245b177f594..e1502ddc34a3bd82d9da0222bdd7c1d3c565ea8b 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: Makefile.in,v 1.81 2009/03/14 18:45:55 tom Exp $
+# $Id: Makefile.in,v 1.110 2021/04/18 11:32:39 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
+# Copyright 2020,2021 Thomas E. Dickey                                       #
+# Copyright 1998-2016,2018 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"), #
 # turn off _all_ suffix rules; we'll generate our own
 .SUFFIXES:
 
-SHELL          = /bin/sh
+SHELL          = @SHELL@
+VPATH          = @srcdir@
 THIS           = Makefile
 
-CF_MFLAGS      = @cf_cv_makeflags@
+TOP_MFLAGS     = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
 @SET_MAKE@
 
 x              = @EXEEXT@
@@ -60,9 +62,16 @@ exec_prefix  = @exec_prefix@
 bindir         = @bindir@
 libdir         = @libdir@
 includedir     = @includedir@
+datarootdir    = @datarootdir@
 datadir                = @datadir@
+includesubdir  = @includesubdir@
+
+INCLUDEDIR     = $(DESTDIR)$(includedir)$(includesubdir)
+
+PACKAGE                = @PACKAGE@
 
 LIBTOOL                = @LIBTOOL@
+LIBTOOL_OPTS   = @LIBTOOL_OPTS@
 LIBTOOL_CLEAN  = @LIB_CLEAN@
 LIBTOOL_COMPILE        = @LIB_COMPILE@
 LIBTOOL_LINK   = @LIB_LINK@
@@ -70,25 +79,28 @@ LIBTOOL_INSTALL     = @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
 
 INSTALL                = @INSTALL@
-INSTALL_PROG   = @INSTALL_PROGRAM@
+INSTALL_PROG   = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
 transform      = @program_transform_name@
 
 AWK            = @AWK@
 LN_S           = @LN_S@
 
+CTAGS          = @CTAGS@
+ETAGS          = @ETAGS@
+
 CC             = @CC@
 CPP            = @CPP@
-CFLAGS         = @CFLAGS@
+CFLAGS         = @CFLAGS@ @EXTRA_CFLAGS@
 
 INCDIR         = $(top_srcdir)/include
-CPPFLAGS       = -I../progs -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS       = -DHAVE_CONFIG_H -I../progs @CPPFLAGS@
 
 CCFLAGS                = $(CPPFLAGS) $(CFLAGS)
 
 CFLAGS_LIBTOOL = $(CCFLAGS)
-CFLAGS_NORMAL  = $(CCFLAGS)
-CFLAGS_DEBUG   = $(CCFLAGS) @CC_G_OPT@ -DTRACE
-CFLAGS_PROFILE = $(CCFLAGS) -pg
+CFLAGS_NORMAL  = $(CCFLAGS) -DNCURSES_STATIC
+CFLAGS_DEBUG   = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
+CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
 CFLAGS_SHARED  = $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
@@ -100,27 +112,28 @@ LOCAL_LIBDIR      = @top_builddir@/lib
 LD             = @LD@
 LINK           = @LINK_PROGS@ $(LIBTOOL_LINK)
 LDFLAGS                = @EXTRA_LDFLAGS@ @LDFLAGS@
+RPATH_LIST     = @RPATH_LIST@
 
 LDFLAGS_LIBTOOL        = $(LDFLAGS) $(CFLAGS_LIBTOOL)
 LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL)
 LDFLAGS_DEBUG  = $(LDFLAGS) $(CFLAGS_DEBUG)
-LDFLAGS_PROFILE        = $(LDFLAGS) $(CFLAGS_PROFILE) 
+LDFLAGS_PROFILE        = $(LDFLAGS) $(CFLAGS_PROFILE)
 LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
 
 LDFLAGS_DEFAULT        = $(LDFLAGS_@DFT_UPR_MODEL@)
 
-LIBS_TIC       = @LDFLAGS_STATIC@ @TICS_ARGS@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
-LDFLAGS_TIC    = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TIC)
+LIBS_TIC       = @TINFO_LDFLAGS@ @LDFLAGS_STATIC@ @TICS_LIBS@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
+LDFLAGS_TIC    = @TICS_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TIC)
 
-LIBS_TINFO     = @LDFLAGS_STATIC@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
-LDFLAGS_TINFO  = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
+LIBS_TINFO     = @LDFLAGS_STATIC@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
+LDFLAGS_TINFO  = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
 LINT_LIBS      = -lncurses @LIBS@
 
 AUTO_SRC = \
-       termsort.c \
+       termsort.h \
        transform.h
 
 # tic relies on direct access to the terminfo database
@@ -167,6 +180,7 @@ actual_tset      = `echo tset$x|      $(TRANSFORM)`
 
 # transformed names for comparing at runtime
 define_captoinfo = `echo captoinfo|   $(TRANSFORM)`
+define_clear     = `echo clear|       $(TRANSFORM)`
 define_infotocap = `echo infotocap|   $(TRANSFORM)`
 define_init      = `echo init|        $(TRANSFORM)`
 define_reset     = `echo reset|       $(TRANSFORM)`
@@ -176,9 +190,10 @@ transform.h :
        echo "#define __TRANSFORM_H 1"                                  >>$@
        echo "#include <progs.priv.h>"                                  >>$@
        echo "extern bool same_program(const char *, const char *);"    >>$@
-       -test -n "$x" && echo "#define SUFFIX_IGNORED \"$x\""           >>$@
+       -$(SHELL) -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi'
        echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\""           >>$@
        echo "#define PROG_INFOTOCAP \"$(define_infotocap)\""           >>$@
+       echo "#define PROG_CLEAR     \"$(define_clear)\""               >>$@
        echo "#define PROG_RESET     \"$(define_reset)\""               >>$@
        echo "#define PROG_INIT      \"$(define_init)\""                >>$@
        echo "#endif /* __TRANSFORM_H */"                               >>$@
@@ -188,10 +203,10 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
 @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@        ( 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))
+@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) tabs$x    $(DESTDIR)$(bindir)/$(actual_tabs)
@@ -199,7 +214,7 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
        $(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))
+       ( cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset) )
 
 uninstall.progs:
 @MAKE_TERMINFO@        -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
@@ -214,7 +229,7 @@ uninstall.progs:
        -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
 
 $(DESTDIR)$(bindir) :
-       sh $(srcdir)/../mkdirs.sh $@
+       mkdir -p $@
 
 #
 # Utilities normally built by make all start here
@@ -223,71 +238,81 @@ $(DESTDIR)$(bindir) :
 DEPS_TIC = \
        $(MODEL)/tic$o \
        $(MODEL)/dump_entry$o \
+       $(MODEL)/tparm_type$o \
        $(MODEL)/transform$o
 
 tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
-       @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@
 
 DEPS_TOE = \
        $(MODEL)/toe$o
 
 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
-       @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_TIC) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_TOE) $(LDFLAGS_TIC) -o $@
 
 DEPS_CLEAR = \
-       $(MODEL)/clear$o
+       $(MODEL)/clear$o \
+       $(MODEL)/clear_cmd$o \
+       $(MODEL)/tty_settings$o
 
 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
-       @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
 
 DEPS_TABS = \
-       $(MODEL)/tabs$o
+       $(MODEL)/tabs$o \
+       $(MODEL)/tty_settings$o
 
 tabs$x: $(DEPS_TABS) $(DEPS_TABS)
-       @ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@
 
 DEPS_TPUT = \
        $(MODEL)/tput$o \
-       $(MODEL)/transform$o
+       $(MODEL)/clear_cmd$o \
+       $(MODEL)/reset_cmd$o \
+       $(MODEL)/tparm_type$o \
+       $(MODEL)/transform$o \
+       $(MODEL)/tty_settings$o
 
 tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
-       @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
 
 DEPS_INFOCMP = \
        $(MODEL)/infocmp$o \
        $(MODEL)/dump_entry$o
 
 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
-       @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@
 
 DEPS_TSET = \
        $(MODEL)/tset$o \
-       $(MODEL)/transform$o
+       $(MODEL)/reset_cmd$o \
+       $(MODEL)/transform$o \
+       $(MODEL)/tty_settings$o
 
 tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
-       @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
+       @ECHO_LD@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
 
-termsort.c: $(srcdir)/MKtermsort.sh
-       sh $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
+termsort.h: $(srcdir)/MKtermsort.sh
+       $(SHELL) $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
 
 #
 # Utility productions start here
 #
 
 tags:
-       ctags *.[ch]
+       $(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@      etags *.[ch]
+@MAKE_UPPER_TAGS@      $(ETAGS) *.[ch]
 
 mostlyclean ::
        -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
 
 clean :: mostlyclean
-       -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
+       -$(SHELL) -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
        -rm -f $(AUTO_SRC)
        -rm -f $(PROGS)
-       -rm -rf .libs
+       -rm -rf .libs *.dSYM
 
 distclean :: clean
        -rm -f Makefile
@@ -298,18 +323,29 @@ realclean :: distclean
 ../include/hashsize.h \
 ../include/parametrized.h \
 ../include/term.h :
-       cd ../include; $(MAKE) $(CF_MFLAGS)
+       ( cd ../include && $(MAKE) $(TOP_MFLAGS) )
 $(DEPS_CURSES) :
-       cd ../ncurses; $(MAKE) $(CF_MFLAGS)
+       ( cd ../ncurses && $(MAKE) $(TOP_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)
+@MAKE_TERMINFO@        $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.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)/tabs.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)
+       $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c                           $(LINT_LIBS)
+
+# Verify that each header-file can be compiled without including another.
+check:
+       @$(SHELL) -c "for header in *.h;\
+               do \
+                       echo \"** testing \$${header}\" ; \
+                       echo \"#include <\$${header}>\" >headers.c; \
+                       echo \"int main(void) { return 0; }\" >>headers.c; \
+                       $(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
+               done"
+       -@rm -f headers.*
 
 ###############################################################################
 # The remainder of this file is automatically generated during configuration