]> git.ipfire.org Git - thirdparty/glibc.git/blame - libio/Makefile
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / libio / Makefile
CommitLineData
b168057a 1# Copyright (C) 1995-2015 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
b264e1d1 25headers := stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
c6251f03 26 bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h
96aa2d94
RM
27
28routines := \
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 \
46e4bd3b 49 libc_fatal fmemopen
96aa2d94 50
9c38a689 51tests = 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 \
63f8fe54 59 tst-memstream1 tst-memstream2 \
107b8a92 60 tst-wmemstream1 tst-wmemstream2 \
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
65ifeq (yes,$(build-shared))
66# Add test-fopenloc only if shared library is enabled since it depends on
67# shared localedata objects.
68tests += tst-fopenloc
69endif
897d4284 70test-srcs = test-freopen
d64b6ad0 71
3f2e46a4 72ifeq ($(build-shared),yes)
7d6a8338 73routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \
655c0697
UD
74 oldtmpfile oldiofgetpos oldiofgetpos64 oldiofsetpos \
75 oldiofsetpos64
1ea89a40
UD
76endif
77
c75ccd4c 78ifeq (yes,$(libc-reentrant))
edf5b2d7 79routines += 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
82endif
83
c75ccd4c
RM
84CPPFLAGS += $(libio-mtsafe)
85
21cea68e 86# Support for exception handling.
21cea68e 87CFLAGS-fileops.c = $(exceptions)
0261d33f
UD
88CFLAGS-fputc.c = $(exceptions)
89CFLAGS-fputwc.c = $(exceptions)
90CFLAGS-freopen64.c = $(exceptions)
91CFLAGS-freopen.c = $(exceptions)
92CFLAGS-fseek.c = $(exceptions)
93CFLAGS-fseeko64.c = $(exceptions)
94CFLAGS-fseeko.c = $(exceptions)
95CFLAGS-ftello64.c = $(exceptions)
96CFLAGS-ftello.c = $(exceptions)
97CFLAGS-fwide.c = $(exceptions)
98CFLAGS-genops.c = $(exceptions)
99CFLAGS-getc.c = $(exceptions)
100CFLAGS-getchar.c = $(exceptions)
101CFLAGS-getwc.c = $(exceptions)
102CFLAGS-getwchar.c = $(exceptions)
103CFLAGS-iofclose.c = $(exceptions)
104CFLAGS-iofflush.c = $(exceptions)
105CFLAGS-iofgetpos64.c = $(exceptions)
106CFLAGS-iofgetpos.c = $(exceptions)
107CFLAGS-iofgets.c = $(exceptions)
108CFLAGS-iofgetws.c = $(exceptions)
109CFLAGS-iofputs.c = $(exceptions)
110CFLAGS-iofputws.c = $(exceptions)
111CFLAGS-iofread.c = $(exceptions)
112CFLAGS-iofsetpos64.c = $(exceptions)
113CFLAGS-iofsetpos.c = $(exceptions)
114CFLAGS-ioftell.c = $(exceptions)
115CFLAGS-iofwrite.c = $(exceptions)
116CFLAGS-iogetdelim.c = $(exceptions)
117CFLAGS-iogetline.c = $(exceptions)
118CFLAGS-iogets.c = $(exceptions)
119CFLAGS-iogetwline.c = $(exceptions)
120CFLAGS-ioputs.c = $(exceptions)
121CFLAGS-ioseekoff.c = $(exceptions)
122CFLAGS-ioseekpos.c = $(exceptions)
123CFLAGS-iosetbuffer.c = $(exceptions)
124CFLAGS-iosetvbuf.c = $(exceptions)
125CFLAGS-ioungetc.c = $(exceptions)
126CFLAGS-ioungetwc.c = $(exceptions)
127CFLAGS-oldfileops.c = $(exceptions)
128CFLAGS-oldiofclose.c = $(exceptions)
129CFLAGS-oldiofgetpos64.c = $(exceptions)
130CFLAGS-oldiofgetpos.c = $(exceptions)
131CFLAGS-oldiofsetpos64.c = $(exceptions)
132CFLAGS-oldiofsetpos.c = $(exceptions)
133CFLAGS-peekc.c = $(exceptions)
134CFLAGS-putc.c = $(exceptions)
135CFLAGS-putchar.c = $(exceptions)
136CFLAGS-putwc.c = $(exceptions)
137CFLAGS-putwchar.c = $(exceptions)
138CFLAGS-rewind.c = $(exceptions)
21cea68e 139CFLAGS-wfileops.c = $(exceptions)
0261d33f 140CFLAGS-wgenops.c = $(exceptions)
f1c30c98
UD
141CFLAGS-oldiofopen.c = $(exceptions)
142CFLAGS-iofopen.c = $(exceptions)
143CFLAGS-iofopen64.c = $(exceptions)
144CFLAGS-oldtmpfile.c = $(exceptions)
21cea68e
UD
145# XXX Do we need filedoalloc and wfiledoalloc? Others?
146
e8595e84
UD
147CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
148
9c38a689
UD
149tst_wprintf2-ARGS = "Some Text"
150
2bf18041 151tst-fopenloc-ENV = MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
277f8cdf 152
f08e9a26 153generated += tst-fopenloc.mtrace tst-fopenloc.check
a3b231b7 154
414fd335 155aux := fileops genops stdfiles stdio strops
96aa2d94 156
3f2e46a4 157ifeq ($(build-shared),yes)
1ea89a40
UD
158aux += oldfileops oldstdfiles
159endif
160
bd355af0 161shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
655c0697
UD
162 oldstdfiles oldiopopen oldpclose oldtmpfile \
163 oldiofgetpos oldiofgetpos64 oldiofsetpos \
164 oldiofsetpos64
f2ea0f5b 165
03ac099f 166ifeq ($(run-built-tests),yes)
f214606a 167tests-special += $(objpfx)test-freopen.out
bcba7aa2 168ifeq (yes,$(build-shared))
7f98f180
JM
169# Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
170# library is enabled since they depend on tst-fopenloc.out.
f214606a 171tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out
bcba7aa2 172endif
b647f210 173endif
897d4284 174
f214606a
JM
175include ../Rules
176
897d4284 177$(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen
740b3dbe 178 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
f0881698
JM
179 $(common-objpfx)libio/; \
180 $(evaluate-test)
277f8cdf 181
7f98f180
JM
182$(objpfx)tst-fopenloc-cmp.out: ../iconvdata/testdata/ISO-8859-1..UTF8 \
183 $(objpfx)tst-fopenloc.out
f0881698
JM
184 cmp $^ > $@; \
185 $(evaluate-test)
7f98f180
JM
186
187$(objpfx)tst-fopenloc-mem.out: $(objpfx)tst-fopenloc.out
f0881698
JM
188 $(common-objpfx)malloc/mtrace $(objpfx)tst-fopenloc.mtrace > $@; \
189 $(evaluate-test)