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