1 # Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
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 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If
16 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 # Cambridge, MA 02139, USA.
20 # Specific makefile for stdio.
24 headers
:= stdio.h stdio_lim.h printf.h
28 feof ferror clearerr fileno \
29 newstream fopen freopen fdopen fopncook fmemopen \
30 setbuf setvbuf setbuffer setlinebuf \
31 fseek ftell rewind fgetpos fsetpos \
32 vfprintf vprintf printf_fp reg-printf printf-prs _itoa \
33 vsnprintf vsprintf vasprintf \
34 fprintf printf snprintf sprintf asprintf \
36 vfscanf vscanf vsscanf \
40 fgetc getc getchar getw \
41 fputc putc putchar putw \
42 fgets gets fputs puts \
45 tmpfile tmpnam tempnam tempname \
49 internals sysd-stdio pipestream stdio_init libc_fatal
51 # Several mpn functions from GNU MP are used by the printf_fp function.
52 mpn-routines
:= add_1 add_n addmul_1 cmp divmod divmod_1 udiv_qrnnd \
53 lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1
54 mpn-headers
= longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
56 routines
:= $(strip $(routines
) $(mpn-routines
)) \
58 mpn2flt mpn2dbl mpn2ldbl
59 aux
:= errlist siglist defs glue mp_clz_tab fpioconst
60 distribute
= $(mpn-headers
) gen-mpn-copy _itoa.h fpioconst.h
62 tests
:= tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
63 temptest tst-fileno test-fwrite \
65 bug1 bug2 bug3 bug4 bug5 bug6 bug7
73 gmp-srcdir
:= $(firstword $(filter-out ..
//%,$(..
)$(gmp-srcdir
) $(gmp-srcdir
)))
75 # Copy the mpn source files we use from the GNU MP source directory.
76 # `gmp-srcdir' is set by doing `configure --with-gmp=DIR'.
77 # (Do not try this at home. You need an as yet unreleased version of GNU MP.)
79 mpn-sysdep
:= $(addsuffix .c
,$(mpn-routines
)) \
80 $(addsuffix .S
,$(mpn-routines
)) \
81 $(addsuffix .s
,$(mpn-routines
)) gmp-mparam.h asm-syntax.h
83 mpn-try
:= $(addprefix $(gmp-srcdir
)/mpn
/*/,$(mpn-sysdep
))
84 mpn-found
:= $(wildcard $(mpn-try
))
85 mpn-found
:= $(filter-out $(patsubst %.S
,%.s
,$(filter %.s
,$(mpn-found
))),\
89 %.mk
: gen-
%; sh
$< > $@
91 mpn-copy-1
:= $(patsubst $(gmp-srcdir
)/mpn
/%,$(sysdep_dir
)/%,$(mpn-found
))
92 mpn-copy-sysdep
:= $(mpn-copy-sysdep
) $(mpn-copy-1
)
93 $(mpn-copy-1
): $(sysdep_dir
)/%: $(ignore gmp2glibc.sed
) $(gmp-srcdir
)/mpn
/%
96 mpn-stuff
= $(mpn-copy-sysdep
) $(mpn-copy
)
98 # chmod so I don't edit them by mistake.
100 $(ignore sed
-f
$^
> $@
-tmp
)
106 mpn-copy
= $(filter-out $(mpn-sysdep
),$(mpn-headers
) mp_clz_tab.c
)
107 $(mpn-copy
): %: $(ignore gmp2glibc.sed
) $(gmp-srcdir
)/%; $(gmp2glibc
)
109 .PHONY
: copy-mpn clean-mpn
110 copy-mpn
: $(mpn-stuff
)