More spring-cleaning.
[dragonfly.git] / contrib / libio / tests / Makefile.in
1 # Copyright (C) 1993, 1998 Free Software Foundation
2
3 # This file is part of the GNU IO Library.  This library is free
4 # software; you can redistribute it and/or modify it under the
5 # terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with GNU CC; see the file COPYING.  If not, write to
16 # the Free Software Foundation, 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.  */
18
19 srcdir = .
20
21 CFLAGS = -g
22 C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
23 CXXFLAGS = -g
24 CC = gcc
25 CXX = gcc
26
27 #### package, host, target, and site dependent Makefile fragments come in here.
28 ##
29
30 STDIO_LD_FLAGS = -u __cleanup
31
32 #LIBS = ../../libg++.a
33
34 #LIBSTDIO = ../stdio/libstdio++.a
35 #LIBIO = ../libio.a
36
37 #STDIOLIBS = $(STDIO_LD_FLAGS) $(LIBSTDIO) $(LIBIO) $(LIBS)
38 STDIOLIBS = $(LIBSTDIO) $(LIBIO) $(LIBS)
39 IOLIBS = -L../../libstdc++ -lstdc++
40 IOSTDIOLIB = ../libio.a ../../libiberty/libiberty.a
41
42 DEPEND_SOURCES = $(srcdir)/*.C
43
44 .PHONY: check check-old check-iostream check-stdio
45 check: $(CHECK)
46
47
48 # These are tests written in C++, that test the iostream facility.
49 check-iostream: check-tFile check-tiomisc \
50    check-hounddog check-putbackdog check-tiomanip
51
52 # These are tests written in C, that don't need C++.
53 # They test libio's emulation of stdio.
54 check-iostdio: check-tiformat check-tfformat check-tstdiomisc
55
56 # check-stdio runs test programs that use stdio.
57 # These aren't run by default because there may be linker tricks needed
58 # to build them (if libc.a contains a competing stdio implementation).
59
60 check-stdio: check-tfseek check-twrseek check-trdseek check-tpopen
61
62 # See ${MOSTLYCLEAN} in configure.in
63 JUNK_TO_CLEAN = tFile tiomisc hounddog putbackdog tiomanip \
64    t?format *.out streamfile ftmp* tstdiomisc foo.dat
65
66 .PHONY: info
67 info:
68 .PHONY: clean-info
69 clean-info:
70 .PHONY: install-info
71 install-info:
72
73 tst: tst.o
74         gcc -v -o tst tst.o $(STDIOLIBS)
75
76 tgetl: tgetl.o
77         $(CXX) $(CXXFLAGS) -o tgetl tgetl.o $(IOLIBS)
78
79 tFile: tFile.o
80         $(CXX) $(CXXFLAGS) -o tFile tFile.o $(IOLIBS)
81
82 tiomisc: tiomisc.o
83         $(CXX) $(CXXFLAGS) -o tiomisc tiomisc.o $(IOLIBS)
84
85 hounddog: hounddog.o
86         $(CXX) $(CXXFLAGS) -o hounddog hounddog.o $(IOLIBS)
87
88 check-hounddog: hounddog
89         ./hounddog <$(srcdir)/hounddog.inp > hounddog.out 2>&1
90         diff -c hounddog.out $(srcdir)/hounddog.exp
91         ./hounddog -b0 <$(srcdir)/hounddog.inp > hound-b0.out 2>&1
92         diff -c hound-b0.out $(srcdir)/hounddog.exp
93         ./hounddog -b2 <$(srcdir)/hounddog.inp > hound-b2.out 2>&1
94         diff -c hound-b2.out $(srcdir)/hounddog.exp
95
96 putbackdog: putbackdog.o
97         $(CXX) $(CXXFLAGS) -o putbackdog putbackdog.o $(IOLIBS)
98
99 check-putbackdog-regular: putbackdog
100         ./putbackdog <$(srcdir)/hounddog.inp > putback.out 2>&1
101         diff -c putback.out $(srcdir)/hounddog.exp
102 check-putbackdog-nobuf: putbackdog
103         ./putbackdog -b0 <$(srcdir)/hounddog.inp > putback-b0.out 2>&1
104         diff -c putback-b0.out $(srcdir)/hounddog.exp
105 check-putbackdog-buf2: putbackdog
106         ./putbackdog -b2 <$(srcdir)/hounddog.inp > putback-b2.out 2>&1
107         diff -c putback-b2.out $(srcdir)/hounddog.exp
108 check-putbackdog: \
109   check-putbackdog-regular check-putbackdog-nobuf check-putbackdog-buf2
110
111 tfseek: tfseek.o
112         $(CC) $(CFLAGS) -o tfseek tfseek.o $(STDIOLIBS)
113
114 check-tfseek: tfseek
115         ./tfseek SEEK_SET fopen > tfseek-set-fopen.out 2>&1
116         diff -c tfseek-set-fopen.out $(srcdir)/tfseek-set.exp
117         ./tfseek SEEK_SET freopen > tfseek-set-freopen.out 2>&1
118         diff -c tfseek-set-freopen.out $(srcdir)/tfseek-set.exp
119         ./tfseek SEEK_CUR fopen > tfseek-cur-fopen.out 2>&1
120         diff -c tfseek-cur-fopen.out $(srcdir)/tfseek-cur.exp
121         ./tfseek SEEK_CUR freopen > tfseek-cur-freopen.out 2>&1
122         diff -c tfseek-cur-freopen.out $(srcdir)/tfseek-cur.exp
123
124 twrseek: twrseek.o
125         $(CC) $(CFLAGS) -o twrseek twrseek.o $(STDIOLIBS)
126
127 check-twrseek: twrseek
128         ./twrseek > twrseek.out 2>&1
129         diff -c twrseek.out $(srcdir)/twrseek.exp
130
131 trdseek: trdseek.o
132         $(CC) $(CFLAGS) -o trdseek -v trdseek.o $(STDIOLIBS)
133
134 check-trdseek: trdseek
135         ./trdseek
136
137 check-tFile-regular: tFile
138         ./tFile < $(srcdir)/tFile.inp > tFile.out 2>&1
139         diff -c tFile.out $(srcdir)/tFile.exp
140 # Run tFile with cout.rdbuf() unbuffered.
141 check-tFile-nobuf: tFile
142         ./tFile -b0 < $(srcdir)/tFile.inp > tFile-buf0.out 2>&1
143         diff -c tFile-buf0.out $(srcdir)/tFile.exp
144 # Run tFile with a 3-byte buffer for cout.rdbuf().
145 check-tFile-buf3: tFile
146         ./tFile -b3 < $(srcdir)/tFile.inp > tFile-buf3.out 2>&1
147         diff -c tFile-buf3.out $(srcdir)/tFile.exp
148 check-tFile: check-tFile-regular check-tFile-nobuf check-tFile-buf3
149
150 check-tiomisc: tiomisc
151         ./tiomisc >tiomisc.out 2>&1
152         diff -c tiomisc.out $(srcdir)/tiomisc.exp
153
154 tiomanip: tiomanip.o
155         $(CXX) $(CXXFLAGS) -o tiomanip tiomanip.o $(IOLIBS)
156 check-tiomanip: tiomanip
157         ./tiomanip >tiomanip.out 2>&1
158         diff -c tiomanip.out $(srcdir)/tiomanip.exp
159
160 tfformat: $(srcdir)/tfformat.c
161         $(CC) $(C_FLAGS) -DTEST_LIBIO -DTEST_EXACTNESS \
162           -o tfformat $(srcdir)/tfformat.c $(IOSTDIOLIB)
163
164 check-tfformat: tfformat
165         ./tfformat
166
167 tiformat: $(srcdir)/tiformat.c
168         $(CC) $(C_FLAGS) -DTEST_LIBIO -o tiformat $(srcdir)/tiformat.c $(IOSTDIOLIB)
169
170 check-tiformat: tiformat
171         ./tiformat
172
173 tstdiomisc: tstdiomisc.o
174         $(CC) $(CFLAGS) -o tstdiomisc tstdiomisc.o $(IOSTDIOLIB)
175
176 check-tstdiomisc: tstdiomisc
177         ./tstdiomisc >tstdiomisc.out 2>&1
178         diff -c tstdiomisc.out $(srcdir)/tstdiomisc.exp
179
180 tpopen: tpopen.o
181         $(CC) $(CFLAGS) -o tpopen tpopen.o $(STDIOLIBS)
182
183 check-tpopen: tpopen
184         ./tpopen > tpopen.out 2>&1
185         diff -c tpopen.out $(srcdir)/tpopen.exp
186
187 trwseek: trwseek.o
188         $(CC) $(CFLAGS) -o trwseek trwseek.o $(STDIOLIBS)
189
190 check-trwseek: trwseek
191         ./trwsseek  TMP r+ k w o
192
193 foo: foo.o
194         $(CXX) $(CXXFLAGS) -o foo foo.o $(STDIOLIBS)
195 foo+: foo+.o
196         $(CXX) $(CXXFLAGS) -o foo+ foo+.o $(IOLIBS)