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