summaryrefslogtreecommitdiff
path: root/libc/string/Makefile.in
blob: 6b0a154cad68e6d97045045a8a1e7e640749e701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Makefile for uClibc
#
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

# order is relevant
-include $(top_srcdir)libc/string/$(TARGET_ARCH)/Makefile.arch
include $(top_srcdir)libc/string/generic/Makefile.in

MSRC:=wstring.c
MOBJ:=	basename.o bcopy.o bzero.o dirname.o ffs.o memccpy.o memchr.o memcmp.o \
	memcpy.o memmove.o mempcpy.o memrchr.o 	memset.o rawmemchr.o stpcpy.o \
	stpncpy.o strcasecmp.o strcasestr.o strcat.o strchrnul.o strchr.o \
	strcmp.o strcpy.o strcspn.o strdup.o strlen.o strncasecmp.o strncat.o \
	strncmp.o strncpy.o strndup.o strnlen.o strpbrk.o strrchr.o strsep.o \
	strspn.o strstr.o strtok.o strtok_r.o strerror.o __xpg_strerror_r.o \
	_string_syserrmsgs.o __glibc_strerror_r.o \
	_string_syssigmsgs.o sys_siglist.o strsignal.o psignal.o \
	 __xpg_basename.o strlcat.o strlcpy.o sys_errlist.o memmem.o

MOBJW=
ifeq ($(UCLIBC_HAS_WCHAR),y)
MOBJW=	wcscasecmp.o wcscat.o wcschrnul.o wcschr.o wcscmp.o wcscpy.o wcscspn.o \
	wcsdup.o wcslen.o wcsncasecmp.o wcsncat.o wcsncmp.o wcsncpy.o \
	wcsnlen.o wcspbrk.o wcsrchr.o wcsspn.o wcsstr.o wcstok.o wmemchr.o \
	wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o \
	__wcslcpy.o \
	wcsxfrm.o strxfrm.o # wcscoll strcoll.o
endif

MOBJx=
MOBJWx=
ifeq ($(UCLIBC_HAS_XLOCALE),y)
MOBJx+=strcasecmp_l.o strncasecmp_l.o
ifeq ($(UCLIBC_HAS_WCHAR),y)
MOBJWx+=wcscasecmp_l.o wcsncasecmp_l.o wcsxfrm_l.o strxfrm_l.o
endif
endif

#ffsl ffsll

ifeq ($(UCLIBC_HAS_STRING_ARCH_OPT),y)
ifneq ($(strip $(STRING_ARCH_OBJS)),)
MOBJ:=$(filter-out $(notdir $(STRING_ARCH_OBJS)),$(MOBJ))
endif
endif

ifeq ($(UCLIBC_HAS_STRING_GENERIC_OPT),y)
ifneq ($(strip $(STRING_GENERIC_OBJS)),)
MOBJ:=$(filter-out $(notdir $(STRING_GENERIC_OBJS)),$(MOBJ))
endif
endif

STRING_DIR:=$(top_srcdir)libc/string
STRING_OUT:=$(top_builddir)libc/string

STRING_MSRC:=$(patsubst %.c,$(STRING_DIR)/%.c,$(MSRC))
STRING_MOBJ:=$(patsubst %.o,$(STRING_OUT)/%.o,$(MOBJ))
STRING_MOBJW=$(patsubst %.o,$(STRING_OUT)/%.o,$(MOBJW))
STRING_MOBJx=$(patsubst %.o,$(STRING_OUT)/%.o,$(MOBJx))
STRING_MOBJWx=$(patsubst %.o,$(STRING_OUT)/%.o,$(MOBJWx))

#STRING_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(STRING_MOBJ))))

STRING_Wx=$(STRING_MOBJW) $(STRING_MOBJx) $(STRING_MOBJWx)
STRING_OBJS:=$(STRING_MOBJ) $(STRING_Wx)

$(STRING_MOBJ): $(STRING_MSRC)
	$(compile.m)

$(STRING_MOBJ:.o=.os): $(STRING_MSRC)
	$(compile.m)

$(STRING_MOBJW): $(STRING_MSRC)
	$(compile.m) -DWANT_WIDE

$(STRING_MOBJW:.o=.os): $(STRING_MSRC)
	$(compile.m) -DWANT_WIDE

$(STRING_MOBJx): $(STRING_MSRC)
	$(compile.m) -D__UCLIBC_DO_XLOCALE

$(STRING_MOBJx:.o=.os): $(STRING_MSRC)
	$(compile.m) -D__UCLIBC_DO_XLOCALE

$(STRING_MOBJWx): $(STRING_MSRC)
	$(compile.m) -DWANT_WIDE -D__UCLIBC_DO_XLOCALE

$(STRING_MOBJWx:.o=.os): $(STRING_MSRC)
	$(compile.m) -DWANT_WIDE -D__UCLIBC_DO_XLOCALE

libc-a-y+=$(STRING_OBJS)
libc-so-y+=$(STRING_OBJS:.o=.os)

# multi does not work here, because arch/Makefile.in uses the same L_* defines
#CFLAGS-multi-y+=$(STRING_DEF)
#libc-multi-y+=$(STRING_MSRC)
#libc-nomulti-y+=$(STRING_Wx)
libc-nomulti-y+=$(STRING_OBJS)

objclean-y+=string_objclean

string_objclean:
	$(RM) $(STRING_OUT)/{,*/}*.{o,os}