lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | subdirs += libintl |
| 9 | |
| 10 | CFLAGS-libintl := -DNOT_IN_libc -DIS_IN_libintl $(SSP_ALL_CFLAGS) |
| 11 | |
| 12 | LDFLAGS-libintl.so := $(LDFLAGS) |
| 13 | |
| 14 | LIBS-libintl.so := $(LIBS) |
| 15 | |
| 16 | libintl_FULL_NAME := libintl-$(VERSION).so |
| 17 | |
| 18 | MOBJ := \ |
| 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 | |
| 23 | libintl_DIR := $(top_srcdir)libintl |
| 24 | libintl_OUT := $(top_builddir)libintl |
| 25 | |
| 26 | libintl_MSRC := $(libintl_DIR)/intl.c |
| 27 | libintl_MOBJ := $(patsubst %.o,$(libintl_OUT)/%.o,$(MOBJ)) |
| 28 | |
| 29 | ifneq ($(DOMULTI),n) |
| 30 | CFLAGS-libintl += $(patsubst %,-DL_%,$(subst .o,,$(notdir $(libintl_MOBJ)))) |
| 31 | endif |
| 32 | |
| 33 | ifeq ($(DOPIC),y) |
| 34 | libintl-a-y := $(libintl_MOBJ:.o=.os) |
| 35 | else |
| 36 | libintl-a-y := $(libintl_MOBJ) |
| 37 | endif |
| 38 | libintl-so-y := $(libintl_MOBJ:.o=.os) |
| 39 | |
| 40 | lib-a-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.a |
| 41 | lib-so-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.so |
| 42 | objclean-y += CLEAN_libintl |
| 43 | |
| 44 | ifeq ($(DOMULTI),n) |
| 45 | ifeq ($(DOPIC),y) |
| 46 | $(top_builddir)lib/libintl.so: $(top_builddir)lib/libintl.a $(libc.depend) |
| 47 | else |
| 48 | $(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl_so.a $(libc.depend) |
| 49 | endif |
| 50 | $(call link.so,$(libintl_FULL_NAME),$(ABI_VERSION)) |
| 51 | else |
| 52 | $(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl.oS | $(libc.depend) |
| 53 | $(call linkm.so,$(libintl_FULL_NAME),$(ABI_VERSION)) |
| 54 | endif |
| 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 | |
| 75 | CLEAN_libintl: |
| 76 | $(do_rm) $(addprefix $(libintl_OUT)/*., o os oS a) |