ncurses 6.2 - patch 20200718
[ncurses.git] / ncurses / Makefile.in
1 # $Id: Makefile.in,v 1.171 2020/07/18 19:17:35 tom Exp $
2 ##############################################################################
3 # Copyright 2018-2019,2020 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 CF_MFLAGS       = @cf_cv_makeflags@
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@
103
104 INCDIR          = $(srcdir)/../include
105 CPPFLAGS        = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@
106
107 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
108
109 BUILD_CPPFLAGS  = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@
110 BUILD_CC        = @BUILD_CC@
111 BUILD_CCFLAGS   = @BUILD_CFLAGS@
112 BUILD_LDFLAGS   = @BUILD_LDFLAGS@
113 BUILD_LIBS      = @BUILD_LIBS@
114
115 # The executables built in this directory are used for generating source that
116 # is compiled into the build, or are test-programs that are not installed.
117
118 BUILD_EXEEXT    = @BUILD_EXEEXT@
119 x               = @EXEEXT@
120
121 CFLAGS_LIBTOOL  = $(CCFLAGS)
122 CFLAGS_NORMAL   = $(CCFLAGS) -DNCURSES_STATIC
123 CFLAGS_DEBUG    = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
124 CFLAGS_PROFILE  = $(CCFLAGS) -DNCURSES_STATIC -pg
125 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
126
127 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
128
129 LINK            = $(LIBTOOL)
130 LDFLAGS         = @LDFLAGS@ @LD_MODEL@
131
132 SHLIB_DIRS      = -L../lib
133 SHLIB_LIST      = $(SHLIB_DIRS) @SHLIB_LIST@ @LIBS@
134 TINFO_LIST      = $(SHLIB_DIRS) @TINFO_LIST@ @LIBS@
135 TICS_LIST       = $(SHLIB_DIRS) @TICS_LIST@ @LIBS@
136
137 RPATH_LIST      = @RPATH_LIST@
138 RESULTING_SYMS  = @RESULTING_SYMS@
139 VERSIONED_SYMS  = @VERSIONED_SYMS@
140 MK_SHARED_LIB   = @MK_SHARED_LIB@
141
142 NCURSES_MAJOR   = @NCURSES_MAJOR@
143 NCURSES_MINOR   = @NCURSES_MINOR@
144 REL_VERSION     = @cf_cv_rel_version@
145 ABI_VERSION     = @cf_cv_abi_version@
146
147 RANLIB          = @LIB_PREP@
148
149 LIBRARIES       = @Libs_To_Make@
150
151 LINT            = @LINT@
152 LINT_OPTS       = @LINT_OPTS@
153 LINT_LIBS       = -lncurses @LIBS@
154
155 FALLBACK_LIST   = @FALLBACK_LIST@
156
157 USE_BIG_STRINGS = @USE_BIG_STRINGS@
158 TERMINFO_CAPS   = $(top_srcdir)/include/@TERMINFO_CAPS@
159 CAPLIST         = $(TERMINFO_CAPS) $(top_srcdir)/include/Caps-ncurses
160
161 TERMINFO        = @TERMINFO@
162 TERMINFO_SRC    = @TERMINFO_SRC@
163 TIC_PATH        = @TIC@
164 INFOCMP_PATH    = @INFOCMP@
165
166 AUTO_SRC = \
167         ./codes.c \
168         ./comp_captab.c \
169         ./comp_userdefs.c \
170         ./expanded.c \
171         ./fallback.c \
172         ./lib_gen.c \
173         ./lib_keyname.c \
174         ./link_test.c \
175         ./names.c \
176         ./unctrl.c \
177         init_keytry.h \
178         keys.list
179
180 HEADER_DEPS     = \
181         ../include/ncurses_cfg.h \
182         ../include/ncurses_def.h \
183         ../include/ncurses_dll.h \
184         ../include/curses.h \
185         ../include/term.h \
186         ../include/unctrl.h \
187         $(INCDIR)/nc_alloc.h \
188         $(INCDIR)/nc_mingw.h \
189         $(INCDIR)/nc_panel.h \
190         $(INCDIR)/nc_string.h \
191         $(INCDIR)/nc_termios.h \
192         $(INCDIR)/nc_tparm.h \
193         $(INCDIR)/term_entry.h \
194         $(srcdir)/curses.priv.h \
195         $(srcdir)/new_pair.h
196
197 TEST_DEPS       = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
198 TEST_ARGS       = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ 
199 TEST_LDFLAGS    = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
200
201 TEST_PROGS = \
202         captoinfo$x \
203         hardscroll$x \
204         hashmap$x \
205         lib_mvcur$x \
206         link_test$x \
207         report_hashing$x
208
209 LOCAL_LIBDIR    = @top_builddir@/lib
210
211 base     = $(srcdir)/base
212 serial   = $(srcdir)/tty
213 tinfo    = $(srcdir)/tinfo
214 trace    = $(srcdir)/trace
215 wide     = $(srcdir)/widechar
216 win32con = $(srcdir)/win32con
217
218 ################################################################################
219 all libs ::     $(AUTO_SRC) ../lib $(LIBRARIES)
220
221 @CHECK_BUILD@all libs ::        report_offsets$(BUILD_EXEEXT) 
222
223 sources:        $(AUTO_SRC)
224
225 $(DESTDIR)$(bindir) \
226 $(DESTDIR)$(libdir) :
227         mkdir -p $@
228
229 ../lib : ; mkdir $@
230
231 ./fallback.c : $(tinfo)/MKfallback.sh
232         $(SHELL) -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(INFOCMP_PATH) $(FALLBACK_LIST) >$@
233
234 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
235         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
236
237 init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
238         ./make_keys$(BUILD_EXEEXT) keys.list > $@
239
240 keys.list :     $(tinfo)/MKkeys_list.sh
241         AWK=$(AWK) $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
242
243 make_keys$(BUILD_EXEEXT) : \
244                 build.priv.h \
245                 $(tinfo)/make_keys.c \
246                 names.c
247         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
248
249 make_hash$(BUILD_EXEEXT) : \
250                 build.priv.h \
251                 $(tinfo)/make_hash.c \
252                 ../include/hashsize.h
253         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
254
255 report_offsets$(BUILD_EXEEXT) : \
256                 $(srcdir)/curses.priv.h \
257                 $(srcdir)/report_offsets.c
258         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(srcdir)/report_offsets.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
259         ./report_offsets$(BUILD_EXEEXT)
260
261 ./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
262         $(SHELL) -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
263
264 ./comp_captab.c: \
265                 make_hash$(BUILD_EXEEXT) \
266                 ../include/hashsize.h \
267                 $(tinfo)/MKcaptab.sh \
268                 $(tinfo)/MKcaptab.awk
269         $(SHELL) -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(CAPLIST) > $@
270
271 ./comp_userdefs.c: \
272                 make_hash$(BUILD_EXEEXT) \
273                 ../include/hashsize.h \
274                 $(tinfo)/MKuserdefs.sh
275         $(SHELL) -e $(tinfo)/MKuserdefs.sh $(AWK) $(USE_BIG_STRINGS) $(CAPLIST) > $@
276
277 ./lib_keyname.c: keys.list $(base)/MKkeyname.awk
278         $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
279
280 ./codes.c: $(tinfo)/MKcodes.awk
281         $(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
282
283 ./names.c: $(tinfo)/MKnames.awk
284         $(AWK) -f $(tinfo)/MKnames.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
285
286 ./unctrl.c: $(base)/MKunctrl.awk
287         echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
288
289 tags:
290         $(CTAGS) *.[ch] */*.[ch]
291
292 @MAKE_UPPER_TAGS@TAGS:
293 @MAKE_UPPER_TAGS@       $(ETAGS) *.[ch] */*.[ch]
294
295 mostlyclean ::
296         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac
297         -test -d trace || rm -f trace
298         -rm -f $(TEST_PROGS)
299
300 clean :: mostlyclean
301         -rm -f $(AUTO_SRC)
302         -rm -f make_keys$(BUILD_EXEEXT)
303         -rm -f make_hash$(BUILD_EXEEXT)
304         -rm -f report_offsets$(BUILD_EXEEXT)
305         -rm -rf .libs *.dSYM *.map
306
307 distclean :: clean
308         -rm -f Makefile
309
310 realclean :: distclean
311
312 # These rules are used to allow "make -n" to work on a clean directory-tree
313 ../include/hashsize.h \
314 ../include/parametrized.h \
315 ../include/term.h :
316         cd ../include; $(MAKE) $(CF_MFLAGS)
317
318 # These rules build test-programs for the modules that have test-drivers
319 test_progs : $(TEST_PROGS)
320
321 ./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
322         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
323
324 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
325         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
326
327 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
328         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
329
330 hashmap$x : $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_DEPS)
331         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_LDFLAGS)
332
333 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
334                 ../@DFT_OBJ_SUBDIR@/dump_entry$o
335         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry$o $(TEST_LDFLAGS)
336
337 link_test$x : ./link_test.c $(TEST_DEPS) \
338                 ../@DFT_OBJ_SUBDIR@/link_test$o
339         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS)
340
341 ../@DFT_OBJ_SUBDIR@/dump_entry$o:
342         cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o
343
344 report_hashing$x : \
345                 $(srcdir)/curses.priv.h \
346                 $(srcdir)/report_hashing.c $(TEST_DEPS)
347         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) report_hashing.c $(TEST_LDFLAGS)
348
349 ###############################################################################
350 # The remainder of this file is automatically generated during configuration
351 ###############################################################################