1 # $Id: Makefile.in,v 1.130 2021/12/18 23:00:28 tom Exp $
2 ##############################################################################
3 # Copyright 2020,2021 Thomas E. Dickey #
4 # Copyright 1998-2017,2018 Free Software Foundation, Inc. #
6 # Permission is hereby granted, free of charge, to any person obtaining a #
7 # copy of this software and associated documentation files (the "Software"), #
8 # to deal in the Software without restriction, including without limitation #
9 # the rights to use, copy, modify, merge, publish, distribute, distribute #
10 # with modifications, sublicense, and/or sell copies of the Software, and to #
11 # permit persons to whom the Software is furnished to do so, subject to the #
12 # following conditions: #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software. #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
20 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
23 # DEALINGS IN THE SOFTWARE. #
25 # Except as contained in this notice, the name(s) of the above copyright #
26 # holders shall not be used in advertising or otherwise to promote the sale, #
27 # use or other dealings in this Software without prior written #
29 ##############################################################################
31 # Author: Thomas E. Dickey 1996-on
33 # Makefile for ncurses tests.
35 # turn off _all_ suffix rules; we'll generate our own
49 MODEL = ../@DFT_OBJ_SUBDIR@
50 top_srcdir = @top_srcdir@
53 exec_prefix = @exec_prefix@
54 datarootdir = @datarootdir@
57 libexecdir = @libexecdir@
59 datarootdir = @datarootdir@
62 real_bindir = $(libexecdir)/$(PACKAGE)
64 BINDIR = $(DESTDIR)$(bindir)
65 LIBEXECDIR = $(DESTDIR)$(libexecdir)
66 LIBDIR = $(DESTDIR)$(libdir)
67 DATADIR = $(DESTDIR)$(datadir)
69 REAL_BINDIR = $(LIBEXECDIR)/$(PACKAGE)
72 LIBTOOL_OPTS = @LIBTOOL_OPTS@
73 LIBTOOL_CLEAN = @LIB_CLEAN@
74 LIBTOOL_COMPILE = @LIB_COMPILE@
75 LIBTOOL_LINK = @LIB_LINK@
77 INSTALL = @INSTALL@ @INSTALL_OPT_O@
78 INSTALL_PROG = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
79 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80 INSTALL_DATA = @INSTALL_DATA@
81 transform = @program_transform_name@
82 TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
90 CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
91 CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H -DDATA_DIR=\"$(datadir)\" @CPPFLAGS@
93 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
95 CFLAGS_LIBTOOL = $(CCFLAGS)
96 CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC
97 CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
98 CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
99 CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
101 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
103 REL_VERSION = @cf_cv_rel_version@
104 ABI_VERSION = @cf_cv_abi_version@
105 LOCAL_LIBDIR = @top_builddir@/lib
106 LOCAL_LIBS = @TEST_DEPS@
107 MATH_LIB = @MATH_LIB@
108 TEST_LIBS = @TEST_LIBS@
111 LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CFLAGS)
113 LDFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@
115 LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL)
116 LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL)
117 LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG)
118 LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE)
119 LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
121 TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
123 # use these for linking with all of the libraries
124 LIBS_DEFAULT = $(TEST_ARGS) @LIBS@ $(TEST_LIBS)
125 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_DEFAULT)
127 # use these for linking with the (n)curses library and possibly pthreads
128 LIBS_THREADS = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-l@FORM_NAME@.*-l@PANEL_NAME@[^ ]*//'` $(TEST_LIBS) @PTHREAD@
129 LDFLAGS_THREADS = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_THREADS)
131 # use these for linking with the (n)curses library
132 LIBS_CURSES = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-l@FORM_NAME@.*-l@PANEL_NAME@[^ ]*//'` $(TEST_LIBS)
133 LDFLAGS_CURSES = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES)
135 # use these when we need the math library
136 LDFLAGS_CURSES_M= $(LDFLAGS_CURSES) $(MATH_LIB)
138 # use these for linking with the tinfo library if we have it, or curses library if not
139 LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS)
140 LDFLAGS_TINFO = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
143 LINT_OPTS = @LINT_OPTS@
144 LINT_LIBS = -lform -lmenu -lpanel -lncurses @LIBS@
146 INCDIR = $(top_srcdir)/include
152 $(incdir)/ncurses_cfg.h \
153 $(incdir)/ncurses_def.h \
154 $(incdir)/ncurses_dll.h \
159 ################################################################################
161 @MAKE_PHONY@.PHONY : all
162 @MAKE_PHONY@.PHONY : check
166 # Verify that each header-file can be compiled without including another.
168 @$(SHELL) -c "for header in *.h;\
170 echo \"** testing \$${header}\" ; \
171 echo \"#include <\$${header}>\" >headers.c; \
172 echo \"int main(void) { return 0; }\" >>headers.c; \
173 $(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
177 # The rest is generated from the "programs" and "modules" files...