Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000 by Lineo, inc.
  4. # Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # This program is free software; you can redistribute it and/or modify it under
  7. # the terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 2 of the License, or (at your option) any
  9. # later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but WITHOUT
  12. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  14. # details.
  15. #
  16. # You should have received a copy of the GNU Library General Public License
  17. # along with this program; if not, write to the Free Software Foundation, Inc.,
  18. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. #
  20. # Derived in part from the Linux-8086 C library, the GNU C Library, and several
  21. # other sundry sources. Files within this library are copyright by their
  22. # respective copyright holders.
  23. TOPDIR=../../
  24. include $(TOPDIR)Rules.mak
  25. # Set to true to use the old vfprintf instead of the new. The old is roughly
  26. # C89 compliant, but doesn't deal with qualifiers on %n and doesn't deal with
  27. # %h correctly or %hh at all on the interger conversions. But on i386 it is
  28. # over 1.5k smaller than the new code. Of course, the new code fixes the
  29. # above mentioned deficiencies and adds custom specifier support similar to
  30. # glibc, as well as handling positional args. This option is here temporarily
  31. # until the configuration system gets rewritten. Note also that the old
  32. # vfprintf code will be rewritten at some point to bring it into at least C89
  33. # standards compliance.
  34. USE_OLD_VFPRINTF = false
  35. # Note: The *64.o objects are empty when compiled without large file support.
  36. # To not build them at all, remove the appropriate line from the MOBJ
  37. # definition and uncomment the DOLFS test below.
  38. # Note: Use the libpthreads of: flockfile.o ftrylockfile.o funlockfile.o
  39. # Also, maybe move __fsetlocking.o as well?
  40. MSRC = stdio.c
  41. MOBJ = fclose.o fflush.o fopen.o freopen.o perror.o remove.o \
  42. setbuf.o setvbuf.o fgetc.o fgets.o fputc.o fputs.o \
  43. getc.o getchar.o gets.o putc.o putchar.o puts.o \
  44. ungetc.o fread.o fwrite.o fgetpos.o fseek.o fsetpos.o ftell.o \
  45. rewind.o clearerr.o feof.o ferror.o \
  46. fileno.o fdopen.o getw.o putw.o setbuffer.o setlinebuf.o fcloseall.o \
  47. fopen64.o freopen64.o ftello64.o fseeko64.o fsetpos64.o fgetpos64.o \
  48. __fbufsize.o __freading.o __fwriting.o __freadable.o __fwritable.o \
  49. __flbf.o __fpurge.o __fpending.o _flushlbf.o \
  50. fopencookie.o fmemopen.o open_memstream.o \
  51. __fsetlocking.o \
  52. _stdio_fopen.o _stdio_fread.o _stdio_fwrite.o _stdio_adjpos.o \
  53. _stdio_lseek.o _stdio_init.o \
  54. _stdio_fsfopen.o _stdio_fdout.o _uintmaxtostr.o
  55. # ifeq ($(DOLFS),true)
  56. # MOBJ += fopen64.o freopen64.o ftello64.o fseeko64.o fsetpos64.o fgetpos64.o
  57. # endif
  58. MSRC2= printf.c
  59. MOBJ2= vsnprintf.o vdprintf.o vasprintf.o vprintf.o vsprintf.o \
  60. fprintf.o snprintf.o dprintf.o asprintf.o printf.o sprintf.o
  61. ifneq ($(USE_OLD_VFPRINTF),true)
  62. MOBJ2 += _ppfs_init.o _ppfs_prepargs.o _ppfs_setargs.o \
  63. _ppfs_parsespec.o _do_one_spec.o vfprintf.o \
  64. _store_inttype.o _load_inttype.o \
  65. register_printf_function.o parse_printf_format.o
  66. endif
  67. ifeq ($(HAS_FLOATING_POINT),true)
  68. MOBJ2 += _dtostr.o
  69. endif
  70. MSRC3=scanf.c
  71. MOBJ3=scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o vfscanf.o
  72. CSRC=popen.c getdelim.c getline.c tmpfile.c tmpnam.c \
  73. tmpnam_r.c tempnam.c ctermid.c
  74. ifeq ($(USE_OLD_VFPRINTF),true)
  75. CSRC += old_vfprintf.c
  76. endif
  77. COBJS=$(patsubst %.c,%.o, $(CSRC))
  78. OBJS=$(MOBJ) $(MOBJ2) $(MOBJ3) $(COBJS)
  79. all: $(OBJS) $(LIBC)
  80. $(LIBC): ar-target
  81. ar-target: $(OBJS)
  82. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  83. $(MOBJ): $(MSRC)
  84. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  85. $(STRIPTOOL) -x -R .note -R .comment $*.o
  86. $(MOBJ2): $(MSRC2)
  87. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  88. $(STRIPTOOL) -x -R .note -R .comment $*.o
  89. $(MOBJ3): $(MSRC3)
  90. $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
  91. $(STRIPTOOL) -x -R .note -R .comment $*.o
  92. $(COBJS): %.o : %.c
  93. $(CC) $(CFLAGS) -c $< -o $@
  94. $(STRIPTOOL) -x -R .note -R .comment $*.o
  95. $(OBJ): Makefile
  96. clean:
  97. rm -f *.[oa] *~ core