]> ncurses.scripts.mit.edu Git - ncurses.git/blob - ncurses/Makefile.in
ncurses 5.3
[ncurses.git] / ncurses / Makefile.in
1 # $Id: Makefile.in,v 1.84 2002/06/29 22:36:25 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998,1999,2000,2001,2002 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-2001
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 THIS            = Makefile
50
51 x               = @PROG_EXT@
52
53 CF_MFLAGS       = @cf_cv_makeflags@
54 @SET_MAKE@
55
56 MODEL           = @DFT_LWR_MODEL@
57 DESTDIR         = @DESTDIR@
58 top_srcdir      = @top_srcdir@
59 srcdir          = @srcdir@
60 prefix          = @prefix@
61 exec_prefix     = @exec_prefix@
62 bindir          = @bindir@
63 libdir          = @libdir@
64 includedir      = @includedir@
65 datadir         = @datadir@
66
67 LIBTOOL         = @LIBTOOL@
68
69 INSTALL         = @INSTALL@
70 INSTALL_LIB     = @INSTALL@ @INSTALL_LIB@
71 INSTALL_PROG    = @INSTALL_PROG@
72 INSTALL_DATA    = @INSTALL_DATA@
73
74 AR              = @AR@
75 AR_OPTS         = @AR_OPTS@
76 AWK             = @AWK@
77 LD              = @LD@
78 LN_S            = @LN_S@
79
80 CC              = @CC@
81 CPP             = @CPP@
82 CFLAGS          = @CFLAGS@
83
84 INCDIR          = $(srcdir)/../include
85 CPPFLAGS        = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@
86
87 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
88
89 HOSTCC          = @BUILD_CC@
90 HOSTCCFLAGS     = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @BUILD_CFLAGS@ @BUILD_CPPFLAGS@
91 HOSTLDFLAGS     = @BUILD_LDFLAGS@
92 HOSTLIBS        = @BUILD_LIBS@
93
94 CFLAGS_LIBTOOL  = $(CCFLAGS)
95 CFLAGS_NORMAL   = $(CCFLAGS)
96 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
97 CFLAGS_PROFILE  = $(CCFLAGS) -pg
98 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
99
100 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
101
102 LINK            = $(LIBTOOL) $(CC)
103 LDFLAGS         = @LDFLAGS@ @LD_MODEL@ @LIBS@
104
105 SHLIB_DIRS      = -L../lib
106 SHLIB_LIST      = $(SHLIB_DIRS) @SHLIB_LIST@
107 TINFO_LIST      = $(SHLIB_DIRS) @TINFO_LIST@
108
109 MK_SHARED_LIB   = @MK_SHARED_LIB@
110
111 NCURSES_MAJOR   = @NCURSES_MAJOR@
112 NCURSES_MINOR   = @NCURSES_MINOR@
113 REL_VERSION     = @cf_cv_rel_version@
114 ABI_VERSION     = @cf_cv_abi_version@
115
116 RANLIB          = @RANLIB@
117
118 IMPORT_LIB      = @IMPORT_LIB@
119 SHARED_LIB      = @SHARED_LIB@
120 LIBRARIES       = @LIBS_TO_MAKE@
121
122 LINT            = @LINT@
123 LINT_OPTS       = @LINT_OPTS@
124 LINT_LIBS       = -lncurses @LIBS@
125
126 FALLBACK_LIST   = @FALLBACK_LIST@
127
128 TERMINFO_CAPS   = $(top_srcdir)/include/@TERMINFO_CAPS@
129
130 AUTO_SRC = \
131         ../include/nomacros.h \
132         codes.c \
133         comp_captab.c \
134         expanded.c \
135         fallback.c \
136         init_keytry.h \
137         keys.list \
138         lib_gen.c \
139         lib_keyname.c \
140         link_test.c \
141         names.c \
142         unctrl.c
143
144 TEST_DEPS       = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
145 TEST_ARGS       = -L../lib -lncurses@DFT_ARG_SUFFIX@
146 TEST_LDFLAGS    = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
147
148 TEST_PROGS = \
149         captoinfo$x \
150         hardscroll$x \
151         link_test$x \
152         hashmap$x \
153         lib_mvcur$x
154
155 base    = $(srcdir)/base
156 serial  = $(srcdir)/tty
157 tinfo   = $(srcdir)/tinfo
158 trace   = $(srcdir)/trace
159 wide    = $(srcdir)/widechar
160
161 ################################################################################
162 all \
163 libs ::         $(AUTO_SRC) ../lib $(LIBRARIES)
164
165 sources:        $(AUTO_SRC)
166
167 $(DESTDIR)$(bindir) \
168 $(DESTDIR)$(libdir) :
169         sh $(srcdir)/../mkinstalldirs $@
170
171 ../lib : ; mkdir $@
172
173 fallback.c : $(tinfo)/MKfallback.sh
174         sh $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
175
176 lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
177         sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
178
179 ../include/nomacros.h : $(base)/MKlib_gen.sh ../include/curses.h
180         sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h | \
181                 fgrep undef >$@
182
183 init_keytry.h: make_keys$x keys.list
184         ./make_keys keys.list > $@
185
186 keys.list :     $(tinfo)/MKkeys_list.sh
187         AWK=$(AWK) sh $(tinfo)/MKkeys_list.sh $(TERMINFO_CAPS) | sort >$@
188
189 make_keys$x : \
190                 $(tinfo)/make_keys.c \
191                 names.c
192         $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) $(HOSTLIBS)
193
194 make_hash$x : \
195                 $(tinfo)/comp_hash.c \
196                 ../include/hashsize.h
197         $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) $(HOSTLIBS)
198
199 expanded.c : $(serial)/MKexpanded.sh
200         sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
201
202 comp_captab.c: \
203                 make_hash$x \
204                 ../include/hashsize.h \
205                 $(tinfo)/MKcaptab.awk
206         sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ > $@
207
208 lib_keyname.c: keys.list $(base)/MKkeyname.awk
209         $(AWK) -f $(base)/MKkeyname.awk keys.list > $@
210
211 names.c codes.c: $(tinfo)/MKnames.awk
212         $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/@TERMINFO_CAPS@
213         cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >names.c
214         cat namehdr boolcodes numcodes strcodes codeftr >codes.c
215         -rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes
216
217 unctrl.c: $(base)/MKunctrl.awk
218         echo | $(AWK) -f $(base)/MKunctrl.awk >$@
219
220 tags:
221         ctags *.[ch]
222
223 @MAKE_UPPER_TAGS@TAGS:
224 @MAKE_UPPER_TAGS@       etags *.[ch]
225
226 mostlyclean ::
227         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
228         -rm -f $(TEST_PROGS)
229
230 clean :: mostlyclean
231         -rm -f $(AUTO_SRC)
232         -rm -f make_keys$x
233         -rm -f make_hash$x
234         -rm -rf .libs
235
236 distclean :: clean
237         -rm -f Makefile
238
239 realclean :: distclean
240
241 # These rules are used to allow "make -n" to work on a clean directory-tree
242 ../include/hashsize.h \
243 ../include/parametrized.h \
244 ../include/term.h :
245         cd ../include; $(MAKE) $(CF_MFLAGS)
246
247 # These rules build test-programs for the modules that have test-drivers
248 test_progs : $(TEST_PROGS)
249
250 link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
251         sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
252
253 captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
254         @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
255
256 hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
257         @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
258
259 hashmap$x : $(serial)/hashmap.c $(TEST_DEPS)
260         @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(TEST_LDFLAGS)
261
262 lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
263                 ../@DFT_OBJ_SUBDIR@/dump_entry.o
264         @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS)
265
266 link_test$x : link_test.c $(TEST_DEPS) \
267                 ../@DFT_OBJ_SUBDIR@/link_test.o
268         @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test.o $(TEST_LDFLAGS)
269
270 ../@DFT_OBJ_SUBDIR@/dump_entry.o:
271         cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o
272
273 ###############################################################################
274 # The remainder of this file is automatically generated during configuration
275 ###############################################################################