]> git.ipfire.org Git - thirdparty/glibc.git/blame - libio/Makefile
Complete _BSD_SOURCE / _SVID_source followup cleanup.
[thirdparty/glibc.git] / libio / Makefile
CommitLineData
d4697bc9 1# Copyright (C) 1995-2014 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
b264e1d1 23headers := stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
c6251f03 24 bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h
96aa2d94
RM
25
26routines := \
27 filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
d64b6ad0 28 iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \
f65fd747 29 iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \
77fe0b9c 30 ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \
96aa2d94 31 iovsprintf iovsscanf \
dfd2257a 32 iofgetpos64 iofopen64 iofsetpos64 \
d64b6ad0
UD
33 fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
34 iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \
3944f99e
AS
35 putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \
36 wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \
63f8fe54 37 wstrops wfileops iofwide fwide wmemstream \
96aa2d94 38 \
209caedf 39 clearerr feof ferror fileno fputc freopen fseek getc getchar \
77a58cad 40 memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
a5a0310d 41 iovdprintf vscanf vsnprintf obprintf fcloseall fseeko ftello \
77ccaba1 42 freopen64 fseeko64 ftello64 \
96aa2d94 43 \
a91d3cd3
UD
44 __fbufsize __freading __fwriting __freadable __fwritable __flbf \
45 __fpurge __fpending __fsetlocking \
46 \
46e4bd3b 47 libc_fatal fmemopen
96aa2d94 48
bcba7aa2
L
49include ../Makeconfig
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 \
df675f99 63 tst-fwrite-error tst-ftell-partial-wide
bcba7aa2
L
64ifeq (yes,$(build-shared))
65# Add test-fopenloc only if shared library is enabled since it depends on
66# shared localedata objects.
67tests += tst-fopenloc
68endif
897d4284 69test-srcs = test-freopen
d64b6ad0 70
c4029823
UD
71all: # Make this the default target; it will be defined in Rules.
72
3f2e46a4 73ifeq ($(build-shared),yes)
7d6a8338 74routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \
655c0697
UD
75 oldtmpfile oldiofgetpos oldiofgetpos64 oldiofsetpos \
76 oldiofsetpos64
1ea89a40
UD
77endif
78
c75ccd4c 79ifeq (yes,$(libc-reentrant))
edf5b2d7 80routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \
50304ef0
UD
81 iofflush_u putc_u putchar_u peekc iofread_u iofwrite_u iofgets_u \
82 iofputs_u
edf5b2d7
UD
83endif
84
c75ccd4c
RM
85CPPFLAGS += $(libio-mtsafe)
86
21cea68e 87# Support for exception handling.
21cea68e 88CFLAGS-fileops.c = $(exceptions)
0261d33f
UD
89CFLAGS-fputc.c = $(exceptions)
90CFLAGS-fputwc.c = $(exceptions)
91CFLAGS-freopen64.c = $(exceptions)
92CFLAGS-freopen.c = $(exceptions)
93CFLAGS-fseek.c = $(exceptions)
94CFLAGS-fseeko64.c = $(exceptions)
95CFLAGS-fseeko.c = $(exceptions)
96CFLAGS-ftello64.c = $(exceptions)
97CFLAGS-ftello.c = $(exceptions)
98CFLAGS-fwide.c = $(exceptions)
99CFLAGS-genops.c = $(exceptions)
100CFLAGS-getc.c = $(exceptions)
101CFLAGS-getchar.c = $(exceptions)
102CFLAGS-getwc.c = $(exceptions)
103CFLAGS-getwchar.c = $(exceptions)
104CFLAGS-iofclose.c = $(exceptions)
105CFLAGS-iofflush.c = $(exceptions)
106CFLAGS-iofgetpos64.c = $(exceptions)
107CFLAGS-iofgetpos.c = $(exceptions)
108CFLAGS-iofgets.c = $(exceptions)
109CFLAGS-iofgetws.c = $(exceptions)
110CFLAGS-iofputs.c = $(exceptions)
111CFLAGS-iofputws.c = $(exceptions)
112CFLAGS-iofread.c = $(exceptions)
113CFLAGS-iofsetpos64.c = $(exceptions)
114CFLAGS-iofsetpos.c = $(exceptions)
115CFLAGS-ioftell.c = $(exceptions)
116CFLAGS-iofwrite.c = $(exceptions)
117CFLAGS-iogetdelim.c = $(exceptions)
118CFLAGS-iogetline.c = $(exceptions)
119CFLAGS-iogets.c = $(exceptions)
120CFLAGS-iogetwline.c = $(exceptions)
121CFLAGS-ioputs.c = $(exceptions)
122CFLAGS-ioseekoff.c = $(exceptions)
123CFLAGS-ioseekpos.c = $(exceptions)
124CFLAGS-iosetbuffer.c = $(exceptions)
125CFLAGS-iosetvbuf.c = $(exceptions)
126CFLAGS-ioungetc.c = $(exceptions)
127CFLAGS-ioungetwc.c = $(exceptions)
128CFLAGS-oldfileops.c = $(exceptions)
129CFLAGS-oldiofclose.c = $(exceptions)
130CFLAGS-oldiofgetpos64.c = $(exceptions)
131CFLAGS-oldiofgetpos.c = $(exceptions)
132CFLAGS-oldiofsetpos64.c = $(exceptions)
133CFLAGS-oldiofsetpos.c = $(exceptions)
134CFLAGS-peekc.c = $(exceptions)
135CFLAGS-putc.c = $(exceptions)
136CFLAGS-putchar.c = $(exceptions)
137CFLAGS-putwc.c = $(exceptions)
138CFLAGS-putwchar.c = $(exceptions)
139CFLAGS-rewind.c = $(exceptions)
21cea68e 140CFLAGS-wfileops.c = $(exceptions)
0261d33f 141CFLAGS-wgenops.c = $(exceptions)
f1c30c98
UD
142CFLAGS-oldiofopen.c = $(exceptions)
143CFLAGS-iofopen.c = $(exceptions)
144CFLAGS-iofopen64.c = $(exceptions)
145CFLAGS-oldtmpfile.c = $(exceptions)
21cea68e
UD
146# XXX Do we need filedoalloc and wfiledoalloc? Others?
147
e8595e84
UD
148CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
149
9c38a689
UD
150tst_wprintf2-ARGS = "Some Text"
151
a3b231b7 152tst-widetext-ENV = LOCPATH=$(common-objpfx)localedata LANGUAGE=C
277f8cdf
UD
153tst-fopenloc-ENV = LOCPATH=$(common-objpfx)localedata \
154 MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
8f739934
UD
155tst-fgetws-ENV = LOCPATH=$(common-objpfx)localedata
156tst-ungetwc1-ENV = LOCPATH=$(common-objpfx)localedata
40a982a9 157tst-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata
c9f1fc22 158bug-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata
cc7f258f 159tst-swscanf-ENV = LOCPATH=$(common-objpfx)localedata
eb35b097 160bug-ftell-ENV = LOCPATH=$(common-objpfx)localedata
eae3208e 161tst-fgetwc-ENV = LOCPATH=$(common-objpfx)localedata
4573c6b0 162tst-fseek-ENV = LOCPATH=$(common-objpfx)localedata
277f8cdf
UD
163
164generated = tst-fopenloc.mtrace tst-fopenloc.check
a3b231b7 165
414fd335 166aux := fileops genops stdfiles stdio strops
96aa2d94 167
3f2e46a4 168ifeq ($(build-shared),yes)
1ea89a40
UD
169aux += oldfileops oldstdfiles
170endif
171
bd355af0 172shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
655c0697
UD
173 oldstdfiles oldiopopen oldpclose oldtmpfile \
174 oldiofgetpos oldiofgetpos64 oldiofsetpos \
175 oldiofsetpos64
f2ea0f5b 176
96aa2d94 177include ../Rules
897d4284 178
03ac099f 179ifeq ($(run-built-tests),yes)
bcba7aa2
L
180tests: $(objpfx)test-freopen.out
181ifeq (yes,$(build-shared))
7f98f180
JM
182# Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
183# library is enabled since they depend on tst-fopenloc.out.
184tests: $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out
bcba7aa2 185endif
b647f210 186endif
897d4284
UD
187
188$(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen
740b3dbe 189 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
5a7eedfb 190 $(common-objpfx)libio/
277f8cdf 191
7f98f180
JM
192$(objpfx)tst-fopenloc-cmp.out: ../iconvdata/testdata/ISO-8859-1..UTF8 \
193 $(objpfx)tst-fopenloc.out
194 cmp $^ > $@
195
196$(objpfx)tst-fopenloc-mem.out: $(objpfx)tst-fopenloc.out
197 $(common-objpfx)malloc/mtrace $(objpfx)tst-fopenloc.mtrace > $@