1 # $Id: Makefile.in,v 1.125 2010/03/13 19:29:55 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. #
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: #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software. #
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. #
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 #
28 ##############################################################################
30 # Author: Thomas E. Dickey 1996-on
32 # Makefile for ncurses source code.
34 # This makes the following:
37 # libraries (normal/debug/profile/shared)
39 # The variable 'srcdir' refers to the source-distribution, and can be set with
40 # the configure script by "--srcdir=DIR".
42 # The rules are organized to produce the libraries for the configured models,
43 # and the programs with the configured default model.
45 # turn off _all_ suffix rules; we'll generate our own
51 CF_MFLAGS = @cf_cv_makeflags@
57 MODEL = @DFT_LWR_MODEL@
59 top_srcdir = @top_srcdir@
62 exec_prefix = @exec_prefix@
65 includedir = @includedir@
69 LIBTOOL_CLEAN = @LIB_CLEAN@
70 LIBTOOL_COMPILE = @LIB_COMPILE@
71 LIBTOOL_LINK = @LIB_LINK@
72 LIBTOOL_INSTALL = @LIB_INSTALL@
73 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
77 INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
78 INSTALL_PROG = @INSTALL_PROGRAM@
79 INSTALL_DATA = @INSTALL_DATA@
91 INCDIR = $(srcdir)/../include
92 CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@
94 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
96 BUILD_CPPFLAGS = -I../include -DUSE_BUILD_CC @BUILD_CPPFLAGS@
98 BUILD_CCFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) -I$(INCDIR) $(BUILD_CPPFLAGS) @BUILD_CFLAGS@
99 BUILD_LDFLAGS = @BUILD_LDFLAGS@
100 BUILD_LIBS = @BUILD_LIBS@
102 # The executables built in this directory are used for generating source that
103 # is compiled into the build, or are test-programs that are not installed.
105 BUILD_EXEEXT = @BUILD_EXEEXT@
108 CFLAGS_LIBTOOL = $(CCFLAGS)
109 CFLAGS_NORMAL = $(CCFLAGS)
110 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
111 CFLAGS_PROFILE = $(CCFLAGS) -pg
112 CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
114 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
117 LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
119 SHLIB_DIRS = -L../lib
120 SHLIB_LIST = $(SHLIB_DIRS) @SHLIB_LIST@
121 TINFO_LIST = $(SHLIB_DIRS) @TINFO_LIST@
122 TICS_LIST = $(SHLIB_DIRS) @TICS_LIST@
124 MK_SHARED_LIB = @MK_SHARED_LIB@
126 NCURSES_MAJOR = @NCURSES_MAJOR@
127 NCURSES_MINOR = @NCURSES_MINOR@
128 REL_VERSION = @cf_cv_rel_version@
129 ABI_VERSION = @cf_cv_abi_version@
133 LIBRARIES = @LIBS_TO_MAKE@
136 LINT_OPTS = @LINT_OPTS@
137 LINT_LIBS = -lncurses @LIBS@
139 FALLBACK_LIST = @FALLBACK_LIST@
141 USE_BIG_STRINGS = @USE_BIG_STRINGS@
142 TERMINFO_CAPS = $(top_srcdir)/include/@TERMINFO_CAPS@
158 $(srcdir)/curses.priv.h \
159 ../include/ncurses_dll.h \
160 ../include/ncurses_cfg.h \
161 ../include/curses.h \
162 $(INCDIR)/nc_panel.h \
164 $(INCDIR)/term_entry.h \
165 $(INCDIR)/nc_tparm.h \
166 $(INCDIR)/nc_alloc.h \
169 TEST_DEPS = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
170 TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
171 TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
180 base = $(srcdir)/base
181 serial = $(srcdir)/tty
182 tinfo = $(srcdir)/tinfo
183 trace = $(srcdir)/trace
184 wide = $(srcdir)/widechar
185 win32con = $(srcdir)/win32con
187 ################################################################################
189 libs :: $(AUTO_SRC) ../lib $(LIBRARIES)
193 $(DESTDIR)$(bindir) \
194 $(DESTDIR)$(libdir) :
195 sh $(srcdir)/../mkdirs.sh $@
199 ./fallback.c : $(tinfo)/MKfallback.sh
200 sh -e $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
202 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
203 sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
205 init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
206 ./make_keys$(BUILD_EXEEXT) keys.list > $@
208 keys.list : $(tinfo)/MKkeys_list.sh
209 AWK=$(AWK) sh $(tinfo)/MKkeys_list.sh $(TERMINFO_CAPS) | sort >$@
211 make_keys$(BUILD_EXEEXT) : \
212 $(tinfo)/make_keys.c \
214 $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
216 make_hash$(BUILD_EXEEXT) : \
217 $(tinfo)/make_hash.c \
218 ../include/hashsize.h
219 $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
221 ./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
222 sh -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
225 make_hash$(BUILD_EXEEXT) \
226 ../include/hashsize.h \
227 $(tinfo)/MKcaptab.sh \
228 $(tinfo)/MKcaptab.awk
229 sh -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(srcdir)/../include/@TERMINFO_CAPS@ > $@
231 ./lib_keyname.c: keys.list $(base)/MKkeyname.awk
232 $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
234 ./codes.c: $(tinfo)/MKcodes.awk
235 $(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
237 ./names.c: $(tinfo)/MKnames.awk
238 $(AWK) -f $(tinfo)/MKnames.awk bigstrings=$(USE_BIG_STRINGS) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
240 ./unctrl.c: $(base)/MKunctrl.awk
241 echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
244 ctags *.[ch] */*.[ch]
246 @MAKE_UPPER_TAGS@TAGS:
247 @MAKE_UPPER_TAGS@ etags *.[ch] */*.[ch]
250 -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
255 -rm -f make_keys$(BUILD_EXEEXT)
256 -rm -f make_hash$(BUILD_EXEEXT)
262 realclean :: distclean
264 # These rules are used to allow "make -n" to work on a clean directory-tree
265 ../include/hashsize.h \
266 ../include/parametrized.h \
268 cd ../include; $(MAKE) $(CF_MFLAGS)
270 # These rules build test-programs for the modules that have test-drivers
271 test_progs : $(TEST_PROGS)
273 ./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
274 sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
276 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
277 @ECHO_LINK@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
279 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
280 @ECHO_LINK@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
282 hashmap$x : $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_DEPS)
283 @ECHO_LINK@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(serial)/hardscroll.c $(TEST_LDFLAGS)
285 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
286 ../@DFT_OBJ_SUBDIR@/dump_entry$o
287 @ECHO_LINK@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry$o $(TEST_LDFLAGS)
289 link_test$x : ./link_test.c $(TEST_DEPS) \
290 ../@DFT_OBJ_SUBDIR@/link_test$o
291 @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS)
293 ../@DFT_OBJ_SUBDIR@/dump_entry$o:
294 cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o
296 ###############################################################################
297 # The remainder of this file is automatically generated during configuration
298 ###############################################################################