]> git.ipfire.org Git - thirdparty/glibc.git/blame - libio/Makefile
[BZ #1996]
[thirdparty/glibc.git] / libio / Makefile
CommitLineData
c6251f03 1# Copyright (C) 1995-2002,2003,2004,2006 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
AJ
14# You should have received a copy of the GNU Lesser General Public
15# License along with the GNU C Library; if not, write to the Free
16# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17# 02111-1307 USA.
96aa2d94
RM
18
19#
20# Specific makefile for libio.
21#
22subdir := libio
23
b264e1d1 24headers := stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
c6251f03 25 bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h
96aa2d94
RM
26
27routines := \
28 filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
d64b6ad0 29 iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \
f65fd747 30 iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \
77fe0b9c 31 ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \
96aa2d94 32 iovsprintf iovsscanf \
dfd2257a 33 iofgetpos64 iofopen64 iofsetpos64 \
d64b6ad0
UD
34 fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
35 iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \
3944f99e
AS
36 putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \
37 wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \
63f8fe54 38 wstrops wfileops iofwide fwide wmemstream \
96aa2d94 39 \
209caedf 40 clearerr feof ferror fileno fputc freopen fseek getc getchar \
77a58cad 41 memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
a5a0310d 42 iovdprintf vscanf vsnprintf obprintf fcloseall fseeko ftello \
77ccaba1 43 freopen64 fseeko64 ftello64 \
96aa2d94 44 \
a91d3cd3
UD
45 __fbufsize __freading __fwriting __freadable __fwritable __flbf \
46 __fpurge __fpending __fsetlocking \
47 \
46e4bd3b 48 libc_fatal fmemopen
96aa2d94 49
9c38a689 50tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
5e473a71 51 tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-fopenloc \
3384a8d6 52 tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf \
81c64d40 53 tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \
442685a8 54 tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
acbee5f6 55 tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
eb35b097 56 tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
01715b03 57 bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
63f8fe54 58 tst-memstream1 tst-memstream2 \
107b8a92
UD
59 tst-wmemstream1 tst-wmemstream2 \
60 bug-memstream1 bug-wmemstream1
897d4284 61test-srcs = test-freopen
d64b6ad0 62
c4029823
UD
63all: # Make this the default target; it will be defined in Rules.
64
edf5b2d7
UD
65include ../Makeconfig
66
1ea89a40 67ifeq ($(versioning),yes)
7d6a8338 68routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \
655c0697
UD
69 oldtmpfile oldiofgetpos oldiofgetpos64 oldiofsetpos \
70 oldiofsetpos64
1ea89a40
UD
71endif
72
edf5b2d7
UD
73ifneq (,$(filter %REENTRANT, $(defines)))
74routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \
50304ef0
UD
75 iofflush_u putc_u putchar_u peekc iofread_u iofwrite_u iofgets_u \
76 iofputs_u
edf5b2d7
UD
77
78CPPFLAGS += -D_IO_MTSAFE_IO
79endif
80
21cea68e 81# Support for exception handling.
21cea68e 82CFLAGS-fileops.c = $(exceptions)
0261d33f
UD
83CFLAGS-fputc.c = $(exceptions)
84CFLAGS-fputwc.c = $(exceptions)
85CFLAGS-freopen64.c = $(exceptions)
86CFLAGS-freopen.c = $(exceptions)
87CFLAGS-fseek.c = $(exceptions)
88CFLAGS-fseeko64.c = $(exceptions)
89CFLAGS-fseeko.c = $(exceptions)
90CFLAGS-ftello64.c = $(exceptions)
91CFLAGS-ftello.c = $(exceptions)
92CFLAGS-fwide.c = $(exceptions)
93CFLAGS-genops.c = $(exceptions)
94CFLAGS-getc.c = $(exceptions)
95CFLAGS-getchar.c = $(exceptions)
96CFLAGS-getwc.c = $(exceptions)
97CFLAGS-getwchar.c = $(exceptions)
98CFLAGS-iofclose.c = $(exceptions)
99CFLAGS-iofflush.c = $(exceptions)
100CFLAGS-iofgetpos64.c = $(exceptions)
101CFLAGS-iofgetpos.c = $(exceptions)
102CFLAGS-iofgets.c = $(exceptions)
103CFLAGS-iofgetws.c = $(exceptions)
104CFLAGS-iofputs.c = $(exceptions)
105CFLAGS-iofputws.c = $(exceptions)
106CFLAGS-iofread.c = $(exceptions)
107CFLAGS-iofsetpos64.c = $(exceptions)
108CFLAGS-iofsetpos.c = $(exceptions)
109CFLAGS-ioftell.c = $(exceptions)
110CFLAGS-iofwrite.c = $(exceptions)
111CFLAGS-iogetdelim.c = $(exceptions)
112CFLAGS-iogetline.c = $(exceptions)
113CFLAGS-iogets.c = $(exceptions)
114CFLAGS-iogetwline.c = $(exceptions)
115CFLAGS-ioputs.c = $(exceptions)
116CFLAGS-ioseekoff.c = $(exceptions)
117CFLAGS-ioseekpos.c = $(exceptions)
118CFLAGS-iosetbuffer.c = $(exceptions)
119CFLAGS-iosetvbuf.c = $(exceptions)
120CFLAGS-ioungetc.c = $(exceptions)
121CFLAGS-ioungetwc.c = $(exceptions)
122CFLAGS-oldfileops.c = $(exceptions)
123CFLAGS-oldiofclose.c = $(exceptions)
124CFLAGS-oldiofgetpos64.c = $(exceptions)
125CFLAGS-oldiofgetpos.c = $(exceptions)
126CFLAGS-oldiofsetpos64.c = $(exceptions)
127CFLAGS-oldiofsetpos.c = $(exceptions)
128CFLAGS-peekc.c = $(exceptions)
129CFLAGS-putc.c = $(exceptions)
130CFLAGS-putchar.c = $(exceptions)
131CFLAGS-putwc.c = $(exceptions)
132CFLAGS-putwchar.c = $(exceptions)
133CFLAGS-rewind.c = $(exceptions)
21cea68e 134CFLAGS-wfileops.c = $(exceptions)
0261d33f 135CFLAGS-wgenops.c = $(exceptions)
f1c30c98
UD
136CFLAGS-oldiofopen.c = $(exceptions)
137CFLAGS-iofopen.c = $(exceptions)
138CFLAGS-iofopen64.c = $(exceptions)
139CFLAGS-oldtmpfile.c = $(exceptions)
21cea68e
UD
140# XXX Do we need filedoalloc and wfiledoalloc? Others?
141
e8595e84
UD
142CFLAGS-tst_putwc.c = -DOBJPFX=\"$(objpfx)\"
143
9c38a689
UD
144tst_wprintf2-ARGS = "Some Text"
145
a3b231b7 146tst-widetext-ENV = LOCPATH=$(common-objpfx)localedata LANGUAGE=C
277f8cdf
UD
147tst-fopenloc-ENV = LOCPATH=$(common-objpfx)localedata \
148 MALLOC_TRACE=$(objpfx)tst-fopenloc.mtrace
8f739934
UD
149tst-fgetws-ENV = LOCPATH=$(common-objpfx)localedata
150tst-ungetwc1-ENV = LOCPATH=$(common-objpfx)localedata
40a982a9 151tst-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata
c9f1fc22 152bug-ungetwc2-ENV = LOCPATH=$(common-objpfx)localedata
cc7f258f 153tst-swscanf-ENV = LOCPATH=$(common-objpfx)localedata
eb35b097 154bug-ftell-ENV = LOCPATH=$(common-objpfx)localedata
277f8cdf
UD
155
156generated = tst-fopenloc.mtrace tst-fopenloc.check
a3b231b7 157
414fd335 158aux := fileops genops stdfiles stdio strops
96aa2d94 159
1ea89a40
UD
160ifeq ($(versioning),yes)
161aux += oldfileops oldstdfiles
162endif
163
bd355af0 164shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
655c0697
UD
165 oldstdfiles oldiopopen oldpclose oldtmpfile \
166 oldiofgetpos oldiofgetpos64 oldiofsetpos \
167 oldiofsetpos64
f2ea0f5b 168
1dc843f7
UD
169distribute := iolibio.h libioP.h strfile.h Banner test-freopen.sh \
170 fd_to_filename.h
96aa2d94
RM
171
172include ../Rules
897d4284 173
b647f210 174ifeq (no,$(cross-compiling))
277f8cdf 175tests: $(objpfx)test-freopen.out $(objpfx)tst-fopenloc.check
b647f210 176endif
897d4284
UD
177
178$(objpfx)test-freopen.out: test-freopen.sh $(objpfx)test-freopen
2632a4cc 179 $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' \
5a7eedfb 180 $(common-objpfx)libio/
277f8cdf
UD
181
182$(objpfx)tst-fopenloc.check: $(objpfx)tst-fopenloc.out
183 cmp ../iconvdata/testdata/ISO-8859-1..UTF8 $(objpfx)tst-fopenloc.out \
184 > $@
185 $(common-objpfx)malloc/mtrace $(objpfx)tst-fopenloc.mtrace >> $@