Makefile.in 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000 by Lineo, inc.
  4. # Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
  5. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  6. #
  7. # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
  8. #
  9. # Note: The *64.o objects are empty when compiled without large file support.
  10. # SUSv3 functions
  11. CSRC:= fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \
  12. fseeko.c fsetpos.c ftello.c getdelim.c getline.c gets.c getw.c \
  13. perror.c puts.c putw.c remove.c rewind.c setbuf.c setbuffer.c \
  14. setlinebuf.c setvbuf.c ungetc.c \
  15. printf.c vprintf.c vsprintf.c fprintf.c snprintf.c dprintf.c \
  16. asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \
  17. tmpfile.c tmpnam.c tmpnam_r.c popen.c tempnam.c ctermid.c
  18. # getc -> alias for fgetc
  19. # putc -> alias for fputc
  20. # rename is a syscall
  21. # Implementation support functions
  22. CSRC+= _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \
  23. _rfill.c _stdio.c _trans2r.c _trans2w.c _wcommit.c \
  24. _cs_funcs.c _load_inttype.c _store_inttype.c _uintmaxtostr.c
  25. ifeq ($(UCLIBC_HAS_FLOATS),y)
  26. CSRC+=_fpmaxtostr.c
  27. endif
  28. # stdio_ext.h functions
  29. CSRC+= __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \
  30. __freading.c __fsetlocking.c __fwritable.c __fwriting.c _flushlbf.c
  31. # Other glibc extensions
  32. ifeq ($(UCLIBC_HAS_GLIBC_CUSTOM_STREAMS),y)
  33. CSRC+=fopencookie.c fmemopen.c open_memstream.c
  34. endif
  35. # pthread functions
  36. CSRC+=flockfile.c ftrylockfile.c funlockfile.c
  37. # Functions with unlocked versions
  38. CUSRC:= clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \
  39. fputc.c fputs.c fread.c fwrite.c getchar.c putchar.c
  40. # getc_unlocked -> alias for fgetc_unlocked
  41. # putc_unlocked -> alias for fputc_unlocked
  42. # Largefile functions (%64.o)
  43. CLSRC:=
  44. ifeq ($(UCLIBC_HAS_LFS),y)
  45. CLSRC:=fgetpos.c fopen.c freopen.c fseeko.c fsetpos.c ftello.c # tmpfile
  46. endif
  47. # vfprintf and support functions
  48. MSRC1:=vfprintf.c
  49. ifneq ($(USE_OLD_VFPRINTF),y)
  50. MOBJ1:= vfprintf.o \
  51. _ppfs_init.o _ppfs_prepargs.o _ppfs_setargs.o _ppfs_parsespec.o \
  52. register_printf_function.o parse_printf_format.o
  53. else
  54. MOBJ1:=
  55. CSRC+=old_vfprintf.c
  56. endif
  57. # vfscanf and support functions plus other *scanf funcs
  58. MSRC2:=scanf.c
  59. MOBJ2:= vfscanf.o __scan_cookie.o __psfs_parse_spec.o __psfs_do_numeric.o \
  60. scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o
  61. CWSRC:=
  62. ifeq ($(UCLIBC_HAS_WCHAR),y)
  63. CWSRC+=_wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \
  64. fwide.c ungetwc.c
  65. CUSRC+=fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c
  66. # getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias)
  67. # putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias)
  68. MOBJ1+=vfwprintf.o
  69. MOBJ2+=wscanf.o swscanf.o fwscanf.o vwscanf.o vswscanf.o vfwscanf.o
  70. endif
  71. CSRC+=$(CUSRC) $(CWSRC)
  72. STDIO_DIR:=$(top_srcdir)libc/stdio
  73. STDIO_OUT:=$(top_builddir)libc/stdio
  74. STDIO_SRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC))
  75. STDIO_OBJ:=$(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC))
  76. STDIO_CUSRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC))
  77. STDIO_CUOBJ:=$(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC))
  78. STDIO_CLSRC:=$(patsubst %.c,$(STDIO_OUT)/%64.c,$(CLSRC))
  79. STDIO_CLOBJ:=$(patsubst %.c,$(STDIO_OUT)/%64.o,$(CLSRC))
  80. STDIO_MSRC1:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1))
  81. STDIO_MSRC2:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2))
  82. STDIO_MOBJ1:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ1))
  83. STDIO_MOBJ2:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ2))
  84. STDIO_MSRC:=$(STDIO_MSRC1) $(STDIO_MSRC2)
  85. STDIO_MOBJ:=$(STDIO_MOBJ1) $(STDIO_MOBJ2)
  86. #STDIO_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(STDIO_MOBJ))))
  87. STDIO_OBJS:=$(STDIO_OBJ) $(STDIO_MOBJ) $(STDIO_CUOBJ) $(STDIO_CLOBJ)
  88. #STDIO_NO_MULTI:=$(STDIO_CUOBJ) $(STDIO_CLOBJ)
  89. # these need special handling or rewrite to support multi-build
  90. # CUOBJ
  91. %_unlocked.o %_unlocked.os: %.c
  92. $(compile.c) -D__DO_UNLOCKED
  93. # need this, else the other %64 files will get false rules
  94. $(STDIO_CLSRC): $(STDIO_OUT)/%64.c : $(STDIO_DIR)/%.c
  95. cp $< $@
  96. $(STDIO_CLOBJ): %.o : %.c
  97. $(compile.c) -D__DO_LARGEFILE
  98. $(STDIO_CLOBJ:.o=.os): %.os : %.c
  99. $(compile.c) -D__DO_LARGEFILE
  100. $(STDIO_MOBJ1) $(STDIO_MOBJ1:.o=.os): $(STDIO_MSRC1)
  101. $(compile.m)
  102. $(STDIO_MOBJ2) $(STDIO_MOBJ2:.o=.os): $(STDIO_MSRC2)
  103. $(compile.m)
  104. libc-a-y+=$(STDIO_OBJS)
  105. libc-a-pic-y+=$(STDIO_OBJS:.o=.os)
  106. libc-so-y+=$(STDIO_OBJS:.o=.os)
  107. #CFLAGS-multi-y+=$(STDIO_DEF)
  108. #libc-multi-y+=$(STDIO_SRC) $(STDIO_MSRC)
  109. #libc-nomulti-y+=$(STDIO_NO_MULTI)
  110. libc-nomulti-y+=$(STDIO_OBJS)
  111. objclean-y+=stdio_objclean
  112. stdio_objclean:
  113. $(RM) $(STDIO_OUT)/*.{o,os}