summaryrefslogtreecommitdiff
path: root/libc/misc/locale/Makefile.in
blob: f4439cdf500833017a59b9f1c17225ba9b9e3721 (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
# Makefile for uClibc
#
# Copyright (C) 2000 by Lineo, inc.
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

MSRC:=locale.c
MOBJ:=setlocale.o localeconv.o _locale_init.o nl_langinfo.o
MOBJx:=

ifeq ($(UCLIBC_HAS_LOCALE),y)
MOBJ+=newlocale.o __locale_mbrtowc_l.o
endif

ifeq ($(UCLIBC_HAS_XLOCALE),y)
MOBJx:=nl_langinfo_l.o duplocale.o freelocale.o uselocale.o __curlocale.o
endif

MISC_LOCALE_NO_MULTI=localeconv.o

MISC_LOCALE_DIR:=$(top_srcdir)libc/misc/locale
MISC_LOCALE_OUT:=$(top_builddir)libc/misc/locale

MISC_LOCALE_MSRC:=$(MISC_LOCALE_DIR)/$(MSRC)
MISC_LOCALE_MOBJ:=$(patsubst %.o,$(MISC_LOCALE_OUT)/%.o,$(MOBJ))
MISC_LOCALE_MOBJx:=$(patsubst %.o,$(MISC_LOCALE_OUT)/%.o,$(MOBJx))

MISC_LOCALE_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(filter-out $(MISC_LOCALE_NO_MULTI),$(notdir $(MISC_LOCALE_MOBJ)))))

$(MISC_LOCALE_MOBJ): $(MISC_LOCALE_MSRC)
	$(compile.m)

$(MISC_LOCALE_MOBJ:.o=.os): $(MISC_LOCALE_MSRC)
	$(compile.m)

$(MISC_LOCALE_MOBJx): $(MISC_LOCALE_MSRC)
	$(compile.m) -D__UCLIBC_DO_XLOCALE

$(MISC_LOCALE_MOBJx:.o=.os): $(MISC_LOCALE_MSRC)
	$(compile.m) -D__UCLIBC_DO_XLOCALE

libc-a-y+=$(MISC_LOCALE_MOBJ)
libc-a-$(UCLIBC_HAS_XLOCALE)+=$(MISC_LOCALE_MOBJx)
libc-so-y+=$(MISC_LOCALE_MOBJ:.o=.os)
libc-so-$(UCLIBC_HAS_XLOCALE)+=$(MISC_LOCALE_MOBJx:.o=.os)

CFLAGS-multi-y+=$(MISC_LOCALE_DEF)
libc-multi-y+=$(MISC_LOCALE_MSRC)
libc-nomulti-y+=$(patsubst %.o,$(MISC_LOCALE_OUT)/%.o,$(MISC_LOCALE_NO_MULTI))
libc-nomulti-$(UCLIBC_HAS_XLOCALE)+=$(MISC_LOCALE_MOBJx)

objclean-y+=misc_locale_objclean

misc_locale_objclean:
	$(RM) $(MISC_LOCALE_OUT)/{*.{o,os}}