]> git.ipfire.org Git - thirdparty/glibc.git/blob - stdio-common/Makefile
Generate .test-result files for tests with special rules.
[thirdparty/glibc.git] / stdio-common / Makefile
1 # Copyright (C) 1991-2014 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 headers := stdio_ext.h printf.h bits/printf-ldbl.h bits/stdio_lim.h
24
25 routines := \
26 ctermid cuserid \
27 _itoa _itowa itoa-digits itoa-udigits itowa-digits \
28 vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex \
29 reg-modifier reg-type \
30 printf_size fprintf printf snprintf sprintf asprintf dprintf \
31 vfwprintf vfscanf vfwscanf \
32 fscanf scanf sscanf \
33 perror psignal \
34 tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \
35 getline getw putw \
36 remove rename renameat \
37 flockfile ftrylockfile funlockfile \
38 isoc99_scanf isoc99_vscanf isoc99_fscanf isoc99_vfscanf isoc99_sscanf \
39 isoc99_vsscanf \
40 psiginfo
41
42 include ../Makeconfig
43
44 aux := errlist siglist printf-parsemb printf-parsewc fxprintf
45
46 tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
47 temptest tst-fileno test-fwrite tst-ungetc tst-ferror \
48 xbug errnobug \
49 bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \
50 tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \
51 scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \
52 scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \
53 tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \
54 tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \
55 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
56 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
57 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
58 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \
59 bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \
60 bug25 tst-printf-round bug26
61
62 test-srcs = tst-unbputc tst-printf
63
64 include ../Rules
65
66 ifeq ($(run-built-tests),yes)
67 tests: $(objpfx)tst-unbputc.out $(objpfx)tst-printf.out
68
69 $(objpfx)tst-unbputc.out: tst-unbputc.sh $(objpfx)tst-unbputc
70 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
71 $(evaluate-test)
72
73 $(objpfx)tst-printf.out: tst-printf.sh $(objpfx)tst-printf
74 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
75 $(evaluate-test)
76 endif
77
78 CFLAGS-vfprintf.c = -Wno-uninitialized
79 CFLAGS-vfwprintf.c = -Wno-uninitialized
80 CFLAGS-tst-printf.c = -Wno-format
81 CFLAGS-tstdiomisc.c = -Wno-format
82 CFLAGS-scanf4.c = -Wno-format
83 CFLAGS-scanf7.c = -Wno-format
84 CFLAGS-tst-printfsz.c = -Wno-format
85
86 CFLAGS-tmpfile.c = -fexceptions
87 CFLAGS-tmpfile64.c = -fexceptions
88 CFLAGS-tempname.c = -fexceptions
89 CFLAGS-psignal.c = -fexceptions
90 CFLAGS-vprintf.c = -fexceptions
91 CFLAGS-cuserid.c = -fexceptions
92
93 CFLAGS-vfprintf.c += $(exceptions)
94 CFLAGS-fprintf.c += $(exceptions)
95 CFLAGS-printf.c += $(exceptions)
96 CFLAGS-vfwprintf.c += $(exceptions)
97 CFLAGS-vfscanf.c += $(exceptions)
98 CFLAGS-vfwscanf.c += $(exceptions)
99 CFLAGS-fscanf.c += $(exceptions)
100 CFLAGS-scanf.c += $(exceptions)
101 CFLAGS-isoc99_vfscanf.c += $(exceptions)
102 CFLAGS-isoc99_vscanf.c += $(exceptions)
103 CFLAGS-isoc99_fscanf.c += $(exceptions)
104 CFLAGS-isoc99_scanf.c += $(exceptions)
105 CFLAGS-errlist.c = $(fno-unit-at-a-time)
106 CFLAGS-siglist.c = $(fno-unit-at-a-time)
107
108 # The following is a hack since we must compile scanf1{5,7}.c without any
109 # GNU extension. The latter are needed, though, when internal headers
110 # are used. So made sure we see the installed headers first.
111 CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
112 -I../wctype
113 CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
114 -I../wctype
115
116 # We know the test has a format string problem.
117 CFLAGS-tst-sprintf.c = -Wno-format
118 tst-sprintf-ENV = LOCPATH=$(common-objpfx)localedata
119 tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
120 tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata
121 tst-swscanf-ENV = LOCPATH=$(common-objpfx)localedata
122 test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata
123 scanf13-ENV = LOCPATH=$(common-objpfx)localedata
124 bug14-ENV = LOCPATH=$(common-objpfx)localedata
125 tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
126
127 CPPFLAGS += $(libio-mtsafe)
128
129 ifeq ($(run-built-tests),yes)
130 tests: $(objpfx)tst-setvbuf1-cmp.out
131 endif
132
133 $(objpfx)tst-setvbuf1.out: /dev/null $(objpfx)tst-setvbuf1
134 $(test-program-cmd) > $@ 2>&1; \
135 $(evaluate-test)
136
137 $(objpfx)tst-setvbuf1-cmp.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1.out
138 cmp $^ > $@; \
139 $(evaluate-test)
140
141 ifeq ($(build-shared),yes)
142 link-libm = $(common-objpfx)math/libm.so
143 else
144 link-libm = $(common-objpfx)math/libm.a
145 endif
146 $(objpfx)tst-printf-round: $(link-libm)