micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 1 | # $Id: Makefile.in,v 1.130 2021/12/18 23:00:28 tom Exp $ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | ############################################################################## |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 3 | # Copyright 2020,2021 Thomas E. Dickey # |
| 4 | # Copyright 1998-2017,2018 Free Software Foundation, Inc. # |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 5 | # # |
| 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: # |
| 13 | # # |
| 14 | # The above copyright notice and this permission notice shall be included in # |
| 15 | # all copies or substantial portions of the Software. # |
| 16 | # # |
| 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. # |
| 24 | # # |
| 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 # |
| 28 | # authorization. # |
| 29 | ############################################################################## |
| 30 | # |
| 31 | # Author: Thomas E. Dickey 1996-on |
| 32 | # |
| 33 | # Makefile for ncurses tests. |
| 34 | |
| 35 | # turn off _all_ suffix rules; we'll generate our own |
| 36 | .SUFFIXES: |
| 37 | |
| 38 | SHELL = @SHELL@ |
| 39 | VPATH = @srcdir@ |
| 40 | |
| 41 | @SET_MAKE@ |
| 42 | |
| 43 | destdir = |
| 44 | x = @EXEEXT@ |
| 45 | o = .@OBJEXT@ |
| 46 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 47 | PACKAGE = @PACKAGE@ |
| 48 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 49 | MODEL = ../@DFT_OBJ_SUBDIR@ |
| 50 | top_srcdir = @top_srcdir@ |
| 51 | srcdir = @srcdir@ |
| 52 | prefix = @prefix@ |
| 53 | exec_prefix = @exec_prefix@ |
| 54 | datarootdir = @datarootdir@ |
| 55 | |
| 56 | bindir = @bindir@ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 57 | libexecdir = @libexecdir@ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 58 | libdir = @libdir@ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 59 | datarootdir = @datarootdir@ |
| 60 | datadir = @datadir@ |
| 61 | |
| 62 | real_bindir = $(libexecdir)/$(PACKAGE) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 63 | |
| 64 | BINDIR = $(DESTDIR)$(bindir) |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 65 | LIBEXECDIR = $(DESTDIR)$(libexecdir) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 66 | LIBDIR = $(DESTDIR)$(libdir) |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 67 | DATADIR = $(DESTDIR)$(datadir) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 68 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 69 | REAL_BINDIR = $(LIBEXECDIR)/$(PACKAGE) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | |
| 71 | LIBTOOL = @LIBTOOL@ |
| 72 | LIBTOOL_OPTS = @LIBTOOL_OPTS@ |
| 73 | LIBTOOL_CLEAN = @LIB_CLEAN@ |
| 74 | LIBTOOL_COMPILE = @LIB_COMPILE@ |
| 75 | LIBTOOL_LINK = @LIB_LINK@ |
| 76 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 77 | INSTALL = @INSTALL@ @INSTALL_OPT_O@ |
| 78 | INSTALL_PROG = @INSTALL_PROGRAM@ @INSTALL_OPT_S@ |
| 79 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
| 80 | INSTALL_DATA = @INSTALL_DATA@ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 81 | transform = @program_transform_name@ |
| 82 | TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/' |
| 83 | |
| 84 | CTAGS = @CTAGS@ |
| 85 | ETAGS = @ETAGS@ |
| 86 | |
| 87 | CC = @CC@ |
| 88 | CPP = @CPP@ |
| 89 | |
| 90 | CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 91 | CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H -DDATA_DIR=\"$(datadir)\" @CPPFLAGS@ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 92 | |
| 93 | CCFLAGS = $(CPPFLAGS) $(CFLAGS) |
| 94 | |
| 95 | CFLAGS_LIBTOOL = $(CCFLAGS) |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 96 | CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC |
| 97 | CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE |
| 98 | CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ |
| 100 | |
| 101 | CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) |
| 102 | |
| 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@ |
| 109 | |
| 110 | LD = @LD@ |
| 111 | LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CFLAGS) |
| 112 | |
| 113 | LDFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@ |
| 114 | |
| 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@ |
| 120 | |
| 121 | TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ |
| 122 | |
| 123 | # use these for linking with all of the libraries |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 124 | LIBS_DEFAULT = $(TEST_ARGS) @LIBS@ $(TEST_LIBS) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 125 | LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_DEFAULT) |
| 126 | |
| 127 | # use these for linking with the (n)curses library and possibly pthreads |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 128 | LIBS_THREADS = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-l@FORM_NAME@.*-l@PANEL_NAME@[^ ]*//'` $(TEST_LIBS) @PTHREAD@ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 129 | LDFLAGS_THREADS = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_THREADS) |
| 130 | |
| 131 | # use these for linking with the (n)curses library |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 132 | LIBS_CURSES = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-l@FORM_NAME@.*-l@PANEL_NAME@[^ ]*//'` $(TEST_LIBS) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 133 | LDFLAGS_CURSES = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES) |
| 134 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 135 | # use these when we need the math library |
| 136 | LDFLAGS_CURSES_M= $(LDFLAGS_CURSES) $(MATH_LIB) |
| 137 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 138 | # use these for linking with the tinfo library if we have it, or curses library if not |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 139 | LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 140 | LDFLAGS_TINFO = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO) |
| 141 | |
| 142 | LINT = @LINT@ |
| 143 | LINT_OPTS = @LINT_OPTS@ |
| 144 | LINT_LIBS = -lform -lmenu -lpanel -lncurses @LIBS@ |
| 145 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 146 | INCDIR = $(top_srcdir)/include |
| 147 | incdir = ../include |
| 148 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 149 | HEADER_DEPS = \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame^] | 150 | $(incdir)/curses.h \ |
| 151 | $(incdir)/term.h \ |
| 152 | $(incdir)/ncurses_cfg.h \ |
| 153 | $(incdir)/ncurses_def.h \ |
| 154 | $(incdir)/ncurses_dll.h \ |
| 155 | $(incdir)/term.h \ |
| 156 | $(incdir)/unctrl.h \ |
| 157 | $(INCDIR)/nc_alloc.h |
| 158 | |
| 159 | ################################################################################ |
| 160 | |
| 161 | @MAKE_PHONY@.PHONY : all |
| 162 | @MAKE_PHONY@.PHONY : check |
| 163 | |
| 164 | all:: |
| 165 | |
| 166 | # Verify that each header-file can be compiled without including another. |
| 167 | check:: |
| 168 | @$(SHELL) -c "for header in *.h;\ |
| 169 | do \ |
| 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; \ |
| 174 | done" |
| 175 | -@rm -f headers.* |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 176 | |
| 177 | # The rest is generated from the "programs" and "modules" files... |