]>
Commit | Line | Data |
---|---|---|
bfff8b1b | 1 | # Copyright (C) 1995-2017 Free Software Foundation, Inc. |
96aa2d94 RM |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
96aa2d94 RM |
8 | |
9 | # The GNU C 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 GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
96aa2d94 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
96aa2d94 RM |
17 | |
18 | # | |
19 | # Specific makefile for libio. | |
20 | # | |
21 | subdir := libio | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
625cd00f | 25 | headers := stdio.h libio.h _G_config.h bits/stdio.h \ |
c6251f03 | 26 | bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h |
96aa2d94 RM |
27 | |
28 | routines := \ | |
29 | filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \ | |
d64b6ad0 | 30 | iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \ |
f65fd747 | 31 | iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \ |
77fe0b9c | 32 | ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \ |
96aa2d94 | 33 | iovsprintf iovsscanf \ |
dfd2257a | 34 | iofgetpos64 iofopen64 iofsetpos64 \ |
d64b6ad0 UD |
35 | fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \ |
36 | iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \ | |
3944f99e AS |
37 | putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \ |
38 | wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \ | |
63f8fe54 | 39 | wstrops wfileops iofwide fwide wmemstream \ |
96aa2d94 | 40 | \ |
209caedf | 41 | clearerr feof ferror fileno fputc freopen fseek getc getchar \ |
77a58cad | 42 | memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \ |
a5a0310d | 43 | iovdprintf vscanf vsnprintf obprintf fcloseall fseeko ftello \ |
77ccaba1 | 44 | freopen64 fseeko64 ftello64 \ |
96aa2d94 | 45 | \ |
a91d3cd3 UD |
46 | __fbufsize __freading __fwriting __freadable __fwritable __flbf \ |
47 | __fpurge __fpending __fsetlocking \ | |
48 | \ | |
db3476af | 49 | libc_fatal fmemopen oldfmemopen vtables |
96aa2d94 | 50 | |
9c38a689 | 51 | tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ |
bcba7aa2 | 52 | tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \ |
3384a8d6 | 53 | tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf \ |
81c64d40 | 54 | tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \ |
442685a8 | 55 | tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \ |
acbee5f6 | 56 | tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \ |
eb35b097 | 57 | tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \ |
01715b03 | 58 | bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \ |
645f97ce AZ |
59 | tst-memstream1 tst-memstream2 tst-memstream3 \ |
60 | tst-wmemstream1 tst-wmemstream2 tst-wmemstream3 \ | |
1e88bd0f | 61 | bug-memstream1 bug-wmemstream1 \ |
eb6cbd24 | 62 | tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ |
2482ae43 | 63 | tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \ |
04b76b5a | 64 | tst-ftell-append tst-fputws |
bcba7aa2 L |
65 | ifeq (yes,$(build-shared)) |
66 | # Add test-fopenloc only if shared library is enabled since it depends on | |
67 | # shared localedata objects. | |
68 | tests += tst-fopenloc | |
69 | endif | |
897d4284 | 70 | test-srcs = test-freopen |
d64b6ad0 | 71 | |
3f2e46a4 | 72 | ifeq ($(build-shared),yes) |
7d6a8338 | 73 | routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \ |
655c0697 UD |
74 | oldtmpfile oldiofgetpos oldiofgetpos64 oldiofsetpos \ |
75 | oldiofsetpos64 | |
1ea89a40 UD |
76 | endif |
77 | ||
c75ccd4c | 78 | ifeq (yes,$(libc-reentrant)) |
edf5b2d7 | 79 | routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \ |
50304ef0 UD |
80 | iofflush_u putc_u putchar_u peekc iofread_u iofwrite_u iofgets_u \ |
81 | iofputs_u | |
edf5b2d7 UD |
82 | endif |
83 | ||
c75ccd4c RM |
84 | CPPFLAGS += $(libio-mtsafe) |
85 | ||
21cea68e | 86 | # Support for exception handling. |
56ab3869 JM |
87 | CFLAGS-fileops.c = -fexceptions |
88 | CFLAGS-fputc.c = -fexceptions | |
89 | CFLAGS-fputwc.c = -fexceptions | |
90 | CFLAGS-freopen64.c = -fexceptions | |
91 | CFLAGS-freopen.c = -fexceptions | |
92 | CFLAGS-fseek.c = -fexceptions | |
93 | CFLAGS-fseeko64.c = -fexceptions | |
94 | CFLAGS-fseeko.c = -fexceptions | |
95 | CFLAGS-ftello64.c = -fexceptions | |
96 | CFLAGS-ftello.c = -fexceptions | |
97 | CFLAGS-fwide.c = -fexceptions | |
98 | CFLAGS-genops.c = -fexceptions | |
99 | CFLAGS-getc.c = -fexceptions | |
100 | CFLAGS-getchar.c = -fexceptions | |
101 | CFLAGS-getwc.c = -fexceptions | |
102 | CFLAGS-getwchar.c = -fexceptions | |
103 | CFLAGS-iofclose.c = -fexceptions | |
104 | CFLAGS-iofflush.c = -fexceptions | |
105 | CFLAGS-iofgetpos64.c = -fexceptions | |
106 | CFLAGS-iofgetpos.c = -fexceptions | |
107 | CFLAGS-iofgets.c = -fexceptions | |
108 | CFLAGS-iofgetws.c = -fexceptions | |
109 | CFLAGS-iofputs.c = -fexceptions | |
110 | CFLAGS-iofputws.c = -fexceptions | |
111 | CFLAGS-iofread.c = -fexceptions | |
112 | CFLAGS-iofsetpos64.c = -fexceptions | |
113 | CFLAGS-iofsetpos.c = -fexceptions | |
114 | CFLAGS-ioftell.c = -fexceptions | |
115 | CFLAGS-iofwrite.c = -fexceptions | |
116 | CFLAGS-iogetdelim.c = -fexceptions | |
117 | CFLAGS-iogetline.c = -fexceptions | |
118 | CFLAGS-iogets.c = -fexceptions | |
119 | CFLAGS-iogetwline.c = -fexceptions | |
120 | CFLAGS-ioputs.c = -fexceptions | |
121 | CFLAGS-ioseekoff.c = -fexceptions | |
122 | CFLAGS-ioseekpos.c = -fexceptions | |
123 | CFLAGS-iosetbuffer.c = -fexceptions | |
124 | CFLAGS-iosetvbuf.c = -fexceptions | |
125 | CFLAGS-ioungetc.c = -fexceptions | |
126 | CFLAGS-ioungetwc.c = -fexceptions | |
127 | CFLAGS-oldfileops.c = -fexceptions | |
128 | CFLAGS-oldiofclose.c = -fexceptions | |
129 | CFLAGS-oldiofgetpos64.c = -fexceptions | |
130 | CFLAGS-oldiofgetpos.c = -fexceptions | |
131 | CFLAGS-oldiofsetpos64.c = -fexceptions | |
132 | CFLAGS-oldiofsetpos.c = -fexceptions | |
133 | CFLAGS-peekc.c = -fexceptions | |
134 | CFLAGS-putc.c = -fexceptions | |
135 | CFLAGS-putchar.c = -fexceptions | |
136 | CFLAGS-putwc.c = -fexceptions | |
137 | CFLAGS-putwchar.c = -fexceptions | |
138 | CFLAGS-rewind.c = -fexceptions | |
139 | CFLAGS-wfileops.c = -fexceptions | |
140 | CFLAGS-wgenops.c = -fexceptions | |
141 | CFLAGS-oldiofopen.c = -fexceptions | |
142 | CFLAGS-iofopen.c = -fexceptions | |
143 | CFLAGS-iofopen64.c = -fexceptions | |
144 | CFLAGS-oldtmpfile.c = -fexceptions | |
21cea68e UD |
145 | # XXX Do we need filedoalloc and wfiledoalloc? Others? |
146 | ||
e8595e84 UD |
147 | CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\" |
148 | ||
9c38a689 UD |
149 | tst_wprintf2-ARGS = "Some Text" |
150 | ||
63e952d9 | 151 | test-fmemopen-ENV = MALLOC_TRACE=$(objpfx)test-fmemopen.mtrace |
2bf18041 | 152 | tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace |
277f8cdf | 153 | |
63e952d9 | 154 | generated += test-fmemopen.mtrace test-fmemopen.check |
f08e9a26 | 155 | generated += tst-fopenloc.mtrace tst-fopenloc.check |
a3b231b7 | 156 | |
414fd335 | 157 | aux := fileops genops stdfiles stdio strops |
96aa2d94 | 158 | |
3f2e46a4 | 159 | ifeq ($(build-shared),yes) |
1ea89a40 UD |
160 | aux += oldfileops oldstdfiles |
161 | endif | |
162 | ||
bd355af0 | 163 | shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \ |
655c0697 UD |
164 | oldstdfiles oldiopopen oldpclose oldtmpfile \ |
165 | oldiofgetpos oldiofgetpos64 oldiofsetpos \ | |
166 | oldiofsetpos64 | |
f2ea0f5b | 167 | |
03ac099f | 168 | ifeq ($(run-built-tests),yes) |
63e952d9 | 169 | tests-special += $(objpfx)test-freopen.out $(objpfx)test-fmemopen-mem.out |
bcba7aa2 | 170 | ifeq (yes,$(build-shared)) |
7f98f180 JM |
171 | # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared |
172 | # library is enabled since they depend on tst-fopenloc.out. | |
f214606a | 173 | tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out |
bcba7aa2 | 174 | endif |
b647f210 | 175 | endif |
897d4284 | 176 | |
f214606a JM |
177 | include ../Rules |
178 | ||
f881f6ff AS |
179 | ifeq ($(run-built-tests),yes) |
180 | LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \ | |
181 | ja_JP.EUC-JP ja_JP.UTF-8 | |
182 | include ../gen-locales.mk | |
183 | ||
184 | $(objpfx)bug-ftell.out: $(gen-locales) | |
185 | $(objpfx)bug-ungetwc1.out: $(gen-locales) | |
186 | $(objpfx)bug-ungetwc2.out: $(gen-locales) | |
187 | $(objpfx)tst-fgetwc.out: $(gen-locales) | |
188 | $(objpfx)tst-fgetws.out: $(gen-locales) | |
189 | $(objpfx)tst-fopenloc.out: $(gen-locales) | |
190 | $(objpfx)tst-fputws.out: $(gen-locales) | |
191 | $(objpfx)tst-fseek.out: $(gen-locales) | |
192 | $(objpfx)tst-ftell-active-handler.out: $(gen-locales) | |
193 | $(objpfx)tst-ftell-append.out: $(gen-locales) | |
194 | $(objpfx)tst-ftell-partial-wide.out: $(gen-locales) | |
195 | $(objpfx)tst-setvbuf1.out: $(gen-locales) | |
196 | $(objpfx)tst-swscanf.out: $(gen-locales) | |
197 | $(objpfx)tst-ungetwc1.out: $(gen-locales) | |
198 | $(objpfx)tst-ungetwc2.out: $(gen-locales) | |
199 | $(objpfx)tst-widetext.out: $(gen-locales) | |
200 | $(objpfx)tst_wprintf2.out: $(gen-locales) | |
201 | endif | |
202 | ||
897d4284 | 203 | $(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen |
740b3dbe | 204 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
f0881698 JM |
205 | $(common-objpfx)libio/; \ |
206 | $(evaluate-test) | |
277f8cdf | 207 | |
7f98f180 JM |
208 | $(objpfx)tst-fopenloc-cmp.out: ../iconvdata/testdata/ISO-8859-1..UTF8 \ |
209 | $(objpfx)tst-fopenloc.out | |
f0881698 JM |
210 | cmp $^ > $@; \ |
211 | $(evaluate-test) | |
7f98f180 | 212 | |
63e952d9 PP |
213 | $(objpfx)test-fmemopen-mem.out: $(objpfx)test-fmemopen.out |
214 | $(common-objpfx)malloc/mtrace $(objpfx)test-fmemopen.mtrace > $@; \ | |
215 | $(evaluate-test) | |
216 | ||
7f98f180 | 217 | $(objpfx)tst-fopenloc-mem.out: $(objpfx)tst-fopenloc.out |
f0881698 JM |
218 | $(common-objpfx)malloc/mtrace $(objpfx)tst-fopenloc.mtrace > $@; \ |
219 | $(evaluate-test) |