Makefile.in 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. subdirs += libutil
  8. CFLAGS-libutil := -DNOT_IN_libc -DIS_IN_libutil $(SSP_ALL_CFLAGS)
  9. LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libutil.so := -Wl,--dsbt-index=8
  10. LDFLAGS-libutil.so := $(LDFLAGS)
  11. LIBS-libutil.so := $(LIBS)
  12. libutil_FULL_NAME := libutil-$(VERSION).so
  13. libutil_DIR := $(top_srcdir)libutil
  14. libutil_OUT := $(top_builddir)libutil
  15. libutil_SRC := $(wildcard $(libutil_DIR)/*.c)
  16. ifneq ($(ARCH_USE_MMU),y)
  17. libutil_SRC := $(filter-out $(libutil_DIR)/forkpty.c,$(libutil_SRC))
  18. endif
  19. ifneq ($(UCLIBC_HAS_PTY),y)
  20. libutil_SRC := $(filter-out $(libutil_DIR)/openpty.c $(libutil_DIR)/forkpty.c \
  21. ,$(libutil_SRC))
  22. endif
  23. ifeq ($(UCLIBC_HAS_UTMP)$(UCLIBC_HAS_UTMPX),)
  24. libutil_SRC := $(filter-out \
  25. $(libutil_DIR)/logwtmp.c \
  26. $(libutil_DIR)/login.c \
  27. $(libutil_DIR)/logout.c \
  28. ,$(libutil_SRC))
  29. endif
  30. libutil_OBJ := $(patsubst $(libutil_DIR)/%.c,$(libutil_OUT)/%.o,$(libutil_SRC))
  31. ifeq ($(DOPIC),y)
  32. libutil-a-y := $(libutil_OBJ:.o=.os)
  33. else
  34. libutil-a-y := $(libutil_OBJ)
  35. endif
  36. libutil-so-y := $(libutil_OBJ:.o=.os)
  37. lib-a-$(UCLIBC_HAS_LIBUTIL) += $(top_builddir)lib/libutil.a
  38. lib-so-$(UCLIBC_HAS_LIBUTIL) += $(top_builddir)lib/libutil.so
  39. objclean-y += CLEAN_libutil
  40. ifeq ($(DOPIC),y)
  41. $(top_builddir)lib/libutil.so: $(top_builddir)lib/libutil.a $(libc.depend)
  42. else
  43. $(top_builddir)lib/libutil.so: $(libutil_OUT)/libutil_so.a $(libc.depend)
  44. endif
  45. $(call link.so,$(libutil_FULL_NAME),$(ABI_VERSION))
  46. # link for backward compatibility
  47. $(call link.so,$(libutil_FULL_NAME),0)
  48. $(libutil_OUT)/libutil_so.a: $(libutil-so-y)
  49. $(Q)$(RM) $@
  50. $(do_ar)
  51. $(libutil_OUT)/libutil.oS: $(libutil_SRC)
  52. $(Q)$(RM) $@
  53. $(compile-m)
  54. $(top_builddir)lib/libutil.a: $(libutil-a-y)
  55. $(Q)$(INSTALL) -d $(dir $@)
  56. $(Q)$(RM) $@
  57. $(do_ar)
  58. CLEAN_libutil:
  59. $(do_rm) $(addprefix $(libutil_OUT)/*., o os oS a)