blob: fa3c341384425d016738dd70eefcd3a69727e91d [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 += libresolv
9
10CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS)
11
12LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libresolv.so := -Wl,--dsbt-index=7
13LDFLAGS-libresolv.so := $(LDFLAGS) $(call link.asneeded,-lc)
14
15LIBS-libresolv.so := $(LIBS)
16
17libresolv_FULL_NAME := libresolv-$(VERSION).so
18
19libresolv_DIR := $(top_srcdir)libresolv
20libresolv_OUT := $(top_builddir)libresolv
21
22libresolv_SRC := $(libresolv_DIR)/resolv.c
23libresolv_OBJ := $(patsubst $(libresolv_DIR)/%.c,$(libresolv_OUT)/%.o,$(libresolv_SRC))
24
25ifeq ($(DOPIC),y)
26libresolv-a-y := $(libresolv_OBJ:.o=.os)
27else
28libresolv-a-y := $(libresolv_OBJ)
29endif
30libresolv-so-y := $(libresolv_OBJ:.o=.os)
31
32lib-a-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(top_builddir)lib/libresolv.a
33lib-so-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(top_builddir)lib/libresolv.so
34objclean-y += CLEAN_libresolv
35
36ifeq ($(DOPIC),y)
37$(top_builddir)lib/libresolv.so: $(top_builddir)lib/libresolv.a $(libc.depend)
38else
39$(top_builddir)lib/libresolv.so: $(libresolv_OUT)/libresolv_so.a $(libc.depend)
40endif
41 $(call link.so,$(libresolv_FULL_NAME),$(ABI_VERSION))
42
43$(libresolv_OUT)/libresolv_so.a: $(libresolv-so-y)
44 $(Q)$(RM) $@
45 $(do_ar)
46
47$(top_builddir)lib/libresolv.a: $(libresolv-a-y)
48 $(Q)$(INSTALL) -d $(dir $@)
49 $(Q)$(RM) $@
50 $(do_ar)
51
52CLEAN_libresolv:
53 $(do_rm) $(addprefix $(libresolv_OUT)/*., o os a)