ncurses 6.2 - patch 20210418
[ncurses.git] / progs / Makefile.in
index 9598d442067fa78005042b6ab32e8bafabaa3ec6..e1502ddc34a3bd82d9da0222bdd7c1d3c565ea8b 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: Makefile.in,v 1.89 2012/08/11 21:31:56 tom Exp $
+# $Id: Makefile.in,v 1.110 2021/04/18 11:32:39 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2011,2012 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@
@@ -63,8 +64,14 @@ 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@
@@ -72,7 +79,7 @@ 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@
@@ -83,17 +90,17 @@ 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@)
@@ -126,7 +133,7 @@ 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
@@ -173,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)`
@@ -182,9 +190,10 @@ transform.h :
        echo "#define __TRANSFORM_H 1"                                  >>$@
        echo "#include <progs.priv.h>"                                  >>$@
        echo "extern bool same_program(const char *, const char *);"    >>$@
-       -sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi'
+       -$(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 */"                               >>$@
@@ -194,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)
@@ -205,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)
@@ -229,6 +238,7 @@ $(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
@@ -241,20 +251,27 @@ toe$x: $(DEPS_TOE) $(DEPS_CURSES)
        @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_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_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_LD@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
@@ -268,13 +285,15 @@ infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
 
 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_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
@@ -290,10 +309,10 @@ 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
@@ -304,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