Files
glibc/stdlib/Makefile
T

223 lines
7.8 KiB
Makefile
Raw Normal View History

# Copyright (C) 1991-2017 Free Software Foundation, Inc.
1995-02-18 01:27:10 +00:00
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
2001-07-06 04:58:11 +00:00
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
1995-02-18 01:27:10 +00:00
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2001-07-06 04:58:11 +00:00
# Lesser General Public License for more details.
1995-02-18 01:27:10 +00:00
2001-07-06 04:58:11 +00:00
# You should have received a copy of the GNU Lesser General Public
2012-02-09 23:18:22 +00:00
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
1995-02-18 01:27:10 +00:00
#
# Makefile for stdlib routines
#
subdir := stdlib
include ../Makeconfig
2012-11-02 18:43:27 -07:00
headers := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h \
monetary.h bits/monetary-ldbl.h \
inttypes.h stdint.h bits/wordsize.h \
errno.h sys/errno.h bits/errno.h \
ucontext.h sys/ucontext.h \
2013-02-13 13:44:36 +01:00
alloca.h fmtmsg.h \
bits/stdlib-bsearch.h sys/random.h bits/stdint-intn.h \
bits/stdint-uintn.h
1995-02-18 01:27:10 +00:00
routines := \
1997-02-10 03:19:57 +00:00
atof atoi atol atoll \
1995-02-18 01:27:10 +00:00
abort \
bsearch qsort msort \
1996-12-08 08:01:13 +00:00
getenv putenv setenv secure-getenv \
2001-02-26 17:53:15 +00:00
exit on_exit atexit cxa_atexit cxa_finalize old_atexit \
2013-02-18 19:08:21 +05:30
quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl \
abs labs llabs \
div ldiv lldiv \
1995-02-18 01:27:10 +00:00
mblen mbstowcs mbtowc wcstombs wctomb \
1996-12-07 03:30:25 +00:00
random random_r rand rand_r \
drand48 erand48 lrand48 nrand48 mrand48 jrand48 \
srand48 seed48 lcong48 \
drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r \
srand48_r seed48_r lcong48_r \
drand48-iter getrandom getentropy \
strfromf strfromd strfroml \
1997-02-25 05:18:05 +00:00
strtol strtoul strtoll strtoull \
1997-05-24 02:30:09 +00:00
strtol_l strtoul_l strtoll_l strtoull_l \
1995-02-18 01:27:10 +00:00
strtof strtod strtold \
1997-05-24 02:30:09 +00:00
strtof_l strtod_l strtold_l \
2015-11-24 22:24:52 +00:00
strtof_nan strtod_nan strtold_nan \
system canonicalize \
a64l l64a \
1997-12-28 16:01:53 +00:00
rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \
1998-01-25 17:01:47 +00:00
strtoimax strtoumax wcstoimax wcstoumax \
getcontext setcontext makecontext swapcontext
2008-03-08 04:18:31 +00:00
aux = grouping groupingwc tens_in_limb
1995-02-18 01:27:10 +00:00
2001-02-26 17:53:15 +00:00
# These routines will be omitted from the libc shared object.
# Instead the static object files will be included in a special archive
# linked against when the shared library will be used.
static-only-routines = atexit at_quick_exit
2001-02-26 17:53:15 +00:00
2000-10-27 23:37:52 +00:00
test-srcs := tst-fmtmsg
2002-12-17 06:52:45 +00:00
tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \
2005-02-10 09:40:23 +00:00
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
tst-setcontext2 test-a64l tst-qsort tst-system testmb2 \
bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 \
tst-rand48-2 tst-makecontext tst-strtod5 \
tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \
2012-07-25 19:46:22 +02:00
tst-makecontext3 bug-getcontext bug-fmtmsg1 \
tst-secure-getenv tst-strtod-overflow tst-strtod-round \
tst-tininess tst-strtod-underflow tst-setcontext3 \
tst-strtol-locale tst-strtod-nan-locale tst-strfmon_l \
2016-09-21 17:06:36 +00:00
tst-quick_exit tst-thread-quick_exit tst-width \
tst-width-stdint tst-strfrom tst-strfrom-locale \
tst-getrandom
tests-internal := tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
tst-tls-atexit tst-tls-atexit-nodelete
tests-static := tst-secure-getenv
ifeq ($(build-hardcoded-path-in-tests),yes)
tests += tst-empty-env
endif
ifeq ($(have-cxx-thread_local),yes)
CFLAGS-tst-quick_exit.o = -std=c++11
LDLIBS-tst-quick_exit = -lstdc++
CFLAGS-tst-thread-quick_exit.o = -std=c++11
LDLIBS-tst-thread-quick_exit = -lstdc++
$(objpfx)tst-thread-quick_exit: $(shared-thread-library)
else
tests-unsupported += tst-quick_exit tst-thread-quick_exit
endif
1995-02-18 01:27:10 +00:00
2013-02-18 19:08:21 +05:30
modules-names = tst-tls-atexit-lib
2016-04-13 17:04:37 +02:00
extra-test-objs += $(addsuffix .os, $(modules-names))
2013-02-18 19:08:21 +05:30
2005-01-04 07:48:13 +00:00
ifeq ($(build-shared),yes)
tests += tst-putenv
endif
# Several mpn functions from GNU MP are used by the strtod function.
mpn-routines := inlines add_n addmul_1 cmp divmod_1 divrem udiv_qrnnd \
lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1
mpn-headers = longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
routines := $(strip $(routines) $(mpn-routines)) \
dbl2mpn ldbl2mpn \
mpn2flt mpn2dbl mpn2ldbl
2003-06-11 23:22:36 +00:00
aux += fpioconst mp_clz_tab
2005-01-04 07:48:13 +00:00
tests-extras += tst-putenvmod
2006-08-21 21:06:35 +00:00
extra-test-objs += tst-putenvmod.os
2005-01-04 07:48:13 +00:00
generated += isomac isomac.out tst-putenvmod.so
2003-09-16 05:54:09 +00:00
CFLAGS-bsearch.c = $(uses-callbacks)
CFLAGS-msort.c = $(uses-callbacks)
CFLAGS-qsort.c = $(uses-callbacks)
CFLAGS-system.c = -fexceptions
CFLAGS-system.os = -fomit-frame-pointer
2003-09-02 07:14:15 +00:00
CFLAGS-fmtmsg.c = -fexceptions
1998-06-26 14:47:05 +00:00
CFLAGS-strfmon.c = $(libio-mtsafe)
CFLAGS-strfmon_l.c = $(libio-mtsafe)
2001-02-07 19:07:39 +00:00
# The strfrom class of functions call __printf_fp in order to convert the
# floating-point value to characters. This requires the value of IO_MTSAFE_IO.
CFLAGS-strfromd.c = $(libio-mtsafe)
CFLAGS-strfromf.c = $(libio-mtsafe)
CFLAGS-strfroml.c = $(libio-mtsafe)
2003-09-17 08:47:44 +00:00
CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
2003-09-17 18:23:49 +00:00
CFLAGS-tst-qsort.c = $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
2003-09-17 08:47:44 +00:00
# Run a test on the header files we use.
tests-special += $(objpfx)isomac.out
ifeq ($(run-built-tests),yes)
tests-special += $(objpfx)tst-fmtmsg.out
endif
1995-02-18 01:27:10 +00:00
include ../Rules
ifeq ($(run-built-tests),yes)
2015-11-23 08:50:53 +00:00
LOCALES := cs_CZ.UTF-8 de_DE.UTF-8 en_US.ISO-8859-1 tr_TR.UTF-8 \
tr_TR.ISO-8859-9 tg_TJ.UTF-8 te_IN.UTF-8 bn_IN.UTF-8 \
el_GR.UTF-8
include ../gen-locales.mk
$(objpfx)bug-strtod2.out: $(gen-locales)
$(objpfx)testmb2.out: $(gen-locales)
$(objpfx)tst-strtod.out: $(gen-locales)
$(objpfx)tst-strtod3.out: $(gen-locales)
$(objpfx)tst-strtod4.out: $(gen-locales)
$(objpfx)tst-strtod5.out: $(gen-locales)
2015-11-23 08:50:53 +00:00
$(objpfx)tst-strtol-locale.out: $(gen-locales)
$(objpfx)tst-strtod-nan-locale.out: $(gen-locales)
$(objpfx)tst-strfmon_l.out: $(gen-locales)
2016-10-22 19:09:46 +05:30
$(objpfx)tst-strfrom.out: $(gen-locales)
$(objpfx)tst-strfrom-locale.out: $(gen-locales)
endif
2000-05-17 11:04:21 +00:00
# Testdir has to be named stdlib and needs to be writable
2000-07-12 20:06:44 +00:00
test-canon-ARGS = --test-dir=${common-objpfx}stdlib
2000-05-17 11:04:21 +00:00
2012-01-16 09:03:20 -05:00
bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev
2001-01-24 22:19:16 +00:00
2000-07-16 07:30:42 +00:00
$(objpfx)isomac.out: $(objpfx)isomac
2001-01-23 12:46:59 +00:00
$(dir $<)$(notdir $<) '$(CC)' \
'-I../include $(+sysdep-includes) $(sysincludes) -I..' > $<.out; \
$(evaluate-test)
1998-02-11 11:59:55 +00:00
2001-09-12 18:50:25 +00:00
isomac-CFLAGS = -O
1998-02-11 11:59:55 +00:00
$(objpfx)isomac: isomac.c
$(native-compile)
2000-10-27 23:37:52 +00:00
$(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $(objpfx)tst-fmtmsg
$(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
'$(run-program-env)' '$(test-program-prefix-after-env)' \
$(common-objpfx)stdlib/; \
$(evaluate-test)
2005-01-04 07:48:13 +00:00
$(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so
2012-04-16 14:06:47 +10:00
LDFLAGS-tst-putenv = $(no-as-needed)
2005-01-04 07:48:13 +00:00
$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
2005-01-04 07:48:13 +00:00
$(build-module)
libof-tst-putenvmod = extramodules
$(objpfx)bug-getcontext: $(libm)
$(objpfx)bug-strtod2: $(libm)
$(objpfx)tst-strtod-round: $(libm)
$(objpfx)tst-tininess: $(libm)
$(objpfx)tst-strtod-underflow: $(libm)
$(objpfx)tst-strtod6: $(libm)
$(objpfx)tst-strtod-nan-locale: $(libm)
2013-02-18 19:08:21 +05:30
tst-tls-atexit-lib.so-no-z-defs = yes
$(objpfx)tst-tls-atexit: $(shared-thread-library) $(libdl)
2013-02-18 19:08:21 +05:30
$(objpfx)tst-tls-atexit.out: $(objpfx)tst-tls-atexit-lib.so
$(objpfx)tst-tls-atexit-nodelete: $(shared-thread-library) $(libdl)
$(objpfx)tst-tls-atexit-nodelete.out: $(objpfx)tst-tls-atexit-lib.so
$(objpfx)tst-setcontext3.out: tst-setcontext3.sh $(objpfx)tst-setcontext3
$(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
'$(run-program-env)' '$(test-program-prefix-after-env)' \
$(common-objpfx)stdlib/; \
$(evaluate-test)
$(objpfx)tst-makecontext: $(libdl)