Merge getopt patch from Gnulib
[glibc.git] / wcsmbs / Makefile
blob3d19d5556ff408805b14471f68ffff1efef93eb0
1 # Copyright (C) 1995-2022 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 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.
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 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for wcsmbs portion of the library.
21 subdir := wcsmbs
23 include ../Makeconfig
25 headers := wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
26 bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
28 routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
29 wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
30 wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
31 btowc wctob mbsinit \
32 mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
33 mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
34 wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \
35 wcstol_l wcstoul_l wcstoll_l wcstoull_l \
36 wcstod_l wcstold_l wcstof_l \
37 wcstod_nan wcstold_nan wcstof_nan \
38 wcscoll wcsxfrm \
39 wcwidth wcswidth \
40 wcscoll_l wcsxfrm_l \
41 wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
42 wcsmbsload mbsrtowcs_l \
43 isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
44 isoc99_swscanf isoc99_vswscanf \
45 mbrtoc8 c8rtomb mbrtoc16 c16rtomb mbrtoc32 c32rtomb
47 strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \
48 wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \
49 wcscspn wmemchr wmemset
50 tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
51 tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
52 tst-c16c32-1 wcsatcliff tst-wcstol-locale tst-wcstod-nan-locale \
53 tst-wcstod-round test-char-types tst-fgetwc-after-eof \
54 tst-wcstod-nan-sign tst-c16-surrogate tst-c32-state \
55 test-mbrtoc8 test-c8rtomb \
56 $(addprefix test-,$(strop-tests)) tst-mbstowcs \
57 tst-wprintf-binary
59 include ../Rules
61 ifeq ($(run-built-tests),yes)
62 LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 hr_HR.ISO-8859-2 \
63 ja_JP.EUC-JP zh_TW.EUC-TW tr_TR.UTF-8 tr_TR.ISO-8859-9 zh_HK.BIG5-HKSCS
64 include ../gen-locales.mk
66 $(objpfx)tst-btowc.out: $(gen-locales)
67 $(objpfx)tst-c16c32-1.out: $(gen-locales)
68 $(objpfx)tst-mbrtowc.out: $(gen-locales)
69 $(objpfx)tst-mbrtowc2.out: $(gen-locales)
70 $(objpfx)tst-wcrtomb.out: $(gen-locales)
71 $(objpfx)wcsmbs-tst1.out: $(gen-locales)
72 $(objpfx)tst-wcstol-locale.out: $(gen-locales)
73 $(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
74 $(objpfx)tst-c16-surrogate.out: $(gen-locales)
75 $(objpfx)tst-c32-state.out: $(gen-locales)
76 $(objpfx)test-c8rtomb.out: $(gen-locales)
77 $(objpfx)test-mbrtoc8.out: $(gen-locales)
78 endif
80 $(objpfx)tst-wcstod-round: $(libm)
82 CFLAGS-wcwidth.c += -I../wctype
83 CFLAGS-wcswidth.c += -I../wctype
85 strtox-CFLAGS = -I../include
86 CFLAGS-wcstol.c += $(strtox-CFLAGS)
87 CFLAGS-wcstoul.c += $(strtox-CFLAGS)
88 CFLAGS-wcstoll.c += $(strtox-CFLAGS)
89 CFLAGS-wcstoull.c += $(strtox-CFLAGS)
90 CFLAGS-wcstod.c += $(strtox-CFLAGS)
91 CFLAGS-wcstold.c += $(strtox-CFLAGS)
92 CFLAGS-wcstof128.c += $(strtox-CFLAGS)
93 CFLAGS-wcstof.c += $(strtox-CFLAGS)
94 CFLAGS-wcstol_l.c += $(strtox-CFLAGS)
95 CFLAGS-wcstoul_l.c += $(strtox-CFLAGS)
96 CFLAGS-wcstoll_l.c += $(strtox-CFLAGS)
97 CFLAGS-wcstoull_l.c += $(strtox-CFLAGS)
98 CFLAGS-wcstod_l.c += $(strtox-CFLAGS)
99 CFLAGS-wcstold_l.c += $(strtox-CFLAGS)
100 CFLAGS-wcstof128_l.c += $(strtox-CFLAGS)
101 CFLAGS-wcstof_l.c += $(strtox-CFLAGS)
102 CPPFLAGS-tst-wchar-h.c += -D_FORTIFY_SOURCE=2
104 CFLAGS-isoc99_wscanf.c += -fexceptions
105 CFLAGS-isoc99_fwscanf.c += -fexceptions
106 CFLAGS-isoc99_vwscanf.c += -fexceptions
107 CFLAGS-isoc99_vfwscanf.c += -fexceptions
109 CPPFLAGS += $(libio-mtsafe)
111 # We need to find the default version of strtold_l in stdlib.
112 CPPFLAGS-wcstold_l.c += -I../stdlib
114 $(objpfx)tst-wcstod-nan-locale: $(libm)
115 $(objpfx)tst-wcstod-nan-sign: $(libm)