]>
Commit | Line | Data |
---|---|---|
1 | # Copyright (C) 1991-2019 Free Software Foundation, Inc. | |
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 | |
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. | |
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 | |
12 | # Lesser General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU Lesser General Public | |
15 | # License along with the GNU C Library; if not, see | |
16 | # <http://www.gnu.org/licenses/>. | |
17 | ||
18 | # | |
19 | # Specific makefile for stdio-common. | |
20 | # | |
21 | subdir := stdio-common | |
22 | ||
23 | include ../Makeconfig | |
24 | ||
25 | headers := stdio_ext.h printf.h bits/printf-ldbl.h bits/stdio_lim.h | |
26 | ||
27 | routines := \ | |
28 | ctermid cuserid \ | |
29 | _itoa _itowa itoa-digits itoa-udigits itowa-digits \ | |
30 | vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex \ | |
31 | reg-modifier reg-type \ | |
32 | printf_size fprintf printf snprintf sprintf asprintf dprintf \ | |
33 | vfwprintf vfscanf vfwscanf \ | |
34 | fscanf scanf sscanf \ | |
35 | perror psignal \ | |
36 | tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \ | |
37 | getline getw putw \ | |
38 | remove rename renameat renameat2 \ | |
39 | flockfile ftrylockfile funlockfile \ | |
40 | isoc99_scanf isoc99_vscanf isoc99_fscanf isoc99_vfscanf isoc99_sscanf \ | |
41 | isoc99_vsscanf \ | |
42 | psiginfo gentempfd \ | |
43 | vfscanf-internal vfwscanf-internal iovfscanf iovfwscanf \ | |
44 | vfprintf-internal vfwprintf-internal | |
45 | ||
46 | aux := errlist siglist printf-parsemb printf-parsewc fxprintf | |
47 | ||
48 | tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ | |
49 | temptest tst-fileno test-fwrite tst-ungetc tst-ferror \ | |
50 | xbug errnobug \ | |
51 | bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \ | |
52 | tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \ | |
53 | scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \ | |
54 | scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \ | |
55 | tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \ | |
56 | tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \ | |
57 | tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ | |
58 | tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \ | |
59 | bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ | |
60 | scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \ | |
61 | bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \ | |
62 | bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26 tst-fmemopen3 \ | |
63 | tst-printf-bz18872 tst-vfprintf-width-prec tst-fmemopen4 \ | |
64 | tst-vfprintf-user-type \ | |
65 | tst-vfprintf-mbs-prec \ | |
66 | tst-scanf-round \ | |
67 | tst-renameat2 tst-bz11319 tst-bz11319-fortify2 \ | |
68 | ||
69 | test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble | |
70 | ||
71 | ifeq ($(run-built-tests),yes) | |
72 | tests-special += $(objpfx)tst-unbputc.out $(objpfx)tst-printf.out \ | |
73 | $(objpfx)tst-printf-bz18872-mem.out \ | |
74 | $(objpfx)tst-setvbuf1-cmp.out \ | |
75 | $(objpfx)tst-vfprintf-width-prec-mem.out \ | |
76 | $(objpfx)tst-printfsz-islongdouble.out | |
77 | generated += tst-printf-bz18872.c tst-printf-bz18872.mtrace \ | |
78 | tst-printf-bz18872-mem.out \ | |
79 | tst-vfprintf-width-prec.mtrace tst-vfprintf-width-prec-mem.out | |
80 | endif | |
81 | ||
82 | include ../Rules | |
83 | ||
84 | ifeq ($(run-built-tests),yes) | |
85 | LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ISO-8859-1 ja_JP.EUC-JP | |
86 | include ../gen-locales.mk | |
87 | ||
88 | $(objpfx)bug14.out: $(gen-locales) | |
89 | $(objpfx)scanf13.out: $(gen-locales) | |
90 | $(objpfx)test-vfprintf.out: $(gen-locales) | |
91 | $(objpfx)tst-grouping.out: $(gen-locales) | |
92 | $(objpfx)tst-sprintf.out: $(gen-locales) | |
93 | $(objpfx)tst-sscanf.out: $(gen-locales) | |
94 | $(objpfx)tst-swprintf.out: $(gen-locales) | |
95 | $(objpfx)tst-vfprintf-mbs-prec.out: $(gen-locales) | |
96 | endif | |
97 | ||
98 | tst-printf-bz18872-ENV = MALLOC_TRACE=$(objpfx)tst-printf-bz18872.mtrace | |
99 | tst-vfprintf-width-prec-ENV = \ | |
100 | MALLOC_TRACE=$(objpfx)tst-vfprintf-width-prec.mtrace | |
101 | ||
102 | $(objpfx)tst-unbputc.out: tst-unbputc.sh $(objpfx)tst-unbputc | |
103 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' > $@; \ | |
104 | $(evaluate-test) | |
105 | ||
106 | $(objpfx)tst-printf.out: tst-printf.sh $(objpfx)tst-printf | |
107 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' > $@; \ | |
108 | $(evaluate-test) | |
109 | ||
110 | $(objpfx)tst-printfsz-islongdouble.out: \ | |
111 | tst-printfsz-islongdouble.sh $(objpfx)tst-printfsz-islongdouble | |
112 | $(SHELL) $^ '$(test-program-prefix)' $@; \ | |
113 | $(evaluate-test) | |
114 | ||
115 | # We generate this source because it requires a printf invocation with | |
116 | # 10K arguments. | |
117 | $(objpfx)tst-printf-bz18872.c: tst-printf-bz18872.sh | |
118 | rm -f $@ && $(BASH) $^ > $@.new && mv $@.new $@ | |
119 | ||
120 | $(objpfx)tst-%-mem.out: $(objpfx)tst-%.out | |
121 | $(common-objpfx)malloc/mtrace $(objpfx)tst-$*.mtrace > $@; \ | |
122 | $(evaluate-test) | |
123 | ||
124 | CFLAGS-vfprintf.c += -Wno-uninitialized | |
125 | CFLAGS-vfwprintf.c += -Wno-uninitialized | |
126 | ||
127 | CFLAGS-tmpfile.c += -fexceptions | |
128 | CFLAGS-tmpfile64.c += -fexceptions | |
129 | CFLAGS-tempname.c += -fexceptions | |
130 | CFLAGS-psignal.c += -fexceptions | |
131 | CFLAGS-vprintf.c += -fexceptions | |
132 | CFLAGS-cuserid.c += -fexceptions | |
133 | ||
134 | CFLAGS-vfprintf.c += -fexceptions | |
135 | CFLAGS-fprintf.c += -fexceptions | |
136 | CFLAGS-printf.c += -fexceptions | |
137 | CFLAGS-vfwprintf.c += -fexceptions | |
138 | CFLAGS-vfscanf.c += -fexceptions | |
139 | CFLAGS-vfwscanf.c += -fexceptions | |
140 | CFLAGS-fscanf.c += -fexceptions | |
141 | CFLAGS-scanf.c += -fexceptions | |
142 | CFLAGS-isoc99_vfscanf.c += -fexceptions | |
143 | CFLAGS-isoc99_vscanf.c += -fexceptions | |
144 | CFLAGS-isoc99_fscanf.c += -fexceptions | |
145 | CFLAGS-isoc99_scanf.c += -fexceptions | |
146 | CFLAGS-errlist.c += $(fno-unit-at-a-time) | |
147 | CFLAGS-siglist.c += $(fno-unit-at-a-time) | |
148 | ||
149 | # The following is a hack since we must compile scanf1{5,7}.c without any | |
150 | # GNU extension. The latter are needed, though, when internal headers | |
151 | # are used. So made sure we see the installed headers first. | |
152 | CFLAGS-scanf15.c += -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ | |
153 | -I../wctype | |
154 | CFLAGS-scanf17.c += -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \ | |
155 | -I../wctype | |
156 | ||
157 | CFLAGS-bug3.c += -DOBJPFX=\"$(objpfx)\" | |
158 | CFLAGS-bug4.c += -DOBJPFX=\"$(objpfx)\" | |
159 | CFLAGS-bug5.c += -DOBJPFX=\"$(objpfx)\" | |
160 | CFLAGS-test-fseek.c += -DOBJPFX=\"$(objpfx)\" | |
161 | CFLAGS-test-popen.c += -DOBJPFX=\"$(objpfx)\" | |
162 | CFLAGS-test_rdwr.c += -DOBJPFX=\"$(objpfx)\" | |
163 | ||
164 | # tst-gets.c tests a deprecated function. | |
165 | CFLAGS-tst-gets.c += -Wno-deprecated-declarations | |
166 | ||
167 | # BZ #11319 was first fixed for regular vdprintf, then reopened because | |
168 | # the fortified version had the same bug. | |
169 | CFLAGS-tst-bz11319-fortify2.c += -D_FORTIFY_SOURCE=2 | |
170 | ||
171 | CPPFLAGS += $(libio-mtsafe) | |
172 | ||
173 | $(objpfx)tst-setvbuf1.out: /dev/null $(objpfx)tst-setvbuf1 | |
174 | $(test-program-cmd) > $@ 2>&1; \ | |
175 | $(evaluate-test) | |
176 | ||
177 | $(objpfx)tst-setvbuf1-cmp.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1.out | |
178 | cmp $^ > $@; \ | |
179 | $(evaluate-test) | |
180 | ||
181 | $(objpfx)tst-printf-round: $(libm) | |
182 | $(objpfx)tst-scanf-round: $(libm) |