summaryrefslogtreecommitdiff
path: root/libc/stdio/Makefile.in
blob: 38bd8b6cf5ddcaa8b30e0be26a3ef5b290f5e194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Makefile for uClibc
#
# Copyright (C) 2000 by Lineo, inc.
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
# Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
#

# SUSv3 functions
CSRC := \
	fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \
	fseeko.c fsetpos.c ftello.c getdelim.c getline.c gets.c getw.c \
	perror.c puts.c putw.c remove.c rewind.c setbuf.c setbuffer.c \
	setlinebuf.c setvbuf.c ungetc.c \
	printf.c vprintf.c vsprintf.c fprintf.c snprintf.c dprintf.c \
	asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \
	tmpfile.c tmpnam.c tmpnam_r.c popen.c tempnam.c ctermid.c

ifeq ($(UCLIBC_HAS_LFS),y)
CSRC += fgetpos64.c fopen64.c freopen64.c fseeko64.c fsetpos64.c ftello64.c
endif

# getc -> alias for fgetc
# putc -> alias for fputc
# rename is a syscall

# Implementation support functions
CSRC += \
	_READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \
	_rfill.c _stdio.c _trans2r.c _trans2w.c _wcommit.c \
	_cs_funcs.c _load_inttype.c _store_inttype.c _uintmaxtostr.c
ifeq ($(UCLIBC_HAS_FLOATS),y)
CSRC += _fpmaxtostr.c
endif

# stdio_ext.h functions
CSRC += \
	__fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \
	__freading.c __fsetlocking.c __fwritable.c __fwriting.c _flushlbf.c

# Other glibc extensions
ifeq ($(UCLIBC_HAS_GLIBC_CUSTOM_STREAMS),y)
CSRC += fopencookie.c fmemopen.c open_memstream.c
endif

# pthread functions
CSRC += flockfile.c ftrylockfile.c funlockfile.c

# Functions with unlocked versions
CUSRC := \
	clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \
	fputc.c fputs.c fread.c fwrite.c getchar.c putchar.c
# getc_unlocked -> alias for fgetc_unlocked
# putc_unlocked -> alias for fputc_unlocked

# vfprintf and support functions
ifneq ($(USE_OLD_VFPRINTF),y)
CSRC += \
	vfprintf.c \
	_ppfs_init.c _ppfs_prepargs.c _ppfs_setargs.c _ppfs_parsespec.c \
	register_printf_function.c parse_printf_format.c
else
CSRC += old_vfprintf.c
endif

# vfscanf and support functions plus other *scanf funcs
CSRC += \
	vfscanf.c __scan_cookie.c __psfs_parse_spec.c __psfs_do_numeric.c \
	scanf.c sscanf.c fscanf.c vscanf.c vsscanf.c

ifeq ($(UCLIBC_HAS_WCHAR),y)
CSRC += _wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \
	fwide.c ungetwc.c
CUSRC += fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c
# getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias)
# putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias)
CSRC += vfwprintf.c
CSRC += wscanf.c swscanf.c fwscanf.c vwscanf.c vswscanf.c vfwscanf.c
endif

CUSRC_UNLOCKED := $(patsubst %.c,%_unlocked.c,$(CUSRC))

CSRC += $(CUSRC) $(CUSRC_UNLOCKED)

STDIO_DIR := $(top_srcdir)libc/stdio
STDIO_OUT := $(top_builddir)libc/stdio

STDIO_SRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC))
STDIO_OBJ := $(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC))

libc-y += $(STDIO_OBJ)

objclean-y += stdio_objclean

stdio_objclean:
	$(RM) $(STDIO_OUT)/*.{o,os}