Makefile.in 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. #
  8. # Arch specific fun
  9. #
  10. STRING_ARCH_DIR := $(top_srcdir)libc/string/$(TARGET_ARCH)
  11. STRING_ARCH_OUT := $(top_builddir)libc/string/$(TARGET_ARCH)
  12. STRING_ARCH_SRC := $(wildcard $(STRING_ARCH_DIR)/*.c)
  13. STRING_ARCH_OBJ := $(patsubst $(STRING_ARCH_DIR)/%.c,$(STRING_ARCH_OUT)/%.o,$(STRING_ARCH_SRC))
  14. STRING_ARCH_SSRC := $(wildcard $(STRING_ARCH_DIR)/*.S)
  15. STRING_ARCH_SOBJ := $(patsubst $(STRING_ARCH_DIR)/%.S,$(STRING_ARCH_OUT)/%.o,$(STRING_ARCH_SSRC))
  16. STRING_ARCH_OBJS := $(STRING_ARCH_OBJ) $(STRING_ARCH_SOBJ)
  17. libc-$(UCLIBC_HAS_STRING_ARCH_OPT) += $(STRING_ARCH_OBJS)
  18. libc-nomulti-$(UCLIBC_HAS_STRING_ARCH_OPT) += $(STRING_ARCH_SOBJ)
  19. #
  20. # Generic stuff
  21. #
  22. STRING_GENERIC_DIR := $(top_srcdir)libc/string/generic
  23. STRING_GENERIC_OUT := $(top_builddir)libc/string/generic
  24. STRING_GENERIC_SRC := $(wildcard $(STRING_GENERIC_DIR)/*.c)
  25. ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
  26. ifneq ($(strip $(STRING_ARCH_OBJS)),)
  27. STRING_GENERIC_SRC := $(filter-out $(patsubst %.o,$(STRING_GENERIC_DIR)/%.c,$(notdir $(STRING_ARCH_OBJS))),$(STRING_GENERIC_SRC))
  28. endif
  29. endif
  30. STRING_GENERIC_OBJS := $(patsubst $(STRING_GENERIC_DIR)/%.c,$(STRING_GENERIC_OUT)/%.o,$(STRING_GENERIC_SRC))
  31. libc-$(UCLIBC_HAS_STRING_GENERIC_OPT) += $(STRING_GENERIC_OBJS)
  32. #
  33. # Top level string
  34. #
  35. STRING_DIR := $(top_srcdir)libc/string
  36. STRING_OUT := $(top_builddir)libc/string
  37. STRING_ALL_WXSRC := $(wildcard $(STRING_DIR)/w*_l.c)
  38. ifeq ($(UCLIBC_HAS_LOCALE),y)
  39. STRING_WXSRC := $(STRING_ALL_WXSRC)
  40. else
  41. # wcscoll_l
  42. STRING_WXSRC := $(filter-out $(STRING_DIR)/wcsxfrm_l.c,$(STRING_ALL_WXSRC))
  43. endif
  44. STRING_ALL_XLSRC := $(filter-out $(STRING_ALL_WXSRC),$(wildcard $(STRING_DIR)/*_l.c))
  45. ifeq ($(UCLIBC_HAS_LOCALE),y)
  46. STRING_XLSRC := $(STRING_ALL_XLSRC)
  47. else
  48. # strcoll_l
  49. STRING_XLSRC := $(filter-out $(STRING_DIR)/strxfrm_l.c,$(STRING_ALL_XLSRC))
  50. endif
  51. STRING_ALL_WSRC := $(filter-out $(STRING_ALL_WXSRC),$(wildcard $(STRING_DIR)/w*.c))
  52. ifeq ($(UCLIBC_HAS_LOCALE),y)
  53. STRING_WSRC := $(STRING_ALL_WSRC)
  54. else
  55. # wcscoll
  56. STRING_WSRC := $(filter-out $(STRING_DIR)/wcsxfrm.c,$(STRING_ALL_WSRC))
  57. endif
  58. STRING_ALL_CSRC := $(filter-out $(STRING_ALL_WXSRC) $(STRING_ALL_XLSRC) $(STRING_ALL_WSRC) $(STRING_DIR)/_collate.c,$(wildcard $(STRING_DIR)/*.c))
  59. ifeq ($(UCLIBC_HAS_LOCALE),y)
  60. STRING_CSRC := $(STRING_ALL_CSRC)
  61. else
  62. # strcoll
  63. STRING_CSRC := $(filter-out $(STRING_DIR)/strxfrm.c,$(STRING_ALL_CSRC))
  64. endif
  65. ifeq ($(UCLIBC_HAS_WCHAR),y)
  66. STRING_CSRC += $(STRING_WSRC)
  67. endif
  68. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  69. STRING_CSRC += $(STRING_XLSRC)
  70. ifeq ($(UCLIBC_HAS_WCHAR),y)
  71. STRING_CSRC += $(STRING_WXSRC)
  72. endif
  73. endif
  74. ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
  75. ifneq ($(strip $(STRING_ARCH_OBJS)),)
  76. STRING_CSRC := $(filter-out $(patsubst %.o,$(STRING_DIR)/%.c,$(notdir $(STRING_ARCH_OBJS))),$(STRING_CSRC))
  77. endif
  78. endif
  79. ifeq ($(UCLIBC_HAS_STRING_GENERIC_OPT),y)
  80. ifneq ($(strip $(STRING_GENERIC_OBJS)),)
  81. STRING_CSRC := $(filter-out $(patsubst %.o,$(STRING_DIR)/%.c,$(notdir $(STRING_GENERIC_OBJS))),$(STRING_CSRC))
  82. endif
  83. endif
  84. STRING_COBJ := $(patsubst $(STRING_DIR)/%.c,$(STRING_OUT)/%.o,$(STRING_CSRC))
  85. libc-y += $(STRING_COBJ)
  86. libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STRING_OUT)/wcsxfrm_l.o
  87. objclean-y += string_objclean
  88. string_objclean:
  89. $(RM) $(STRING_OUT)/{,*/}*.{o,os}