# Copyright (C) 1991-2025 Free Software Foundation, Inc.
# Copyright The GNU Toolchain Authors.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# 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.
# 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
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# <https://www.gnu.org/licenses/>.
#
# Specific makefile for stdio-common.
#
subdir := stdio-common
include ../Makeconfig
# List of markers for printf family function tests.
xprintf-funcs := p as d f s sn v vas vd vf vs vsn
# List of data types and formats for individual per-conversion printf tests.
fmt-convs := double ldouble
fmts := E e F f G g
# List of data types grouping all conversions in single printf tests.
nonfmt-convs := c char int llong long s short
nonfmt-convs += uchar uint ullong ulong ushort
convs := $(sort $(fmt-convs) $(nonfmt-convs))
xprintf-srcs := \
$(foreach p,$(xprintf-funcs), \
$(foreach c,$(convs),tst-printf-format-$(p)-$(c)))
fmt-xprintf-stems := \
$(foreach f,$(fmts), \
$(foreach p,$(xprintf-funcs), \
$(foreach c,$(fmt-convs), \
tst-printf-format-$(p)-$(c)-$(f))))
nonfmt-xprintf-stems := \
$(foreach p,$(xprintf-funcs), \
$(foreach c,$(nonfmt-convs),tst-printf-format-$(p)-$(c)))
xprintf-stems := $(sort $(fmt-xprintf-stems) $(nonfmt-xprintf-stems))
# List of markers for scanf family function tests.
xscanf-funcs := s f ss v vf vs
# List of data types and formats for individual per-conversion scanf tests.
# Further conversions are provided by sysdeps.
xscanf-kinds := char int real uint
fmt-xscanf-char-convs := c
fmts-xscanf-char := b c s
fmt-xscanf-int-convs := char llong short
fmts-xscanf-int := d i
fmt-xscanf-real-convs :=
fmts-xscanf-real := aa a ee e ff f gg g
fmt-xscanf-uint-convs := uchar ullong ushort
fmts-xscanf-uint := b o u xx x
xscanf-convs = $(sort $(fmt-xscanf-char-convs) $(fmt-xscanf-int-convs) \
$(fmt-xscanf-real-convs) $(fmt-xscanf-uint-convs))
xscanf-srcs = $(foreach p,$(xscanf-funcs), \
$(foreach c,$(xscanf-convs),tst-scanf-format-$(p)-$(c)))
xscanf-stems = $(sort $(foreach k,$(xscanf-kinds), \
$(foreach f,$(fmts-xscanf-$(k)), \
$(foreach p,$(xscanf-funcs), \
$(foreach c,$(fmt-xscanf-$(k)-convs), \
tst-scanf-format-$(p)-$(c)-$(f))))))
headers := \
bits/printf-ldbl.h \
bits/stdio_lim.h \
printf.h \
stdio_ext.h \
# headers
routines := \