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