]> ncurses.scripts.mit.edu Git - ncurses.git/blob - progs/Makefile.in
a0a296ef935b47f1832945b82aa57c272c89de01
[ncurses.git] / progs / Makefile.in
1 # $Id: Makefile.in,v 1.41 2000/07/08 01:56:25 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2000 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 <dickey@clark.net> 1996,1997
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 x               = @PROG_EXT@
51
52 MODEL           = ../@DFT_OBJ_SUBDIR@
53 INSTALL_PREFIX  = @INSTALL_PREFIX@
54 srcdir          = @srcdir@
55 prefix          = @prefix@
56 exec_prefix     = @exec_prefix@
57 bindir          = @bindir@
58 libdir          = @libdir@
59 includedir      = @includedir@
60 datadir         = @datadir@
61
62 ticdir          = $(datadir)/terminfo
63
64 INSTALL         = @INSTALL@
65 INSTALL_PROGRAM = @INSTALL_PROGRAM@
66
67 AWK             = @AWK@
68 LN_S            = @LN_S@
69
70 CC              = @CC@
71 CPP             = @CPP@
72 CFLAGS          = @CFLAGS@
73
74 INCDIR          = $(srcdir)/../include
75 CPPFLAGS        = -I../progs -I$(srcdir) @CPPFLAGS@ \
76                   -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
77
78 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
79
80 CFLAGS_NORMAL   = $(CCFLAGS)
81 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
82 CFLAGS_PROFILE  = $(CCFLAGS) -pg
83 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
84
85 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
86
87 LD              = @LD@
88 LINK            = @LINK_PROGS@ $(CC)
89 LDFLAGS         = @EXTRA_LDFLAGS@ \
90                 @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
91
92 LDFLAGS_NORMAL  = $(LDFLAGS)
93 LDFLAGS_DEBUG   = $(LDFLAGS) @CC_G_OPT@
94 LDFLAGS_PROFILE = $(LDFLAGS) -pg
95 LDFLAGS_SHARED  = $(LDFLAGS) @LD_SHARED_OPTS@
96
97 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
98
99 LINT            = @LINT@
100 LINT_OPTS       = @LINT_OPTS@
101 LINT_LIBS       = -lncurses @LIBS@
102
103 AUTO_SRC = \
104         termsort.c
105
106 PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x
107
108 TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
109
110 # Default library, for linking applications
111 DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
112
113 ################################################################################
114 all:            $(AUTO_SRC) $(PROGS) 
115
116 sources:        $(AUTO_SRC)
117
118 install: install.progs 
119 uninstall: uninstall.progs 
120
121 # this line simplifies the configure-script
122 libs \
123 install.libs \
124 uninstall.libs:
125
126 install.progs: $(PROGS) $(INSTALL_PREFIX)$(bindir)
127         $(INSTALL_PROGRAM) tic$x     $(INSTALL_PREFIX)$(bindir)/tic$x
128         $(INSTALL_PROGRAM) toe$x     $(INSTALL_PREFIX)$(bindir)/toe$x
129         $(INSTALL_PROGRAM) infocmp$x $(INSTALL_PREFIX)$(bindir)/infocmp$x
130         $(INSTALL_PROGRAM) clear$x   $(INSTALL_PREFIX)$(bindir)/clear$x
131         $(INSTALL_PROGRAM) tput$x    $(INSTALL_PREFIX)$(bindir)/tput$x
132         $(INSTALL_PROGRAM) tset$x    $(INSTALL_PREFIX)$(bindir)/tset$x
133         @echo "linking captoinfo to tic"
134         -@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
135         (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x captoinfo$x)
136         @echo "linking infotocap to tic"
137         -@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
138         (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic$x infotocap$x)
139         @echo "linking reset to tset"
140         -@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
141         (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tset$x reset$x)
142
143 uninstall.progs:
144         -@rm -f $(INSTALL_PREFIX)$(bindir)/tic$x
145         -@rm -f $(INSTALL_PREFIX)$(bindir)/toe$x
146         -@rm -f $(INSTALL_PREFIX)$(bindir)/infocmp$x
147         -@rm -f $(INSTALL_PREFIX)$(bindir)/clear$x
148         -@rm -f $(INSTALL_PREFIX)$(bindir)/tput$x
149         -@rm -f $(INSTALL_PREFIX)$(bindir)/tset$x
150         -@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo$x
151         -@rm -f $(INSTALL_PREFIX)$(bindir)/infotocap$x
152         -@rm -f $(INSTALL_PREFIX)$(bindir)/reset$x
153
154 $(INSTALL_PREFIX)$(bindir) :
155         $(srcdir)/../mkinstalldirs $@
156
157 #
158 # Utilities normally built by make all start here
159 #
160
161 DEPS_TIC = \
162         $(MODEL)/tic.o \
163         $(MODEL)/dump_entry.o
164
165 tic$x: $(DEPS_TIC) $(DEPS_CURSES)
166         @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
167
168 DEPS_TOE = \
169         $(MODEL)/toe.o \
170         $(MODEL)/dump_entry.o
171
172 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
173         @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
174
175 DEPS_CLEAR = \
176         $(MODEL)/clear.o
177
178 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
179         @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
180
181 DEPS_TPUT = \
182         $(MODEL)/tput.o
183
184 tput$x: $(DEPS_TPUT) $(DEPS_CURSES)
185         @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
186
187 DEPS_INFOCMP = \
188         $(MODEL)/infocmp.o \
189         $(MODEL)/dump_entry.o
190
191 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
192         @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
193
194 DEPS_TSET = \
195         $(MODEL)/tset.o \
196         $(MODEL)/dump_entry.o
197
198 tset$x: $(DEPS_TSET) $(DEPS_CURSES)
199         @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
200
201 termsort.c: $(srcdir)/MKtermsort.sh
202         sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
203
204 #
205 # Utility productions start here
206 #
207
208 tags:
209         ctags *.[ch]
210
211 TAGS:
212         etags *.[ch]
213
214 mostlyclean ::
215         -rm -f core tags TAGS *~ *.ln *.atac trace
216         -rm -f $(TESTPROGS)
217
218 clean :: mostlyclean
219         -rm -f $(AUTO_SRC)
220         -rm -f $(PROGS)
221
222 distclean :: clean
223         -rm -f Makefile
224
225 realclean :: distclean
226
227 # These rules are used to allow "make -n" to work on a clean directory-tree
228 ../include/hashsize.h \
229 ../include/parametrized.h \
230 ../include/term.h :
231         cd ../include; $(MAKE) $(CF_MFLAGS)
232 $(DEPS_CURSES) :
233         cd ../ncurses; $(MAKE) $(CF_MFLAGS)
234
235 lint:
236         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
237         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
238         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
239         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
240         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
241         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
242
243 ###############################################################################
244 # The remainder of this file is automatically generated during configuration
245 ###############################################################################