ncurses 6.1 - patch 20190907
[ncurses.git] / ncurses / Makefile.in
1 # $Id: Makefile.in,v 1.163 2019/06/30 14:57:27 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.                #
4 #                                                                            #
5 # Permission is hereby granted, free of charge, to any person obtaining a    #
6 # copy of this software and associated documentation files (the "Software"), #
7 # to deal in the Software without restriction, including without limitation  #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the  #
11 # following conditions:                                                      #
12 #                                                                            #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software.                        #
15 #                                                                            #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
22 # DEALINGS IN THE SOFTWARE.                                                  #
23 #                                                                            #
24 # Except as contained in this notice, the name(s) of the above copyright     #
25 # holders shall not be used in advertising or otherwise to promote the sale, #
26 # use or other dealings in this Software without prior written               #
27 # authorization.                                                             #
28 ##############################################################################
29 #
30 # Author: Thomas E. Dickey 1996-on
31 #
32 # Makefile for ncurses source code.
33 #
34 # This makes the following:
35 #       programs
36 #       includes
37 #       libraries (normal/debug/profile/shared)
38 #
39 # The variable 'srcdir' refers to the source-distribution, and can be set with
40 # the configure script by "--srcdir=DIR".
41 #
42 # The rules are organized to produce the libraries for the configured models,
43 # and the programs with the configured default model.
44
45 # turn off _all_ suffix rules; we'll generate our own
46 .SUFFIXES:
47
48 SHELL           = @SHELL@
49 VPATH           = @srcdir@
50 THIS            = Makefile
51
52 CF_MFLAGS       = @cf_cv_makeflags@
53 @SET_MAKE@
54
55 x               = @EXEEXT@
56 o               = .@OBJEXT@
57
58 MODEL           = @DFT_LWR_MODEL@
59 DESTDIR         = @DESTDIR@
60 top_srcdir      = @top_srcdir@
61 srcdir          = @srcdir@
62 prefix          = @prefix@
63 exec_prefix     = @exec_prefix@
64 bindir          = @bindir@
65 libdir          = @libdir@
66 includedir      = @includedir@
67 datarootdir     = @datarootdir@
68 datadir         = @datadir@
69 includesubdir   = @includesubdir@
70
71 INCLUDEDIR      = $(DESTDIR)$(includedir)$(includesubdir)
72
73 PACKAGE         = @PACKAGE@
74
75 LIBTOOL         = @LIBTOOL@
76 LIBTOOL_OPTS    = @LIBTOOL_OPTS@ @EXPORT_SYMS@
77 LIBTOOL_CLEAN   = @LIB_CLEAN@
78 LIBTOOL_COMPILE = @LIB_COMPILE@
79 LIBTOOL_LINK    = @LIB_LINK@
80 LIBTOOL_INSTALL = @LIB_INSTALL@
81 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
82 LT_UNDEF        = @LT_UNDEF@
83
84 INSTALL         = @INSTALL@
85 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
86 INSTALL_PROG    = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
87 INSTALL_DATA    = @INSTALL_DATA@
88
89 AR              = @AR@
90 ARFLAGS         = @ARFLAGS@
91 AWK             = @AWK@
92 LD              = @LD@
93 LN_S            = @LN_S@
94 NM              = @NM@
95
96 CTAGS           = @CTAGS@
97 ETAGS           = @ETAGS@
98
99 CC              = @CC@
100 CPP             = @CPP@
101 CFLAGS          = @CFLAGS@
102
103 INCDIR          = $(srcdir)/../include
104 CPPFLAGS        = -DHAVE_CONFIG_H -I../ncurses @CPPFLAGS@
105
106 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
107
108 BUILD_CPPFLAGS  = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ 
109 BUILD_CC        = @BUILD_CC@
110 BUILD_CCFLAGS   = @BUILD_CFLAGS@
111 BUILD_LDFLAGS   = @BUILD_LDFLAGS@
112 BUILD_LIBS      = @BUILD_LIBS@
113
114 # The executables built in this directory are used for generating source that
115 # is compiled into the build, or are test-programs that are not installed.
116
117 BUILD_EXEEXT    = @BUILD_EXEEXT@
118 x               = @EXEEXT@
119
120 CFLAGS_LIBTOOL  = $(CCFLAGS)
121 CFLAGS_NORMAL   = $(CCFLAGS)
122 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
123 CFLAGS_PROFILE  = $(CCFLAGS) -pg
124 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
125
126 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
127
128 LINK            = $(LIBTOOL)
129 LDFLAGS         = @LDFLAGS@ @LD_MODEL@ @LIBS@
130
131 SHLIB_DIRS      = -L../lib
132 SHLIB_LIST      = $(SHLIB_DIRS) @SHLIB_LIST@
133 TINFO_LIST      = $(SHLIB_DIRS) @TINFO_LIST@
134 TICS_LIST       = $(SHLIB_DIRS) @TICS_LIST@
135
136 RPATH_LIST      = @RPATH_LIST@
137 RESULTING_SYMS  = @RESULTING_SYMS@
138 VERSIONED_SYMS  = @VERSIONED_SYMS@
139 MK_SHARED_LIB   = @MK_SHARED_LIB@
140
141 NCURSES_MAJOR   = @NCURSES_MAJOR@
142 NCURSES_MINOR   = @NCURSES_MINOR@
143 REL_VERSION     = @cf_cv_rel_version@
144 ABI_VERSION     = @cf_cv_abi_version@
145
146 RANLIB          = @LIB_PREP@
147
148 LIBRARIES       = @Libs_To_Make@
149
150 LINT            = @LINT@
151 LINT_OPTS       = @LINT_OPTS@
152 LINT_LIBS       = -lncurses @LIBS@
153
154 FALLBACK_LIST   = @FALLBACK_LIST@
155
156 USE_BIG_STRINGS = @USE_BIG_STRINGS@
157 TERMINFO_CAPS   = $(top_srcdir)/include/@TERMINFO_CAPS@
158 CAPLIST         = $(TERMINFO_CAPS) $(top_srcdir)/include/Caps-ncurses
159
160 TERMINFO        = @TERMINFO@
161 TERMINFO_SRC    = @TERMINFO_SRC@
162 TIC_PATH        = @TIC@
163 INFOCMP_PATH    = @INFOCMP@
164
165 AUTO_SRC = \
166         ./codes.c \
167         ./comp_captab.c \
168         ./comp_userdefs.c \
169         ./expanded.c \
170         ./fallback.c \
171         ./lib_gen.c \
172         ./lib_keyname.c \
173         ./link_test.c \
174         ./names.c \
175         ./unctrl.c \
176         init_keytry.h \
177         keys.list
178
179 HEADER_DEPS     = \
180         $(srcdir)/curses.priv.h \
181         ../include/ncurses_dll.h \
182         ../include/ncurses_cfg.h \
183         ../include/curses.h \
184         $(INCDIR)/nc_panel.h \
185         ../include/term.h \
186         $(INCDIR)/term_entry.h \
187         $(INCDIR)/nc_tparm.h \
188         $(INCDIR)/nc_alloc.h \
189         $(INCDIR)/nc_mingw.h
190
191 TEST_DEPS       = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
192 TEST_ARGS       = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ 
193 TEST_LDFLAGS    = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
194
195 TEST_PROGS = \
196         captoinfo$x \
197         hardscroll$x \
198         link_test$x \
199         hashmap$x \
200         lib_mvcur$x
201
202 LOCAL_LIBDIR    = @top_builddir@/lib
203
204 base     = $(srcdir)/base
205 serial   = $(srcdir)/tty
206 tinfo    = $(srcdir)/tinfo
207 trace    = $(srcdir)/trace
208 wide     = $(srcdir)/widechar
209 win32con = $(srcdir)/win32con
210
211 ################################################################################
212 all libs ::     $(AUTO_SRC) ../lib $(LIBRARIES)
213
214 @CHECK_BUILD@all libs ::        report_offsets$(BUILD_EXEEXT) 
215
216 sources:        $(AUTO_SRC)
217
218 $(DESTDIR)$(bindir) \
219 $(DESTDIR)$(libdir) :
220         mkdir -p $@
221
222 ../lib : ; mkdir $@
223
224 ./fallback.c : $(tinfo)/MKfallback.sh
225         $(SHELL) -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(INFOCMP_PATH) $(FALLBACK_LIST) >$@
226
227 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
228         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
229
230 init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
231         ./make_keys$(BUILD_EXEEXT) keys.list > $@
232
233 keys.list :     $(tinfo)/MKkeys_list.sh
234         AWK=$(AWK) $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
235
236 make_keys$(BUILD_EXEEXT) : \
237                 build.priv.h \
238                 $(tinfo)/make_keys.c \
239                 names.c
240         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
241
242 make_hash$(BUILD_EXEEXT) : \
243                 build.priv.h \
244                 $(tinfo)/make_hash.c \
245                 ../include/hashsize.h
246         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
247
248 report_offsets$(BUILD_EXEEXT) : \
249                 $(srcdir)/curses.priv.h \
250                 $(srcdir)/report_offsets.c
251         $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(srcdir)/report_offsets.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
252         ./report_offsets$(BUILD_EXEEXT)
253
254 ./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
255         $(SHELL) -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
256
257 ./comp_captab.c: \
258                 make_hash$(BUILD_EXEEXT) \
259                 ../include/hashsize.h \
260                 $(tinfo)/MKcaptab.sh \
261                 $(tinfo)/MKcaptab.awk
262         $(SHELL) -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(CAPLIST) > $@
263
264 ./comp_userdefs.c: \
265                 make_hash$(BUILD_EXEEXT) \
266                 ../include/hashsize.h \
267                 $(tinfo)/MKuserdefs.sh
268         $(SHELL) -e $(tinfo)/MKuserdefs.sh $(AWK) $(USE_BIG_STRINGS) $(CAPLIST) > $@
269
270 ./lib_keyname.c: keys.list $(base)/MKkeyname.awk
271         $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
272
273 ./codes.c: $(tinfo)/MKcodes.awk
274         $(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
275
276 ./names.c: $(tinfo)/MKnames.awk
277         $(AWK) -f $(tinfo)/MKnames.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
278
279 ./unctrl.c: $(base)/MKunctrl.awk
280         echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
281
282 tags:
283         $(CTAGS) *.[ch] */*.[ch]
284
285 @MAKE_UPPER_TAGS@TAGS:
286 @MAKE_UPPER_TAGS@       $(ETAGS) *.[ch] */*.[ch]
287
288 mostlyclean ::
289         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac
290         -test -d trace || rm -f trace
291         -rm -f $(TEST_PROGS)
292
293 clean :: mostlyclean
294         -rm -f $(AUTO_SRC)
295         -rm -f make_keys$(BUILD_EXEEXT)
296         -rm -f make_hash$(BUILD_EXEEXT)
297         -rm -f report_offsets$(BUILD_EXEEXT)
298         -rm -rf .libs *.dSYM *.map
299
300 distclean :: clean
301         -rm -f Makefile
302
303 realclean :: distclean
304
305 # These rules are used to allow "make -n" to work on a clean directory-tree
306 ../include/hashsize.h \
307 ../include/parametrized.h \
308 ../include/term.h :
309         cd ../include; $(MAKE) $(CF_MFLAGS)
310
311 # These rules build test-programs for the modules that have test-drivers
312 test_progs : $(TEST_PROGS)
313
314 ./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
315         $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
316
317 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
318         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
319
320 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
321         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
322
323 hashmap$x : $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_DEPS)
324         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_LDFLAGS)
325
326 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
327                 ../@DFT_OBJ_SUBDIR@/dump_entry$o
328         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry$o $(TEST_LDFLAGS)
329
330 link_test$x : ./link_test.c $(TEST_DEPS) \
331                 ../@DFT_OBJ_SUBDIR@/link_test$o
332         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS)
333
334 ../@DFT_OBJ_SUBDIR@/dump_entry$o:
335         cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o
336
337 ###############################################################################
338 # The remainder of this file is automatically generated during configuration
339 ###############################################################################