3 # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8 subdirs
+= libc
/string
/$(TARGET_ARCH
) libc
/string
/generic
13 # Collect the subarch specific implementation (asm files)
14 ifneq ($(strip $(TARGET_SUBARCH
)),)
15 STRING_SUBARCH_DIR
:= $(top_srcdir
)libc
/string
/$(TARGET_ARCH
)/$(TARGET_SUBARCH
)
16 STRING_SUBARCH_OUT
:= $(top_builddir
)libc
/string
/$(TARGET_ARCH
)/$(TARGET_SUBARCH
)
18 STRING_SUBARCH_SSRC
:= $(wildcard $(STRING_SUBARCH_OUT
)/*.S
)
19 STRING_SUBARCH_SOBJ
:= $(patsubst $(STRING_SUBARCH_DIR
)/%.S
,$(STRING_SUBARCH_OUT
)/%.o
,$(STRING_SUBARCH_SSRC
))
21 STRING_SUBARCH_CSRC
:= $(wildcard $(STRING_SUBARCH_OUT
)/*.c
)
22 STRING_SUBARCH_COBJ
:= $(patsubst $(STRING_SUBARCH_DIR
)/%.c
,$(STRING_SUBARCH_OUT
)/%.o
,$(STRING_SUBARCH_CSRC
))
24 STRING_SUBARCH_OBJS
:= $(STRING_SUBARCH_SOBJ
) $(STRING_SUBARCH_COBJ
)
27 # Collect the arch specific implementation (asm, c files)
28 STRING_ARCH_DIR
:= $(top_srcdir
)libc
/string
/$(TARGET_ARCH
)
29 STRING_ARCH_OUT
:= $(top_builddir
)libc
/string
/$(TARGET_ARCH
)
31 STRING_ARCH_SRC
:= $(wildcard $(STRING_ARCH_DIR
)/*.c
)
32 STRING_ARCH_OBJ
:= $(patsubst $(STRING_ARCH_DIR
)/%.c
,$(STRING_ARCH_OUT
)/%.o
,$(STRING_ARCH_SRC
))
34 STRING_ARCH_SSRC
:= $(wildcard $(STRING_ARCH_DIR
)/*.S
)
36 # Exclude the subarch implementation from the arch ones
37 ifneq ($(strip $(STRING_SUBARCH_OBJS
)),)
38 STRING_ARCH_SSRC
:= $(filter-out $(patsubst %.o
,$(STRING_ARCH_DIR
)/%.S
,$(notdir $(STRING_SUBARCH_OBJS
))),$(STRING_ARCH_SSRC
))
41 STRING_ARCH_SOBJ
:= $(patsubst $(STRING_ARCH_DIR
)/%.S
,$(STRING_ARCH_OUT
)/%.o
,$(STRING_ARCH_SSRC
))
43 STRING_ARCH_OBJS
:= $(STRING_ARCH_OBJ
) $(STRING_ARCH_SOBJ
)
45 libc-
$(UCLIBC_HAS_STRING_ARCH_OPT
) += $(STRING_ARCH_OBJS
) $(STRING_SUBARCH_OBJS
)
47 libc-nomulti-
$(UCLIBC_HAS_STRING_ARCH_OPT
) += $(STRING_ARCH_SOBJ
) $(STRING_SUBARCH_OBJS
)
52 STRING_GENERIC_DIR
:= $(top_srcdir
)libc
/string
/generic
53 STRING_GENERIC_OUT
:= $(top_builddir
)libc
/string
/generic
55 STRING_GENERIC_SRC
:= $(wildcard $(STRING_GENERIC_DIR
)/*.c
)
56 STRING_GENERIC_SRC
:= $(filter-out $(STRING_GENERIC_DIR
)/_memcpy_fwd.c
, $(STRING_GENERIC_SRC
))
58 ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT
),y
)
59 ifneq ($(strip $(STRING_ARCH_OBJS
)),)
60 STRING_GENERIC_SRC
:= $(filter-out $(patsubst %.o
,$(STRING_GENERIC_DIR
)/%.c
,$(notdir $(STRING_ARCH_OBJS
))),$(STRING_GENERIC_SRC
))
62 ifneq ($(strip $(STRING_SUBARCH_OBJS
)),)
63 STRING_GENERIC_SRC
:= $(filter-out $(patsubst %.o
,$(STRING_GENERIC_DIR
)/%.c
,$(notdir $(STRING_SUBARCH_OBJS
))),$(STRING_GENERIC_SRC
))
67 STRING_GENERIC_OBJS
:= $(patsubst $(STRING_GENERIC_DIR
)/%.c
,$(STRING_GENERIC_OUT
)/%.o
,$(STRING_GENERIC_SRC
))
69 libc-
$(UCLIBC_HAS_STRING_GENERIC_OPT
) += $(STRING_GENERIC_OBJS
)
74 STRING_DIR
:= $(top_srcdir
)libc
/string
75 STRING_OUT
:= $(top_builddir
)libc
/string
77 STRING_ALL_WXSRC
:= $(wildcard $(STRING_DIR
)/w
*_l.c
)
78 ifeq ($(UCLIBC_HAS_LOCALE
),y
)
79 STRING_WXSRC
:= $(STRING_ALL_WXSRC
)
82 STRING_WXSRC
:= $(filter-out $(STRING_DIR
)/wcsxfrm_l.c
,$(STRING_ALL_WXSRC
))
85 STRING_ALL_XLSRC
:= $(filter-out $(STRING_ALL_WXSRC
),$(wildcard $(STRING_DIR
)/*_l.c
))
86 ifeq ($(UCLIBC_HAS_LOCALE
),y
)
87 STRING_XLSRC
:= $(STRING_ALL_XLSRC
)
90 STRING_XLSRC
:= $(filter-out $(STRING_DIR
)/strxfrm_l.c
,$(STRING_ALL_XLSRC
))
93 STRING_ALL_WSRC
:= $(filter-out $(STRING_ALL_WXSRC
),$(wildcard $(STRING_DIR
)/w
*.c
))
94 ifeq ($(UCLIBC_HAS_LOCALE
),y
)
95 STRING_WSRC
:= $(STRING_ALL_WSRC
)
98 STRING_WSRC
:= $(filter-out $(STRING_DIR
)/wcsxfrm.c
,$(STRING_ALL_WSRC
))
101 STRING_ALL_CSRC
:= $(filter-out $(STRING_ALL_WXSRC
) $(STRING_ALL_XLSRC
) $(STRING_ALL_WSRC
) $(STRING_DIR
)/_collate.c
,$(wildcard $(STRING_DIR
)/*.c
))
102 ifeq ($(UCLIBC_HAS_LOCALE
),y
)
103 STRING_CSRC
:= $(STRING_ALL_CSRC
)
106 STRING_CSRC
:= $(filter-out $(STRING_DIR
)/strxfrm.c
,$(STRING_ALL_CSRC
))
109 ifeq ($(UCLIBC_HAS_WCHAR
),y
)
110 STRING_CSRC
+= $(STRING_WSRC
)
112 ifeq ($(UCLIBC_HAS_XLOCALE
),y
)
113 STRING_CSRC
+= $(STRING_XLSRC
)
114 ifeq ($(UCLIBC_HAS_WCHAR
),y
)
115 STRING_CSRC
+= $(STRING_WXSRC
)
119 ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT
),y
)
120 ifneq ($(strip $(STRING_ARCH_OBJS
)),)
121 STRING_CSRC
:= $(filter-out $(patsubst %.o
,$(STRING_DIR
)/%.c
,$(notdir $(STRING_ARCH_OBJS
))),$(STRING_CSRC
))
123 ifneq ($(strip $(STRING_SUBARCH_OBJS
)),)
124 STRING_CSRC
:= $(filter-out $(patsubst %.o
,$(STRING_DIR
)/%.c
,$(notdir $(STRING_SUBARCH_OBJS
))),$(STRING_CSRC
))
128 ifeq ($(UCLIBC_HAS_STRING_GENERIC_OPT
),y
)
129 ifneq ($(strip $(STRING_GENERIC_OBJS
)),)
130 STRING_CSRC
:= $(filter-out $(patsubst %.o
,$(STRING_DIR
)/%.c
,$(notdir $(STRING_GENERIC_OBJS
))),$(STRING_CSRC
))
134 STRING_COBJ
:= $(patsubst $(STRING_DIR
)/%.c
,$(STRING_OUT
)/%.o
,$(STRING_CSRC
))
136 libc-y
+= $(STRING_COBJ
)
138 libc-nomulti-
$(UCLIBC_HAS_XLOCALE
) += $(STRING_OUT
)/wcsxfrm_l.o
139 libc-nomulti-y
+= $(STRING_OUT
)/__xpg_strerror_r.o
141 objclean-y
+= CLEAN_libc
/string
144 $(do_rm
) $(addprefix $(STRING_OUT
)/,$(addprefix *.
, o os oS
) $(addprefix */*.
, o os oS
) $(addprefix */*/*.
, o os oS
))