Makefile.in 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
  4. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. #
  8. # Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
  9. #
  10. subdirs += libc/stdio
  11. # SUSv3 functions
  12. CSRC-y := \
  13. fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \
  14. fseeko.c fsetpos.c ftello.c getdelim.c getline.c gets.c getw.c \
  15. perror.c puts.c putw.c remove.c rewind.c setbuf.c setbuffer.c \
  16. setlinebuf.c setvbuf.c ungetc.c \
  17. printf.c vprintf.c vsprintf.c fprintf.c snprintf.c dprintf.c \
  18. asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \
  19. tmpfile.c popen.c ctermid.c
  20. CSRC-y += fgetpos64.c fopen64.c freopen64.c fseeko64.c fsetpos64.c ftello64.c
  21. CSRC-$(UCLIBC_SUSV4_LEGACY) += tmpnam.c tmpnam_r.c tempnam.c
  22. # internal support functions
  23. CSRC-y += \
  24. _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \
  25. _rfill.c _stdio.c _trans2r.c _trans2w.c _wcommit.c \
  26. _cs_funcs.c _load_inttype.c _store_inttype.c _uintmaxtostr.c
  27. CSRC-$(UCLIBC_HAS_FLOATS) += _fpmaxtostr.c
  28. # stdio_ext.h functions
  29. CSRC-y += \
  30. __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \
  31. __freading.c __fsetlocking.c __fwritable.c __fwriting.c _flushlbf.c
  32. # Other glibc extensions
  33. CSRC-$(UCLIBC_HAS_GLIBC_CUSTOM_STREAMS) += fopencookie.c fmemopen.c \
  34. open_memstream.c
  35. # pthread functions
  36. CSRC-y += flockfile.c ftrylockfile.c funlockfile.c
  37. # Functions with unlocked versions
  38. CUSRC-y := \
  39. clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \
  40. fputc.c fputs.c fread.c fwrite.c getchar.c putchar.c
  41. # getc_unlocked -> alias for fgetc_unlocked
  42. # putc_unlocked -> alias for fputc_unlocked
  43. # vfprintf and support functions
  44. ifeq ($(USE_OLD_VFPRINTF),y)
  45. VF_CSRC := old_vfprintf.c
  46. else
  47. # multi source _vfprintf.c
  48. VF_CSRC := \
  49. vfprintf.c \
  50. _vfprintf_internal.c \
  51. _ppfs_init.c _ppfs_prepargs.c _ppfs_setargs.c _ppfs_parsespec.c \
  52. register_printf_function.c parse_printf_format.c
  53. endif
  54. CSRC-y += $(VF_CSRC)
  55. # vfscanf and support functions plus other *scanf funcs
  56. CSRC-y += \
  57. vfscanf.c __scan_cookie.c __psfs_parse_spec.c __psfs_do_numeric.c \
  58. scanf.c sscanf.c fscanf.c vscanf.c vsscanf.c
  59. CSRC-$(UCLIBC_HAS_WCHAR) += \
  60. _wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \
  61. fwide.c ungetwc.c
  62. CUSRC-$(UCLIBC_HAS_WCHAR) += \
  63. fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c
  64. # getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias)
  65. # putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias)
  66. CSRC-$(UCLIBC_HAS_WCHAR) += vfwprintf.c _vfwprintf_internal.c \
  67. wscanf.c swscanf.c fwscanf.c vwscanf.c vswscanf.c vfwscanf.c
  68. CUSRC_UNLOCKED := $(patsubst %.c,%_unlocked.c,$(CUSRC-y))
  69. CSRC-y += $(CUSRC-y) $(CUSRC_UNLOCKED)
  70. STDIO_DIR := $(top_srcdir)libc/stdio
  71. STDIO_OUT := $(top_builddir)libc/stdio
  72. STDIO_SRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC-y))
  73. STDIO_OBJ := $(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC-y))
  74. libc-y += $(STDIO_OBJ)
  75. ifneq ($(USE_OLD_VFPRINTF),y)
  76. libc-nomulti-y += $(patsubst %.c,$(STDIO_OUT)/%.o,$(VF_CSRC))
  77. endif
  78. libc-nomulti-$(UCLIBC_HAS_WCHAR) += $(STDIO_OUT)/vfwprintf.o \
  79. $(STDIO_OUT)/vfwscanf.o
  80. objclean-y += CLEAN_libc/stdio
  81. CLEAN_libc/stdio:
  82. $(do_rm) $(addprefix $(STDIO_OUT)/*., o os oS)