ncurses 5.9 - patch 20130805
[ncurses.git] / ncurses / Makefile.in
1 # $Id: Makefile.in,v 1.138 2013/08/04 20:20:45 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2011,2012 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           = /bin/sh
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 LIBTOOL         = @LIBTOOL@
74 LIBTOOL_CLEAN   = @LIB_CLEAN@
75 LIBTOOL_COMPILE = @LIB_COMPILE@
76 LIBTOOL_LINK    = @LIB_LINK@
77 LIBTOOL_INSTALL = @LIB_INSTALL@
78 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
79 LT_UNDEF        = @LT_UNDEF@
80
81 INSTALL         = @INSTALL@
82 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
83 INSTALL_PROG    = @INSTALL_PROGRAM@
84 INSTALL_DATA    = @INSTALL_DATA@
85
86 AR              = @AR@
87 ARFLAGS         = @ARFLAGS@
88 AWK             = @AWK@
89 LD              = @LD@
90 LN_S            = @LN_S@
91 NM              = @NM@
92
93 CTAGS           = @CTAGS@
94 ETAGS           = @ETAGS@
95
96 CC              = @CC@
97 CPP             = @CPP@
98 CFLAGS          = @CFLAGS@
99
100 INCDIR          = $(srcdir)/../include
101 CPPFLAGS        = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@
102
103 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
104
105 BUILD_CPPFLAGS  = -I../include -DUSE_BUILD_CC @BUILD_CPPFLAGS@
106 BUILD_CC        = @BUILD_CC@
107 BUILD_CCFLAGS   = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) -I$(INCDIR) $(BUILD_CPPFLAGS) @BUILD_CFLAGS@
108 BUILD_LDFLAGS   = @BUILD_LDFLAGS@
109 BUILD_LIBS      = @BUILD_LIBS@
110
111 # The executables built in this directory are used for generating source that
112 # is compiled into the build, or are test-programs that are not installed.
113
114 BUILD_EXEEXT    = @BUILD_EXEEXT@
115 x               = @EXEEXT@
116
117 CFLAGS_LIBTOOL  = $(CCFLAGS)
118 CFLAGS_NORMAL   = $(CCFLAGS)
119 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
120 CFLAGS_PROFILE  = $(CCFLAGS) -pg
121 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
122
123 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
124
125 LINK            = $(LIBTOOL)
126 LDFLAGS         = @LDFLAGS@ @LD_MODEL@ @LIBS@
127
128 SHLIB_DIRS      = -L../lib
129 SHLIB_LIST      = $(SHLIB_DIRS) @SHLIB_LIST@
130 TINFO_LIST      = $(SHLIB_DIRS) @TINFO_LIST@
131 TICS_LIST       = $(SHLIB_DIRS) @TICS_LIST@
132
133 RPATH_LIST      = @RPATH_LIST@
134 MK_SHARED_LIB   = @MK_SHARED_LIB@
135
136 NCURSES_MAJOR   = @NCURSES_MAJOR@
137 NCURSES_MINOR   = @NCURSES_MINOR@
138 REL_VERSION     = @cf_cv_rel_version@
139 ABI_VERSION     = @cf_cv_abi_version@
140
141 RANLIB          = @LIB_PREP@
142
143 LIBRARIES       = @Libs_To_Make@
144
145 LINT            = @LINT@
146 LINT_OPTS       = @LINT_OPTS@
147 LINT_LIBS       = -lncurses @LIBS@
148
149 FALLBACK_LIST   = @FALLBACK_LIST@
150
151 USE_BIG_STRINGS = @USE_BIG_STRINGS@
152 TERMINFO_CAPS   = $(top_srcdir)/include/@TERMINFO_CAPS@
153
154 TERMINFO        = @TERMINFO@
155 TERMINFO_SRC    = @TERMINFO_SRC@
156 TIC_PATH        = @TIC_PATH@
157
158 AUTO_SRC = \
159         ./codes.c \
160         ./comp_captab.c \
161         ./expanded.c \
162         ./fallback.c \
163         ./lib_gen.c \
164         ./lib_keyname.c \
165         ./link_test.c \
166         ./names.c \
167         ./unctrl.c \
168         init_keytry.h \
169         keys.list
170
171 HEADER_DEPS     = \
172         $(srcdir)/curses.priv.h \
173         ../include/ncurses_dll.h \
174         ../include/ncurses_cfg.h \
175         ../include/curses.h \
176         $(INCDIR)/nc_panel.h \
177         ../include/term.h \
178         $(INCDIR)/term_entry.h \
179         $(INCDIR)/nc_tparm.h \
180         $(INCDIR)/nc_alloc.h \
181         $(INCDIR)/nc_mingw.h
182
183 TEST_DEPS       = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
184 TEST_ARGS       = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ 
185 TEST_LDFLAGS    = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
186
187 TEST_PROGS = \
188         captoinfo$x \
189         hardscroll$x \
190         link_test$x \
191         hashmap$x \
192         lib_mvcur$x
193
194 base     = $(srcdir)/base
195 serial   = $(srcdir)/tty
196 tinfo    = $(srcdir)/tinfo
197 trace    = $(srcdir)/trace
198 wide     = $(srcdir)/widechar
199 win32con = $(srcdir)/win32con
200
201 ################################################################################
202 all \
203 libs ::         $(AUTO_SRC) ../lib $(LIBRARIES)
204
205 sources:        $(AUTO_SRC)
206
207 $(DESTDIR)$(bindir) \
208 $(DESTDIR)$(libdir) :
209         mkdir -p $@
210
211 ../lib : ; mkdir $@
212
213 ./fallback.c : $(tinfo)/MKfallback.sh
214         sh -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(FALLBACK_LIST) >$@
215
216 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
217         sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
218
219 init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
220         ./make_keys$(BUILD_EXEEXT) keys.list > $@
221
222 keys.list :     $(tinfo)/MKkeys_list.sh
223         AWK=$(AWK) sh $(tinfo)/MKkeys_list.sh $(TERMINFO_CAPS) | sort >$@
224
225 make_keys$(BUILD_EXEEXT) : \
226                 $(tinfo)/make_keys.c \
227                 names.c
228         $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
229
230 make_hash$(BUILD_EXEEXT) : \
231                 $(tinfo)/make_hash.c \
232                 ../include/hashsize.h
233         $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
234
235 ./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
236         sh -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
237
238 ./comp_captab.c: \
239                 make_hash$(BUILD_EXEEXT) \
240                 ../include/hashsize.h \
241                 $(tinfo)/MKcaptab.sh \
242                 $(tinfo)/MKcaptab.awk
243         sh -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(srcdir)/../include/@TERMINFO_CAPS@ > $@
244
245 ./lib_keyname.c: keys.list $(base)/MKkeyname.awk
246         $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
247
248 ./codes.c: $(tinfo)/MKcodes.awk
249         $(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
250
251 ./names.c: $(tinfo)/MKnames.awk
252         $(AWK) -f $(tinfo)/MKnames.awk bigstrings=$(USE_BIG_STRINGS) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
253
254 ./unctrl.c: $(base)/MKunctrl.awk
255         echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
256
257 tags:
258         $(CTAGS) *.[ch] */*.[ch]
259
260 @MAKE_UPPER_TAGS@TAGS:
261 @MAKE_UPPER_TAGS@       $(ETAGS) *.[ch] */*.[ch]
262
263 ncurses.map : $(LIBRARIES)
264         $(NM) -p $(LIBRARIES) >$@
265
266 mostlyclean ::
267         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
268         -rm -f $(TEST_PROGS)
269
270 clean :: mostlyclean
271         -rm -f $(AUTO_SRC)
272         -rm -f make_keys$(BUILD_EXEEXT)
273         -rm -f make_hash$(BUILD_EXEEXT)
274         -rm -rf .libs *.dSYM *.map
275
276 distclean :: clean
277         -rm -f Makefile
278
279 realclean :: distclean
280
281 # These rules are used to allow "make -n" to work on a clean directory-tree
282 ../include/hashsize.h \
283 ../include/parametrized.h \
284 ../include/term.h :
285         cd ../include; $(MAKE) $(CF_MFLAGS)
286
287 # These rules build test-programs for the modules that have test-drivers
288 test_progs : $(TEST_PROGS)
289
290 ./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
291         sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
292
293 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
294         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
295
296 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
297         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
298
299 hashmap$x : $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_DEPS)
300         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_LDFLAGS)
301
302 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
303                 ../@DFT_OBJ_SUBDIR@/dump_entry$o
304         @ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry$o $(TEST_LDFLAGS)
305
306 link_test$x : ./link_test.c $(TEST_DEPS) \
307                 ../@DFT_OBJ_SUBDIR@/link_test$o
308         @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS)
309
310 ../@DFT_OBJ_SUBDIR@/dump_entry$o:
311         cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o
312
313 ###############################################################################
314 # The remainder of this file is automatically generated during configuration
315 ###############################################################################