* Add this nice filesystem testing tool that I've recently
[dragonfly.git] / contrib / ncurses / progs / Makefile.in
1 # $Id: Makefile.in,v 1.49 2000/09/30 23:08:58 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 DESTDIR         = @DESTDIR@
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 INSTALL         = @INSTALL@
63 INSTALL_PROGRAM = @INSTALL_PROGRAM@
64 transform       = @program_transform_name@
65
66 AWK             = @AWK@
67 LN_S            = @LN_S@
68
69 CC              = @CC@
70 CPP             = @CPP@
71 CFLAGS          = @CFLAGS@
72
73 INCDIR          = $(srcdir)/../include
74 CPPFLAGS        = -I../progs -I$(srcdir) @CPPFLAGS@ \
75                   -DHAVE_CONFIG_H
76
77 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
78
79 CFLAGS_NORMAL   = $(CCFLAGS)
80 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
81 CFLAGS_PROFILE  = $(CCFLAGS) -pg
82 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
83
84 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
85
86 LD              = @LD@
87 LINK            = @LINK_PROGS@ $(CC)
88 LDFLAGS         = @EXTRA_LDFLAGS@ \
89                 @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
90
91 LDFLAGS_NORMAL  = $(LDFLAGS)
92 LDFLAGS_DEBUG   = $(LDFLAGS) @CC_G_OPT@
93 LDFLAGS_PROFILE = $(LDFLAGS) -pg
94 LDFLAGS_SHARED  = $(LDFLAGS) @LD_SHARED_OPTS@
95
96 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
97
98 LINT            = @LINT@
99 LINT_OPTS       = @LINT_OPTS@
100 LINT_LIBS       = -lncurses @LIBS@
101
102 AUTO_SRC = \
103         termsort.c \
104         transform.h
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:        $(AUTO_SRC) install.progs
119 uninstall: uninstall.progs
120
121 # this line simplifies the configure-script
122 libs \
123 install.libs \
124 uninstall.libs:
125
126 TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
127
128 actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
129 actual_clear     = `echo clear$x|     $(TRANSFORM)`
130 actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
131 actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
132 actual_init      = `echo init$x|      $(TRANSFORM)`
133 actual_reset     = `echo reset$x|     $(TRANSFORM)`
134 actual_tic       = `echo tic$x|       $(TRANSFORM)`
135 actual_toe       = `echo toe$x|       $(TRANSFORM)`
136 actual_tput      = `echo tput$x|      $(TRANSFORM)`
137 actual_tset      = `echo tset$x|      $(TRANSFORM)`
138
139 transform.h :
140         echo "#define PROG_CAPTOINFO \"$(actual_captoinfo)\"" >$@
141         echo "#define PROG_INFOTOCAP \"$(actual_infotocap)\"" >>$@
142         echo "#define PROG_RESET     \"$(actual_reset)\""     >>$@
143         echo "#define PROG_INIT      \"$(actual_init)\""      >>$@
144
145 install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
146         $(INSTALL_PROGRAM) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
147         $(INSTALL_PROGRAM) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
148         $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
149         $(INSTALL_PROGRAM) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
150         $(INSTALL_PROGRAM) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
151         $(INSTALL_PROGRAM) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
152         @echo "linking $(actual_captoinfo) to $(actual_tic)"
153         -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
154         (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
155         @echo "linking $(actual_infotocap) to $(actual_tic)"
156         -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
157         (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
158         @echo "linking $(actual_reset) to $(actual_tset)"
159         -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
160         (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
161
162 uninstall.progs:
163         -@rm -f $(DESTDIR)$(bindir)/$(actual_tic)
164         -@rm -f $(DESTDIR)$(bindir)/$(actual_toe)
165         -@rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
166         -@rm -f $(DESTDIR)$(bindir)/$(actual_clear)
167         -@rm -f $(DESTDIR)$(bindir)/$(actual_tput)
168         -@rm -f $(DESTDIR)$(bindir)/$(actual_tset)
169         -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
170         -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
171         -@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
172
173 $(DESTDIR)$(bindir) :
174         $(srcdir)/../mkinstalldirs $@
175
176 #
177 # Utilities normally built by make all start here
178 #
179
180 DEPS_TIC = \
181         $(MODEL)/tic.o \
182         $(MODEL)/dump_entry.o
183
184 tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
185         @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
186
187 DEPS_TOE = \
188         $(MODEL)/toe.o \
189         $(MODEL)/dump_entry.o
190
191 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
192         @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
193
194 DEPS_CLEAR = \
195         $(MODEL)/clear.o
196
197 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
198         @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
199
200 DEPS_TPUT = \
201         $(MODEL)/tput.o
202
203 tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
204         @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
205
206 DEPS_INFOCMP = \
207         $(MODEL)/infocmp.o \
208         $(MODEL)/dump_entry.o
209
210 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
211         @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
212
213 DEPS_TSET = \
214         $(MODEL)/tset.o \
215         $(MODEL)/dump_entry.o
216
217 tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
218         @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
219
220 termsort.c: $(srcdir)/MKtermsort.sh
221         sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
222
223 #
224 # Utility productions start here
225 #
226
227 tags:
228         ctags *.[ch]
229
230 @MAKE_UPPER_TAGS@TAGS:
231 @MAKE_UPPER_TAGS@       etags *.[ch]
232
233 mostlyclean ::
234         -rm -f core tags TAGS *~ *.ln *.atac trace
235         -rm -f $(TESTPROGS)
236
237 clean :: mostlyclean
238         -rm -f $(AUTO_SRC)
239         -rm -f $(PROGS)
240
241 distclean :: clean
242         -rm -f Makefile
243
244 realclean :: distclean
245
246 # These rules are used to allow "make -n" to work on a clean directory-tree
247 ../include/hashsize.h \
248 ../include/parametrized.h \
249 ../include/term.h :
250         cd ../include; $(MAKE) $(CF_MFLAGS)
251 $(DEPS_CURSES) :
252         cd ../ncurses; $(MAKE) $(CF_MFLAGS)
253
254 lint:
255         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
256         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
257         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
258         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
259         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
260         $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
261
262 ###############################################################################
263 # The remainder of this file is automatically generated during configuration
264 ###############################################################################