1 # Copyright (C) 1993, 1998 Free Software Foundation
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)
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.
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. */
22 C_FLAGS
= $(CFLAGS
) -I.
-I..
-I
$(srcdir) -I
$(srcdir)/..
27 #### package, host, target, and site dependent Makefile fragments come in here.
30 STDIO_LD_FLAGS
= -u __cleanup
32 #LIBS = ../../libg++.a
34 #LIBSTDIO = ../stdio/libstdio++.a
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
42 DEPEND_SOURCES
= $(srcdir)/*.C
44 .PHONY
: check check-old check-iostream check-stdio
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
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
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).
60 check-stdio
: check-tfseek check-twrseek check-trdseek check-tpopen
62 # See ${MOSTLYCLEAN} in configure.in
63 JUNK_TO_CLEAN
= tFile tiomisc hounddog putbackdog tiomanip \
64 t?format
*.out streamfile ftmp
* tstdiomisc foo.dat
74 gcc
-v
-o tst tst.o
$(STDIOLIBS
)
77 $(CXX
) $(CXXFLAGS
) -o tgetl tgetl.o
$(IOLIBS
)
80 $(CXX
) $(CXXFLAGS
) -o tFile tFile.o
$(IOLIBS
)
83 $(CXX
) $(CXXFLAGS
) -o tiomisc tiomisc.o
$(IOLIBS
)
86 $(CXX
) $(CXXFLAGS
) -o hounddog hounddog.o
$(IOLIBS
)
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
96 putbackdog
: putbackdog.o
97 $(CXX
) $(CXXFLAGS
) -o putbackdog putbackdog.o
$(IOLIBS
)
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
109 check-putbackdog-regular check-putbackdog-nobuf check-putbackdog-buf2
112 $(CC
) $(CFLAGS
) -o tfseek tfseek.o
$(STDIOLIBS
)
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
125 $(CC
) $(CFLAGS
) -o twrseek twrseek.o
$(STDIOLIBS
)
127 check-twrseek
: twrseek
128 .
/twrseek
> twrseek.out
2>&1
129 diff
-c twrseek.out
$(srcdir)/twrseek.exp
132 $(CC
) $(CFLAGS
) -o trdseek
-v trdseek.o
$(STDIOLIBS
)
134 check-trdseek
: trdseek
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
150 check-tiomisc
: tiomisc
151 .
/tiomisc
>tiomisc.out
2>&1
152 diff
-c tiomisc.out
$(srcdir)/tiomisc.exp
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
160 tfformat
: $(srcdir)/tfformat.c
161 $(CC
) $(C_FLAGS
) -DTEST_LIBIO
-DTEST_EXACTNESS \
162 -o tfformat
$(srcdir)/tfformat.c
$(IOSTDIOLIB
)
164 check-tfformat
: tfformat
167 tiformat
: $(srcdir)/tiformat.c
168 $(CC
) $(C_FLAGS
) -DTEST_LIBIO
-o tiformat
$(srcdir)/tiformat.c
$(IOSTDIOLIB
)
170 check-tiformat
: tiformat
173 tstdiomisc
: tstdiomisc.o
174 $(CC
) $(CFLAGS
) -o tstdiomisc tstdiomisc.o
$(IOSTDIOLIB
)
176 check-tstdiomisc
: tstdiomisc
177 .
/tstdiomisc
>tstdiomisc.out
2>&1
178 diff
-c tstdiomisc.out
$(srcdir)/tstdiomisc.exp
181 $(CC
) $(CFLAGS
) -o tpopen tpopen.o
$(STDIOLIBS
)
184 .
/tpopen
> tpopen.out
2>&1
185 diff
-c tpopen.out
$(srcdir)/tpopen.exp
188 $(CC
) $(CFLAGS
) -o trwseek trwseek.o
$(STDIOLIBS
)
190 check-trwseek
: trwseek
191 .
/trwsseek TMP r
+ k w o
194 $(CXX
) $(CXXFLAGS
) -o foo foo.o
$(STDIOLIBS
)
196 $(CXX
) $(CXXFLAGS
) -o foo
+ foo
+.o
$(IOLIBS
)