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