Makefile.in 4.6 KB

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