ncurses 6.3 - patch 20220521
[ncurses.git] / ncurses / Makefile.in
1 # $Id: Makefile.in,v 1.182 2021/08/19 23:43:40 tom Exp $
2 ##############################################################################
3 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
4 # Copyright 1998-2017,2018 Free Software Foundation, Inc.                    #
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 source code.
34 #
35 # This makes the following:
36 #       programs
37 #       includes
38 #       libraries (normal/debug/profile/shared)
39 #
40 # The variable 'srcdir' refers to the source-distribution, and can be set with
41 # the configure script by "--srcdir=DIR".
42 #
43 # The rules are organized to produce the libraries for the configured models,
44 # and the programs with the configured default model.
45
46 # turn off _all_ suffix rules; we'll generate our own
47 .SUFFIXES:
48
49 SHELL           = @SHELL@
50 VPATH           = @srcdir@
51 THIS            = Makefile
52
53 TOP_MFLAGS      = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
54 @SET_MAKE@
55
56 x               = @EXEEXT@
57 o               = .@OBJEXT@
58
59 MODEL           = @DFT_LWR_MODEL@
60 DESTDIR         = @DESTDIR@
61 top_srcdir      = @top_srcdir@
62 srcdir          = @srcdir@
63 prefix          = @prefix@
64 exec_prefix     = @exec_prefix@
65 bindir          = @bindir@
66 libdir          = @libdir@
67 includedir      = @includedir@
68 datarootdir     = @datarootdir@
69 datadir         = @datadir@
70 includesubdir   = @includesubdir@
71
72 INCLUDEDIR      = $(DESTDIR)$(includedir)$(includesubdir)
73
74 PACKAGE         = @PACKAGE@
75
76 LIBTOOL         = @LIBTOOL@
77 LIBTOOL_OPTS    = @LIBTOOL_OPTS@ @EXPORT_SYMS@
78 LIBTOOL_CLEAN   = @LIB_CLEAN@
79 LIBTOOL_COMPILE = @LIB_COMPILE@
80 LIBTOOL_LINK    = @LIB_LINK@
81 LIBTOOL_INSTALL = @LIB_INSTALL@
82 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
83 LT_UNDEF        = @LT_UNDEF@
84
85 INSTALL         = @INSTALL@
86 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
87 INSTALL_PROG    = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
88 INSTALL_DATA    = @INSTALL_DATA@
89
90 AR              = @AR@
91 ARFLAGS         = @ARFLAGS@
92 AWK             = @AWK@
93 LD              = @LD@
94 LN_S            = @LN_S@
95 NM              = @NM@
96
97 CTAGS           = @CTAGS@
98 ETAGS           = @ETAGS@
99
100 CC              = @CC@
101 CPP             = @CPP@
102 CFLAGS          = @CFLAGS@ @EXTRA_CFLAGS@
103 LIBS            = @LIBS@
104
105 INCDIR          = $(srcdir)/../include
106 CPPFLAGS        = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@
107
108 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
109
110 BUILD_CPPFLAGS  = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@
111 BUILD_CC        = @BUILD_CC@
112 BUILD_CCFLAGS   = @BUILD_CFLAGS@
113 BUILD_LDFLAGS   = @BUILD_LDFLAGS@
114 BUILD_LIBS      = @BUILD_LIBS@
115
116 # The executables built in this directory are used for generating source that
117 # is compiled into the build, or are test-programs that are not installed.
118
119 BUILD_EXEEXT    = @BUILD_EXEEXT@
120 x               = @EXEEXT@
121
122 CFLAGS_LIBTOOL  = $(CCFLAGS)
123 CFLAGS_NORMAL   = $(CCFLAGS) -DNCURSES_STATIC
124 CFLAGS_DEBUG    = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
125 CFLAGS_PROFILE  = $(CCFLAGS) -DNCURSES_STATIC -pg
126 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
127
128 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
129
130 LINK            = $(LIBTOOL)
131 LDFLAGS         = @LDFLAGS@ @LD_MODEL@
132
133 SHLIB_DIRS      = -L../lib
134 SHLIB_LIST      = $(SHLIB_DIRS) @SHLIB_LIST@ @LIBS@
135 TINFO_LIST      = $(SHLIB_DIRS) @TINFO_LIST@ @LIBS@
136 TICS_LIST       = $(SHLIB_DIRS) @TICS_LIST@ @LIBS@
137
138 RPATH_LIST      = @RPATH_LIST@
139 RESULTING_SYMS  = @RESULTING_SYMS@
140 VERSIONED_SYMS  = @VERSIONED_SYMS@
141 MK_SHARED_LIB   = @MK_SHARED_LIB@
142
143 NCURSES_MAJOR   = @NCURSES_MAJOR@
144 NCURSES_MINOR   = @NCURSES_MINOR@
145 REL_VERSION     = @cf_cv_rel_version@
146 ABI_VERSION     = @cf_cv_abi_version@
147
148 RANLIB          = @LIB_PREP@
149
150 LIBRARIES       = @Libs_To_Make@
151
152 LINT            = @LINT@
153 LINT_OPTS       = @LINT_OPTS@
154 LINT_LIBS       = -lncurses @LIBS@
155
156 FALLBACK_LIST   = @FALLBACK_LIST@
157
158 USE_BIG_STRINGS = @USE_BIG_STRINGS@
159 TERMINFO_CAPS   = $(top_srcdir)/include/@TERMINFO_CAPS@
160 CAPLIST         = $(TERMINFO_CAPS) $(top_srcdir)/include/Caps-ncurses
161
162 TERMINFO        = @TERMINFO@
163 TERMINFO_SRC    = @TERMINFO_SRC@
164 TIC_PATH        = @TIC@
165 INFOCMP_PATH    = @INFOCMP@
166
167 AUTO_SRC = \
168         ./codes.c \
169         ./comp_captab.c \
170         ./comp_userdefs.c \
171         ./expanded.c \
172         ./fallback.c \
173         ./lib_gen.c \
174         ./lib_keyname.c \
175         ./link_test.c \
176         ./names.c \
177         ./unctrl.c \
178         init_keytry.h \
179         keys.list
180
181 HEADER_DEPS     = @INTERNALS_HDR@ \
182         ../include/ncurses_cfg.h \
183         ../include/ncurses_def.h \
184         ../include/ncurses_dll.h \
185         ../include/curses.h \
186         ../include/term.h \
187         ../include/unctrl.h \
188         $(INCDIR)/nc_alloc.h \
189         $(INCDIR)/nc_panel.h \
190         $(INCDIR)/nc_string.h \
191         $(INCDIR)/nc_termios.h \
192         $(INCDIR)/nc_tparm.h \
193         $(INCDIR)/nc_win32.h \
194         $(INCDIR)/term_entry.h \
195         $(srcdir)/curses.priv.h \
196         $(srcdir)/new_pair.h \
197         $(srcdir)/term.priv.h
198
199 TEST_DEPS       = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
200 TEST_ARGS       = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
201 TEST_LDFLAGS    = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
202
203 TEST_PROGS = \
204         captoinfo$x \
205         hardscroll$x \
206         hashmap$x \
207         lib_mvcur$x \
208         link_test$x \
209         report_hashing$x
210
211 LOCAL_LIBDIR    = @top_builddir@/lib
212
213 base     = $(srcdir)/base
214 serial   = $(srcdir)/tty
215 tinfo    = $(srcdir)/tinfo
216 trace    = $(srcdir)/trace
217 wide     = $(srcdir)/widechar
218 win32con = $(srcdir)/win32con
219
220 ################################################################################
221
222 @MAKE_PHONY@.PHONY :    all
223 @MAKE_PHONY@.PHONY :    check
224 @MAKE_PHONY@.PHONY :    clean
225 @MAKE_PHONY@.PHONY :    distclean
226 @MAKE_PHONY@.PHONY :    libs
227 @MAKE_PHONY@.PHONY :    mostlyclean
228 @MAKE_PHONY@.PHONY :    realclean
229 @MAKE_PHONY@.PHONY :    sources
230 @MAKE_PHONY@.PHONY :    test_progs
231
232 all libs ::     $(AUTO_SRC) ../lib $(LIBRARIES)
233
234 @CHECK_BUILD@all libs ::        report_offsets$(BUILD_EXEEXT)
235
236 sources:        $(AUTO_SRC)
237
238 $(DESTDIR)$(bindir) \
239 $(DESTDIR)$(libdir) :
240         mkdir -p $@
241
242 ../lib : ; mkdir $@
243
244 ./fallback.c : $(tinfo)/MKfallback.sh
245         $(SHELL) -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) "$(TIC_PATH)" "$(INFOCMP_PATH)" $(FALLBACK_LIST) >$@
246
247 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
248         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
249
250 init_keytry.h : make_keys$(BUILD_EXEEXT) keys.list
251         ./make_keys$(BUILD_EXEEXT) keys.list > $@
252
253 keys.list :     $(tinfo)/MKkeys_list.sh
254         AWK=$(AWK) $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
255
256 make_keys$(BUILD_EXEEXT) : \
257                 build.priv.h \
258                 $(tinfo)/make_keys.c \
259                 ./names.c
260         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
261
262 make_hash$(BUILD_EXEEXT) : \
263                 build.priv.h \
264                 $(tinfo)/make_hash.c \
265                 ../include/hashsize.h
266         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
267
268 report_offsets$(BUILD_EXEEXT) : \
269                 $(srcdir)/curses.priv.h \
270                 $(srcdir)/report_offsets.c
271         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(srcdir)/report_offsets.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
272         ./report_offsets$(BUILD_EXEEXT)
273
274 ./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
275         $(SHELL) -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
276
277 ./comp_captab.c: \
278                 make_hash$(BUILD_EXEEXT) \
279                 ../include/hashsize.h \
280                 $(tinfo)/MKcaptab.sh \
281                 $(tinfo)/MKcaptab.awk
282         $(SHELL) -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(CAPLIST) > $@
283
284 ./comp_userdefs.c: \
285                 make_hash$(BUILD_EXEEXT) \
286                 ../include/hashsize.h \
287                 $(tinfo)/MKuserdefs.sh
288         $(SHELL) -e $(tinfo)/MKuserdefs.sh $(AWK) $(USE_BIG_STRINGS) $(CAPLIST) > $@
289
290 ./lib_keyname.c: keys.list $(base)/MKkeyname.awk
291         $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
292
293 ./codes.c: $(tinfo)/MKcodes.awk
294         $(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
295
296 ./names.c: $(tinfo)/MKnames.awk
297         $(AWK) -f $(tinfo)/MKnames.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
298
299 ./unctrl.c: $(base)/MKunctrl.awk
300         echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
301
302 tags:
303         $(CTAGS) *.[ch] */*.[ch]
304
305 @MAKE_UPPER_TAGS@TAGS:
306 @MAKE_UPPER_TAGS@       $(ETAGS) *.[ch] */*.[ch]
307
308 mostlyclean ::
309         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac
310         -test -d trace || rm -f trace
311         -rm -f $(TEST_PROGS)
312
313 clean :: mostlyclean
314         -rm -f $(AUTO_SRC)
315         -rm -f make_keys$(BUILD_EXEEXT)
316         -rm -f make_hash$(BUILD_EXEEXT)
317         -rm -f report_offsets$(BUILD_EXEEXT)
318         -rm -rf .libs *.dSYM *.map
319
320 distclean :: clean
321         -rm -f Makefile
322
323 realclean :: distclean
324
325 # These rules are used to allow "make -n" to work on a clean directory-tree
326 ../include/hashsize.h \
327 ../include/parametrized.h \
328 ../include/term.h :
329         ( cd ../include && $(MAKE) $(TOP_MFLAGS) )
330
331 # These rules build test-programs for the modules that have test-drivers
332 @MAKE_PHONY@.PHONY :    test_progs
333 test_progs : $(TEST_PROGS)
334
335 ./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
336         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
337
338 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
339         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
340
341 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
342         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
343
344 hashmap$x : $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_DEPS)
345         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_LDFLAGS)
346
347 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
348                 ../@DFT_OBJ_SUBDIR@/dump_entry$o
349         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry$o $(TEST_LDFLAGS)
350
351 link_test$x : ./link_test.c $(TEST_DEPS) \
352                 ../@DFT_OBJ_SUBDIR@/link_test$o
353         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS)
354
355 ../@DFT_OBJ_SUBDIR@/dump_entry$o:
356         ( cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o )
357
358 report_hashing$x : \
359                 $(srcdir)/curses.priv.h \
360                 $(srcdir)/report_hashing.c $(TEST_DEPS)
361         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) report_hashing.c $(TEST_LDFLAGS)
362
363 # Verify that each header-file can be compiled without including another.
364 @MAKE_PHONY@.PHONY :    check_headers
365 check_headers:
366         @$(SHELL) -c "for header in *.h;\
367                 do \
368                         echo \"** testing \$${header}\" ; \
369                         echo \"#include <\$${header}>\" >headers.c; \
370                         echo \"int main(void) { return 0; }\" >>headers.c; \
371                         $(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
372                 done"
373         -@rm -f headers.*
374
375 @MAKE_PHONY@.PHONY :    check_objects
376 check_objects: test_progs
377
378 check :: check_headers check_objects
379
380 ###############################################################################
381 # The remainder of this file is automatically generated during configuration
382 ###############################################################################