0165f4fffbe5061cc94d64a66df4de1323be7e2b
[ncurses.git] / test / Makefile.in
1 # $Id: Makefile.in,v 1.84 2005/09/24 23:05:14 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2003,2005 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-2002
31 #
32 # Makefile for ncurses tests.
33
34 # turn off _all_ suffix rules; we'll generate our own
35 .SUFFIXES:
36
37 SHELL           = /bin/sh
38
39 @SET_MAKE@
40
41 x               = @EXEEXT@
42 o               = .@OBJEXT@
43
44 MODEL           = ../@DFT_OBJ_SUBDIR@
45 srcdir          = @srcdir@
46 prefix          = @prefix@
47 exec_prefix     = @exec_prefix@
48 libdir          = @libdir@
49 includedir      = @includedir@
50
51 LIBTOOL         = @LIBTOOL@
52 LIBTOOL_CLEAN   = @LIB_CLEAN@
53 LIBTOOL_COMPILE = @LIB_COMPILE@
54 LIBTOOL_LINK    = @LIB_LINK@
55
56 CC              = @CC@
57 CPP             = @CPP@
58
59 CFLAGS          = @CFLAGS@
60 CPPFLAGS        =  -I../test -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
61
62 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
63
64 CFLAGS_LIBTOOL  = $(CCFLAGS)
65 CFLAGS_NORMAL   = $(CCFLAGS)
66 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
67 CFLAGS_PROFILE  = $(CCFLAGS) -pg
68 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
69
70 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
71
72 REL_VERSION     = @cf_cv_rel_version@
73 ABI_VERSION     = @cf_cv_abi_version@
74 LOCAL_LIBS      = @TEST_DEPS@
75 MATH_LIB        = @MATH_LIB@
76
77 LD              = @LD@
78 LINK            = @LINK_TESTS@ $(LIBTOOL_LINK) $(CC) $(CFLAGS)
79
80 LDFLAGS         = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@
81
82 LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL)
83 LDFLAGS_NORMAL  = $(LDFLAGS) $(CFLAGS_NORMAL)
84 LDFLAGS_DEBUG   = $(LDFLAGS) $(CFLAGS_DEBUG)
85 LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE)
86 LDFLAGS_SHARED  = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
87
88 # use these for linking with all of the libraries
89 LIBS_DEFAULT    = @TEST_ARGS@ @LIBS@
90 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_DEFAULT)
91
92 # use these for linking with the (n)curses library
93 LIBS_CURSES     = `echo "@TEST_ARGS@ @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'`
94 LDFLAGS_CURSES  = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES)
95
96 # use these for linking with the tinfo library if we have it, or curses library if not
97 LIBS_TINFO      = @TINFO_ARGS@ @LIBS@
98 LDFLAGS_TINFO   = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
99
100 LINT            = @LINT@
101 LINT_OPTS       = @LINT_OPTS@
102 LINT_LIBS       = -lform -lmenu -lpanel -lncurses @LIBS@
103
104 HEADER_DEPS     = \
105         ../include/curses.h \
106         ../include/term.h
107
108 TESTS = \
109         background$x \
110         blue$x \
111         bs$x \
112         cardfile$x \
113         color_set$x \
114         demo_defkey$x \
115         demo_forms$x \
116         demo_keyok$x \
117         demo_menus$x \
118         demo_panels$x \
119         demo_termcap$x \
120         ditto$x \
121         dots$x \
122         filter$x \
123         firework$x \
124         firstlast$x \
125         gdc$x \
126         hanoi$x \
127         hashtest$x \
128         ins_wide$x \
129         inserts$x \
130         keynames$x \
131         knight$x \
132         lrtest$x \
133         ncurses$x \
134         newdemo$x \
135         railroad$x \
136         rain$x \
137         tclock$x \
138         testaddch$x \
139         testcurs$x \
140         testscanw$x \
141         view$x \
142         worm$x \
143         xmas$x
144
145 all: $(TESTS)
146
147 sources:
148
149 tags:
150         ctags *.[ch]
151
152 background$x: $(MODEL)/background$o $(LOCAL_LIBS)
153         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/background$o $(LDFLAGS_CURSES)
154
155 blue$x: $(MODEL)/blue$o $(LOCAL_LIBS)
156         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/blue$o $(LDFLAGS_CURSES)
157
158 bs$x: $(MODEL)/bs$o $(LOCAL_LIBS)
159         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/bs$o $(LDFLAGS_CURSES)
160
161 cardfile$x: $(MODEL)/cardfile$o $(LOCAL_LIBS)
162         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/cardfile$o $(LDFLAGS_DEFAULT)
163
164 color_set$x: $(MODEL)/color_set$o $(LOCAL_LIBS)
165         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/color_set$o $(LDFLAGS_CURSES)
166
167 demo_defkey$x: $(MODEL)/demo_defkey$o $(LOCAL_LIBS)
168         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_defkey$o $(LDFLAGS_CURSES)
169
170 demo_forms$x: $(MODEL)/demo_forms$o $(MODEL)/edit_field$o $(LOCAL_LIBS)
171         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_forms$o $(MODEL)/edit_field$o $(LDFLAGS_DEFAULT)
172
173 demo_keyok$x: $(MODEL)/demo_keyok$o $(LOCAL_LIBS)
174         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_keyok$o $(LDFLAGS_CURSES)
175
176 demo_menus$x: $(MODEL)/demo_menus$o $(LOCAL_LIBS)
177         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_menus$o $(LDFLAGS_DEFAULT)
178
179 demo_panels$x: $(MODEL)/demo_panels$o $(LOCAL_LIBS)
180         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_panels$o $(LDFLAGS_DEFAULT)
181
182 demo_termcap$x: $(MODEL)/demo_termcap$o $(LOCAL_LIBS)
183         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/demo_termcap$o $(LDFLAGS_TINFO)
184
185 ditto$x: $(MODEL)/ditto$o $(LOCAL_LIBS)
186         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/ditto$o $(LDFLAGS_CURSES)
187
188 dots$x: $(MODEL)/dots$o $(LOCAL_LIBS)
189         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/dots$o $(LDFLAGS_TINFO)
190
191 filter$x: $(MODEL)/filter$o $(LOCAL_LIBS)
192         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/filter$o $(LDFLAGS_CURSES)
193
194 firework$x: $(MODEL)/firework$o $(LOCAL_LIBS)
195         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/firework$o $(LDFLAGS_CURSES)
196
197 firstlast$x: $(MODEL)/firstlast$o $(LOCAL_LIBS)
198         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/firstlast$o $(LDFLAGS_DEFAULT)
199
200 gdc$x: $(MODEL)/gdc$o $(LOCAL_LIBS)
201         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/gdc$o $(LDFLAGS_CURSES)
202
203 hanoi$x: $(MODEL)/hanoi$o $(LOCAL_LIBS)
204         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/hanoi$o $(LDFLAGS_CURSES)
205
206 hashtest$x: $(MODEL)/hashtest$o $(LOCAL_LIBS)
207         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/hashtest$o $(LDFLAGS_CURSES)
208
209 inserts$x: $(MODEL)/inserts$o $(LOCAL_LIBS)
210         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/inserts$o $(LDFLAGS_CURSES)
211
212 ins_wide$x: $(MODEL)/ins_wide$o $(LOCAL_LIBS)
213         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/ins_wide$o $(LDFLAGS_CURSES)
214
215 keynames$x: $(MODEL)/keynames$o $(LOCAL_LIBS)
216         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/keynames$o $(LDFLAGS_CURSES)
217
218 knight$x: $(MODEL)/knight$o $(LOCAL_LIBS)
219         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/knight$o $(LDFLAGS_CURSES)
220
221 lrtest$x: $(MODEL)/lrtest$o $(LOCAL_LIBS)
222         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/lrtest$o $(LDFLAGS_CURSES)
223
224 ncurses$x: $(MODEL)/ncurses$o $(LOCAL_LIBS)
225         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/ncurses$o $(LDFLAGS_DEFAULT)
226
227 newdemo$x: $(MODEL)/newdemo$o $(LOCAL_LIBS)
228         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/newdemo$o $(LDFLAGS_CURSES)
229
230 rain$x: $(MODEL)/rain$o $(LOCAL_LIBS)
231         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/rain$o $(LDFLAGS_CURSES)
232
233 railroad$x: $(MODEL)/railroad$o $(LOCAL_LIBS)
234         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/railroad$o $(LDFLAGS_TINFO)
235
236 tclock$x: $(MODEL)/tclock$o $(LOCAL_LIBS)
237         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/tclock$o $(LDFLAGS_CURSES) $(MATH_LIB)
238
239 testaddch$x: $(MODEL)/testaddch$o $(LOCAL_LIBS)
240         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/testaddch$o $(LDFLAGS_CURSES)
241
242 testcurs$x: $(MODEL)/testcurs$o $(LOCAL_LIBS)
243         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/testcurs$o $(LDFLAGS_CURSES)
244
245 testscanw$x: $(MODEL)/testscanw$o $(LOCAL_LIBS)
246         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/testscanw$o $(LDFLAGS_CURSES)
247
248 view$x: $(MODEL)/view$o $(LOCAL_LIBS)
249         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/view$o $(LDFLAGS_CURSES)
250
251 worm$x: $(MODEL)/worm$o $(LOCAL_LIBS)
252         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/worm$o $(LDFLAGS_CURSES)
253
254 xmas$x: $(MODEL)/xmas$o $(LOCAL_LIBS)
255         @ECHO_LINK@ $(LINK) -o $@ $(MODEL)/xmas$o $(LDFLAGS_CURSES)
256
257 libs \
258 install \
259 install.libs \
260 install.test:
261
262 uninstall:
263 uninstall.libs:
264 uninstall.test:
265
266 mostlyclean ::
267         -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
268
269 clean :: mostlyclean
270         -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
271         -rm -rf *$o screendump *.lis $(TESTS) .libs
272
273 distclean :: clean
274         -rm -f Makefile ncurses_cfg.h config.*
275
276 realclean :: distclean
277
278 lint:
279         sh -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'