Makefile.in 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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/string/$(TARGET_ARCH) libc/string/generic
  8. #
  9. # Arch specific fun
  10. #
  11. # Collect the subarch specific implementation (asm files)
  12. ifneq ($(strip $(TARGET_SUBARCH)),)
  13. STRING_SUBARCH_DIR := $(top_srcdir)libc/string/$(TARGET_ARCH)/$(TARGET_SUBARCH)
  14. STRING_SUBARCH_OUT := $(top_builddir)libc/string/$(TARGET_ARCH)/$(TARGET_SUBARCH)
  15. STRING_SUBARCH_SSRC := $(wildcard $(STRING_SUBARCH_OUT)/*.S)
  16. STRING_SUBARCH_SOBJ := $(patsubst $(STRING_SUBARCH_DIR)/%.S,$(STRING_SUBARCH_OUT)/%.o,$(STRING_SUBARCH_SSRC))
  17. STRING_SUBARCH_OBJS := $(STRING_SUBARCH_SOBJ)
  18. endif
  19. # Collect the arch specific implementation (asm, c files)
  20. STRING_ARCH_DIR := $(top_srcdir)libc/string/$(TARGET_ARCH)
  21. STRING_ARCH_OUT := $(top_builddir)libc/string/$(TARGET_ARCH)
  22. STRING_ARCH_SRC := $(wildcard $(STRING_ARCH_DIR)/*.c)
  23. STRING_ARCH_OBJ := $(patsubst $(STRING_ARCH_DIR)/%.c,$(STRING_ARCH_OUT)/%.o,$(STRING_ARCH_SRC))
  24. STRING_ARCH_SSRC := $(wildcard $(STRING_ARCH_DIR)/*.S)
  25. # Exclude the subarch implementation from the arch ones
  26. ifneq ($(strip $(STRING_SUBARCH_OBJS)),)
  27. STRING_ARCH_SSRC := $(filter-out $(patsubst %.o,$(STRING_ARCH_DIR)/%.S,$(notdir $(STRING_SUBARCH_OBJS))),$(STRING_ARCH_SSRC))
  28. endif
  29. STRING_ARCH_SOBJ := $(patsubst $(STRING_ARCH_DIR)/%.S,$(STRING_ARCH_OUT)/%.o,$(STRING_ARCH_SSRC))
  30. STRING_ARCH_OBJS := $(STRING_ARCH_OBJ) $(STRING_ARCH_SOBJ)
  31. libc-$(UCLIBC_HAS_STRING_ARCH_OPT) += $(STRING_ARCH_OBJS) $(STRING_SUBARCH_OBJS)
  32. libc-nomulti-$(UCLIBC_HAS_STRING_ARCH_OPT) += $(STRING_ARCH_SOBJ) $(STRING_SUBARCH_OBJS)
  33. #
  34. # Generic stuff
  35. #
  36. STRING_GENERIC_DIR := $(top_srcdir)libc/string/generic
  37. STRING_GENERIC_OUT := $(top_builddir)libc/string/generic
  38. STRING_GENERIC_SRC := $(wildcard $(STRING_GENERIC_DIR)/*.c)
  39. STRING_GENERIC_SRC := $(filter-out $(STRING_GENERIC_DIR)/_memcpy_fwd.c, $(STRING_GENERIC_SRC))
  40. ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
  41. ifneq ($(strip $(STRING_ARCH_OBJS)),)
  42. STRING_GENERIC_SRC := $(filter-out $(patsubst %.o,$(STRING_GENERIC_DIR)/%.c,$(notdir $(STRING_ARCH_OBJS))),$(STRING_GENERIC_SRC))
  43. endif
  44. ifneq ($(strip $(STRING_SUBARCH_OBJS)),)
  45. STRING_GENERIC_SRC := $(filter-out $(patsubst %.o,$(STRING_GENERIC_DIR)/%.c,$(notdir $(STRING_SUBARCH_OBJS))),$(STRING_GENERIC_SRC))
  46. endif
  47. endif
  48. STRING_GENERIC_OBJS := $(patsubst $(STRING_GENERIC_DIR)/%.c,$(STRING_GENERIC_OUT)/%.o,$(STRING_GENERIC_SRC))
  49. libc-$(UCLIBC_HAS_STRING_GENERIC_OPT) += $(STRING_GENERIC_OBJS)
  50. #
  51. # Top level string
  52. #
  53. STRING_DIR := $(top_srcdir)libc/string
  54. STRING_OUT := $(top_builddir)libc/string
  55. STRING_ALL_WXSRC := $(wildcard $(STRING_DIR)/w*_l.c)
  56. ifeq ($(UCLIBC_HAS_LOCALE),y)
  57. STRING_WXSRC := $(STRING_ALL_WXSRC)
  58. else
  59. # wcscoll_l
  60. STRING_WXSRC := $(filter-out $(STRING_DIR)/wcsxfrm_l.c,$(STRING_ALL_WXSRC))
  61. endif
  62. STRING_ALL_XLSRC := $(filter-out $(STRING_ALL_WXSRC),$(wildcard $(STRING_DIR)/*_l.c))
  63. ifeq ($(UCLIBC_HAS_LOCALE),y)
  64. STRING_XLSRC := $(STRING_ALL_XLSRC)
  65. else
  66. # strcoll_l
  67. STRING_XLSRC := $(filter-out $(STRING_DIR)/strxfrm_l.c,$(STRING_ALL_XLSRC))
  68. endif
  69. STRING_ALL_WSRC := $(filter-out $(STRING_ALL_WXSRC),$(wildcard $(STRING_DIR)/w*.c))
  70. ifeq ($(UCLIBC_HAS_LOCALE),y)
  71. STRING_WSRC := $(STRING_ALL_WSRC)
  72. else
  73. # wcscoll
  74. STRING_WSRC := $(filter-out $(STRING_DIR)/wcsxfrm.c,$(STRING_ALL_WSRC))
  75. endif
  76. STRING_ALL_CSRC := $(filter-out $(STRING_ALL_WXSRC) $(STRING_ALL_XLSRC) $(STRING_ALL_WSRC) $(STRING_DIR)/_collate.c,$(wildcard $(STRING_DIR)/*.c))
  77. ifeq ($(UCLIBC_HAS_LOCALE),y)
  78. STRING_CSRC := $(STRING_ALL_CSRC)
  79. else
  80. # strcoll
  81. STRING_CSRC := $(filter-out $(STRING_DIR)/strxfrm.c,$(STRING_ALL_CSRC))
  82. endif
  83. ifeq ($(UCLIBC_HAS_WCHAR),y)
  84. STRING_CSRC += $(STRING_WSRC)
  85. endif
  86. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  87. STRING_CSRC += $(STRING_XLSRC)
  88. ifeq ($(UCLIBC_HAS_WCHAR),y)
  89. STRING_CSRC += $(STRING_WXSRC)
  90. endif
  91. endif
  92. ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
  93. ifneq ($(strip $(STRING_ARCH_OBJS)),)
  94. STRING_CSRC := $(filter-out $(patsubst %.o,$(STRING_DIR)/%.c,$(notdir $(STRING_ARCH_OBJS))),$(STRING_CSRC))
  95. endif
  96. ifneq ($(strip $(STRING_SUBARCH_OBJS)),)
  97. STRING_CSRC := $(filter-out $(patsubst %.o,$(STRING_DIR)/%.c,$(notdir $(STRING_SUBARCH_OBJS))),$(STRING_CSRC))
  98. endif
  99. endif
  100. ifeq ($(UCLIBC_HAS_STRING_GENERIC_OPT),y)
  101. ifneq ($(strip $(STRING_GENERIC_OBJS)),)
  102. STRING_CSRC := $(filter-out $(patsubst %.o,$(STRING_DIR)/%.c,$(notdir $(STRING_GENERIC_OBJS))),$(STRING_CSRC))
  103. endif
  104. endif
  105. STRING_COBJ := $(patsubst $(STRING_DIR)/%.c,$(STRING_OUT)/%.o,$(STRING_CSRC))
  106. libc-y += $(STRING_COBJ)
  107. libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STRING_OUT)/wcsxfrm_l.o
  108. libc-nomulti-y += $(STRING_OUT)/__xpg_strerror_r.o
  109. objclean-y += CLEAN_libc/string
  110. CLEAN_libc/string:
  111. $(do_rm) $(addprefix $(STRING_OUT)/,$(addprefix *., o os oS) $(addprefix */*., o os oS) $(addprefix */*/*., o os oS))