Makefile.in 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. subdirs += libc/stdlib
  8. include $(top_srcdir)libc/stdlib/malloc/Makefile.in
  9. include $(top_srcdir)libc/stdlib/malloc-simple/Makefile.in
  10. include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
  11. CSRC-y := \
  12. abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c mkostemp.c \
  13. rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
  14. getpt.c drand48-iter.c jrand48.c \
  15. jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
  16. nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
  17. a64l.c l64a.c __uc_malloc.c
  18. CSRC-$(UCLIBC_SUSV2_LEGACY) += valloc.c
  19. CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
  20. CSRC-$(UCLIBC_HAS_PTY) += grantpt.c unlockpt.c ptsname.c
  21. CSRC-$(UCLIBC_HAS_ARC4RANDOM) += arc4random.c
  22. CSRC-$(UCLIBC_HAS_LFS) += mkstemp64.c mkostemp64.c
  23. CSRC-$(UCLIBC_HAS_FLOATS) += drand48.c drand48_r.c erand48.c erand48_r.c
  24. CSRC-$(if $(findstring yy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_SUSV3_LEGACY)),y) += \
  25. gcvt.c
  26. CSRC-$(UCLIBC_SUSV3_LEGACY) += mktemp.c
  27. ifneq ($(UCLIBC_HAS_BACKTRACE),)
  28. CFLAGS-abort.c = -fasynchronous-unwind-tables
  29. endif
  30. # multi source stdlib.c
  31. CSRC-y += abs.c labs.c atoi.c atol.c strtol.c strtoul.c _stdlib_strto_l.c \
  32. qsort.c qsort_r.c bsearch.c rpmatch.c \
  33. llabs.c atoll.c strtoll.c strtoull.c _stdlib_strto_ll.c
  34. # (aliases) strtoq.o strtouq.o
  35. CSRC-$(UCLIBC_HAS_FLOATS) += atof.c
  36. CSRC-$(UCLIBC_HAS_XLOCALE) += strtol_l.c strtoul_l.c _stdlib_strto_l_l.c \
  37. strtoll_l.c strtoull_l.c _stdlib_strto_ll_l.c
  38. CSRC-$(UCLIBC_HAS_WCHAR) += mblen.c mbtowc.c wctomb.c mbstowcs.c wcstombs.c \
  39. _stdlib_mb_cur_max.c _stdlib_wcsto_l.c _stdlib_wcsto_ll.c \
  40. wcstol.c wcstoul.c wcstoll.c wcstoull.c
  41. CSRC-$(if $(findstring yy,$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_XLOCALE)),y) += \
  42. _stdlib_wcsto_l_l.c _stdlib_wcsto_ll_l.c \
  43. wcstol_l.c wcstoul_l.c wcstoll_l.c wcstoull_l.c
  44. # multi source _strtod.c
  45. CSRC-$(UCLIBC_HAS_FLOATS) += strtod.c strtof.c strtold.c __strtofpmax.c __fp_range_check.c
  46. CSRC-$(if $(findstring yy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_XLOCALE)),y) += \
  47. strtod_l.c strtof_l.c strtold_l.c __strtofpmax_l.c
  48. CSRC-$(if $(findstring yy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)),y) += \
  49. wcstod.c wcstof.c wcstold.c __wcstofpmax.c
  50. CSRC-$(if $(findstring yyy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_XLOCALE)),y) += \
  51. wcstod_l.c wcstof_l.c wcstold_l.c __wcstofpmax_l.c
  52. # (aliases) wcstoq.o wcstouq.o
  53. # wcstod wcstof wcstold
  54. # multi source _atexit.c
  55. CSRC-y += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c
  56. CSRC-$(COMPAT_ATEXIT) += old_atexit.c
  57. STDLIB_DIR := $(top_srcdir)libc/stdlib
  58. STDLIB_OUT := $(top_builddir)libc/stdlib
  59. STDLIB_SRC := $(patsubst %.c,$(STDLIB_DIR)/%.c,$(CSRC-y))
  60. STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC-y))
  61. libc-y += $(STDLIB_OBJ)
  62. libc-static-y += $(STDLIB_OUT)/atexit.o $(STDLIB_OUT)/system.o
  63. libc-shared-y += $(STDLIB_OUT)/system.oS
  64. # this should always be the PIC version, because it could be used in shared libs
  65. libc-nonshared-y += $(STDLIB_OUT)/atexit.os
  66. libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o $(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o
  67. libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o $(STDLIB_OUT)/_stdlib_strto_ll_l.o
  68. objclean-y += CLEAN_libc/stdlib
  69. CLEAN_libc/stdlib:
  70. $(do_rm) $(addprefix $(STDLIB_OUT)/*., o os oS)