]> ncurses.scripts.mit.edu Git - ncurses.git/blob - progs/Makefile.in
ncurses 5.6 - patch 20061223
[ncurses.git] / progs / Makefile.in
1 # $Id: Makefile.in,v 1.70 2006/12/17 15:55:48 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2005,2006 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 ncurses utility programs.
35 #
36 # The variable 'srcdir' refers to the source-distribution, and can be set with
37 # the configure script by "--srcdir=DIR".
38 #
39 # The rules are organized to produce the libraries for the configured models,
40 # and the programs with the configured default model.
41
42 # turn off _all_ suffix rules; we'll generate our own
43 .SUFFIXES:
44
45 SHELL           = /bin/sh
46 THIS            = Makefile
47
48 CF_MFLAGS       = @cf_cv_makeflags@
49 @SET_MAKE@
50
51 x               = @EXEEXT@
52 o               = .@OBJEXT@
53
54 MODEL           = ../@DFT_OBJ_SUBDIR@
55 DESTDIR         = @DESTDIR@
56 top_srcdir      = @top_srcdir@
57 srcdir          = @srcdir@
58 prefix          = @prefix@
59 exec_prefix     = @exec_prefix@
60 bindir          = @bindir@
61 libdir          = @libdir@
62 includedir      = @includedir@
63 datadir         = @datadir@
64
65 LIBTOOL         = @LIBTOOL@
66 LIBTOOL_CLEAN   = @LIB_CLEAN@
67 LIBTOOL_COMPILE = @LIB_COMPILE@
68 LIBTOOL_LINK    = @LIB_LINK@
69 LIBTOOL_INSTALL = @LIB_INSTALL@
70 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
71
72 INSTALL         = @INSTALL@
73 INSTALL_PROG    = @INSTALL_PROGRAM@
74 transform       = @program_transform_name@
75
76 AWK             = @AWK@
77 LN_S            = @LN_S@
78
79 CC              = @CC@
80 CPP             = @CPP@
81 CFLAGS          = @CFLAGS@
82
83 INCDIR          = $(top_srcdir)/include
84 CPPFLAGS        = -I../progs -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
85
86 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
87
88 CFLAGS_LIBTOOL  = $(CCFLAGS)
89 CFLAGS_NORMAL   = $(CCFLAGS)
90 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
91 CFLAGS_PROFILE  = $(CCFLAGS) -pg
92 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
93
94 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
95
96 REL_VERSION     = @cf_cv_rel_version@
97 ABI_VERSION     = @cf_cv_abi_version@
98 LOCAL_LIBDIR    = @top_builddir@/lib
99
100 LD              = @LD@
101 LINK            = @LINK_PROGS@ $(LIBTOOL_LINK) $(CC)
102 LDFLAGS         = @EXTRA_LDFLAGS@ \
103                 @TINFO_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@
104
105 LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL)
106 LDFLAGS_NORMAL  = $(LDFLAGS) $(CFLAGS_NORMAL)
107 LDFLAGS_DEBUG   = $(LDFLAGS) $(CFLAGS_DEBUG)
108 LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) 
109 LDFLAGS_SHARED  = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
110
111 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
112
113 LINT            = @LINT@
114 LINT_OPTS       = @LINT_OPTS@
115 LINT_LIBS       = -lncurses @LIBS@
116
117 AUTO_SRC = \
118         termsort.c \
119         transform.h
120
121 # tic relies on direct access to the terminfo database
122 GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x
123 PUT_PROGS = @MAKE_TERMINFO@ tic$x
124 PROGS = $(PUT_PROGS) $(GET_PROGS)
125
126 # Default library, for linking applications
127 DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
128
129 HEADER_DEPS     = \
130         ../include/curses.h \
131         $(INCDIR)/term_entry.h \
132         $(INCDIR)/tic.h \
133         $(INCDIR)/nc_alloc.h
134
135 ################################################################################
136 all:            $(AUTO_SRC) $(PROGS)
137
138 sources:        $(AUTO_SRC)
139
140 install:        $(AUTO_SRC) install.progs
141 uninstall: uninstall.progs
142
143 # this line simplifies the configure-script
144 libs \
145 install.libs \
146 uninstall.libs:
147
148 TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
149
150 # transformed names for installing files
151 actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
152 actual_clear     = `echo clear$x|     $(TRANSFORM)`
153 actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
154 actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
155 actual_init      = `echo init$x|      $(TRANSFORM)`
156 actual_reset     = `echo reset$x|     $(TRANSFORM)`
157 actual_tic       = `echo tic$x|       $(TRANSFORM)`
158 actual_toe       = `echo toe$x|       $(TRANSFORM)`
159 actual_tput      = `echo tput$x|      $(TRANSFORM)`
160 actual_tset      = `echo tset$x|      $(TRANSFORM)`
161
162 # transformed names for comparing at runtime
163 define_captoinfo = `echo captoinfo|   $(TRANSFORM)`
164 define_infotocap = `echo infotocap|   $(TRANSFORM)`
165 define_init      = `echo init|        $(TRANSFORM)`
166 define_reset     = `echo reset|       $(TRANSFORM)`
167
168 transform.h :
169         echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@
170         echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@
171         echo "#define PROG_RESET     \"$(define_reset)\""     >>$@
172         echo "#define PROG_INIT      \"$(define_init)\""      >>$@
173
174 install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
175 @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
176 @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
177 @MAKE_TERMINFO@ @echo "linking $(actual_infotocap) to $(actual_tic)"
178 @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
179 @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
180 @MAKE_TERMINFO@ @echo "linking $(actual_captoinfo) to $(actual_tic)"
181 @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
182 @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
183         $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
184         $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
185         $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
186         $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
187         @echo "linking $(actual_reset) to $(actual_tset)"
188         -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
189         (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
190
191 uninstall.progs:
192 @MAKE_TERMINFO@ -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
193 @MAKE_TERMINFO@ -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
194 @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
195 @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
196         -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
197         -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
198         -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
199         -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
200         -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
201
202 $(DESTDIR)$(bindir) :
203         sh $(srcdir)/../mkinstalldirs $@
204
205 #
206 # Utilities normally built by make all start here
207 #
208
209 DEPS_TIC = \
210         $(MODEL)/tic$o \
211         $(MODEL)/dump_entry$o
212
213 tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
214         @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
215
216 DEPS_TOE = \
217         $(MODEL)/toe$o \
218         $(MODEL)/dump_entry$o
219
220 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
221         @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
222
223 DEPS_CLEAR = \
224         $(MODEL)/clear$o
225
226 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
227         @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
228
229 DEPS_TPUT = \
230         $(MODEL)/tput$o
231
232 tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
233         @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
234
235 DEPS_INFOCMP = \
236         $(MODEL)/infocmp$o \
237         $(MODEL)/dump_entry$o
238
239 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
240         @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
241
242 DEPS_TSET = \
243         $(MODEL)/tset$o \
244         $(MODEL)/dump_entry$o
245
246 tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
247         @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
248
249 termsort.c: $(srcdir)/MKtermsort.sh
250         sh $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
251
252 #
253 # Utility productions start here
254 #
255
256 tags:
257         ctags *.[ch]
258
259 @MAKE_UPPER_TAGS@TAGS:
260 @MAKE_UPPER_TAGS@       etags *.[ch]
261
262 mostlyclean ::
263         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
264
265 clean :: mostlyclean
266         -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
267         -rm -f $(AUTO_SRC)
268         -rm -f $(PROGS)
269         -rm -rf .libs
270
271 distclean :: clean
272         -rm -f Makefile
273
274 realclean :: distclean
275
276 # These rules are used to allow "make -n" to work on a clean directory-tree
277 ../include/hashsize.h \
278 ../include/parametrized.h \
279 ../include/term.h :
280         cd ../include; $(MAKE) $(CF_MFLAGS)
281 $(DEPS_CURSES) :
282         cd ../ncurses; $(MAKE) $(CF_MFLAGS)
283
284 lint:
285 @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
286 @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
287         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
288         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
289         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
290         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
291
292 ###############################################################################
293 # The remainder of this file is automatically generated during configuration
294 ###############################################################################