blob: 22ae70cf6564a46dc3783fd969b108ba4411f9e5 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# 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
8subdirs += libintl
9
10CFLAGS-libintl := -DNOT_IN_libc -DIS_IN_libintl $(SSP_ALL_CFLAGS)
11
12LDFLAGS-libintl.so := $(LDFLAGS)
13
14LIBS-libintl.so := $(LIBS)
15
16libintl_FULL_NAME := libintl-$(VERSION).so
17
18MOBJ := \
19 gettext.o ngettext.o dgettext.o dcgettext.o dngettext.o dcngettext.o \
20 textdomain.o bindtextdomain.o bind_textdomain_codeset.o \
21 _nl_expand_alias.o _nl_msg_cat_cntr.o # glibc-isms
22
23libintl_DIR := $(top_srcdir)libintl
24libintl_OUT := $(top_builddir)libintl
25
26libintl_MSRC := $(libintl_DIR)/intl.c
27libintl_MOBJ := $(patsubst %.o,$(libintl_OUT)/%.o,$(MOBJ))
28
29ifneq ($(DOMULTI),n)
30CFLAGS-libintl += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libintl_MOBJ))))
31endif
32
33ifeq ($(DOPIC),y)
34libintl-a-y := $(libintl_MOBJ:.o=.os)
35else
36libintl-a-y := $(libintl_MOBJ)
37endif
38libintl-so-y := $(libintl_MOBJ:.o=.os)
39
40lib-a-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.a
41lib-so-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.so
42objclean-y += CLEAN_libintl
43
44ifeq ($(DOMULTI),n)
45ifeq ($(DOPIC),y)
46$(top_builddir)lib/libintl.so: $(top_builddir)lib/libintl.a $(libc.depend)
47else
48$(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl_so.a $(libc.depend)
49endif
50 $(call link.so,$(libintl_FULL_NAME),$(ABI_VERSION))
51else
52$(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl.oS | $(libc.depend)
53 $(call linkm.so,$(libintl_FULL_NAME),$(ABI_VERSION))
54endif
55
56$(libintl_OUT)/libintl_so.a: $(libintl-so-y)
57 $(Q)$(RM) $@
58 $(do_ar)
59
60$(libintl_OUT)/libintl.oS: $(libintl_MSRC)
61 $(Q)$(RM) $@
62 $(compile-m)
63
64$(top_builddir)lib/libintl.a: $(libintl-a-y)
65 $(Q)$(INSTALL) -d $(dir $@)
66 $(Q)$(RM) $@
67 $(do_ar)
68
69$(libintl_MOBJ): $(libintl_MSRC)
70 $(compile.m)
71
72$(libintl_MOBJ:.o=.os): $(libintl_MSRC)
73 $(compile.m)
74
75CLEAN_libintl:
76 $(do_rm) $(addprefix $(libintl_OUT)/*., o os oS a)