]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdlib/Makefile
Update.
[thirdparty/glibc.git] / stdlib / Makefile
CommitLineData
7cc27f44 1# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
28f540f4
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
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.
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
12# Library General Public License for more details.
13
14# You should have received a copy of the GNU Library General Public
f65fd747
UD
15# License along with the GNU C Library; see the file COPYING.LIB. If not,
16# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17# Boston, MA 02111-1307, USA.
28f540f4
RM
18
19#
20# Makefile for stdlib routines
21#
22subdir := stdlib
23
6973fc01 24headers := stdlib.h alloca.h monetary.h fmtmsg.h ucontext.h sys/ucontext.h
28f540f4
RM
25
26routines := \
7cc27f44 27 atof atoi atol atoll \
28f540f4
RM
28 abort \
29 bsearch qsort msort \
f65fd747 30 getenv putenv setenv secure-getenv \
28f540f4 31 exit on_exit atexit \
59dd8641
RM
32 abs labs llabs \
33 div ldiv lldiv \
28f540f4 34 mblen mbstowcs mbtowc wcstombs wctomb \
a18f587d 35 random random_r rand rand_r \
60478656
RM
36 drand48 erand48 lrand48 nrand48 mrand48 jrand48 \
37 srand48 seed48 lcong48 \
38 drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r \
39 srand48_r seed48_r lcong48_r \
40 drand48-iter \
2f6d1f1b 41 strtol strtoul strtoll strtoull \
0501d603 42 strtol_l strtoul_l strtoll_l strtoull_l \
28f540f4 43 strtof strtod strtold \
0501d603 44 strtof_l strtod_l strtold_l \
fa0bc87c 45 system canonicalize \
857fa1b8 46 a64l l64a \
0501d603 47 rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg
28f540f4 48
7e3be507 49distribute := exit.h grouping.h abort-instr.h
394f4f17
RM
50tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
51 test-canon
28f540f4 52
3ef21326
RM
53
54# Several mpn functions from GNU MP are used by the strtod function.
0e3426bb 55mpn-routines := inlines add_n addmul_1 cmp divmod_1 divrem udiv_qrnnd \
b5a08c5a 56 lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1
3ef21326
RM
57mpn-headers = longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
58
59routines := $(strip $(routines) $(mpn-routines)) \
60 dbl2mpn ldbl2mpn \
61 mpn2flt mpn2dbl mpn2ldbl
b5a08c5a 62aux := mp_clz_tab fpioconst
3ef21326
RM
63distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h
64
65
28f540f4 66include ../Rules
3ef21326
RM
67
68
69ifdef gmp-srcdir
70
71gmp-srcdir := $(firstword $(filter-out ..//%,$(..)$(gmp-srcdir) $(gmp-srcdir)))
72
73# Copy the mpn source files we use from the GNU MP source directory.
74# `gmp-srcdir' is set by doing `configure --with-gmp=DIR'.
75# (Do not try this at home. You need an as yet unreleased version of GNU MP.)
76
77mpn-sysdep := $(addsuffix .c,$(mpn-routines)) \
78 $(addsuffix .S,$(mpn-routines)) \
79 $(addsuffix .s,$(mpn-routines)) gmp-mparam.h asm-syntax.h
80
b5a08c5a
RM
81mpn-try := $(addprefix $(gmp-srcdir)/mpn/*/,$(mpn-sysdep)) \
82 $(addprefix $(gmp-srcdir)/mpn/*/*/,$(mpn-sysdep))
83mpn-found = $(wildcard $(mpn-try))
3ef21326
RM
84
85include mpn-copy.mk
86%.mk: gen-%; sh $< > $@
87
88mpn-copy-1 := $(patsubst $(gmp-srcdir)/mpn/%,$(sysdep_dir)/%,$(mpn-found))
89mpn-copy-sysdep := $(mpn-copy-sysdep) $(mpn-copy-1)
6cab5056
RM
90mpn-copy-sysdep := $(filter $(addsuffix %,\
91 $(wildcard $(sort $(dir $(mpn-copy-sysdep))))), \
92 $(mpn-copy-sysdep))
3ef21326
RM
93$(mpn-copy-1): $(sysdep_dir)/%: $(ignore gmp2glibc.sed) $(gmp-srcdir)/mpn/%
94 $(gmp2glibc)
95
96mpn-stuff = $(mpn-copy-sysdep) $(mpn-copy)
97
98# chmod so I don't edit them by mistake.
99define gmp2glibc
100$(ignore sed -f $^ > $@-tmp)
101cp $< $@-tmp
102chmod a-w $@-tmp
103mv -f $@-tmp $@
104endef
105
6cab5056 106mpn-copy = $(filter-out $(mpn-sysdep),$(mpn-headers))# mp_clz_tab.c)
3ef21326
RM
107$(mpn-copy): %: $(ignore gmp2glibc.sed) $(gmp-srcdir)/%; $(gmp2glibc)
108
6b628d36
RM
109.PHONY: copy-mpn clean-mpn mpn-stuff
110mpn-stuff: $(mpn-stuff)
3ef21326 111copy-mpn: $(mpn-stuff)
6cab5056 112 test ! -d CVS || cvs commit -m'Updated from $(gmp-srcdir)' $+
3ef21326
RM
113clean-mpn:
114 rm -f $(mpn-stuff)
115
116endif