Makefile.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000 by Lineo, inc.
  4. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. #
  8. # Check if the target architecture has a version script for
  9. # libc, and if so, include it when linking.
  10. VERSION_SCRIPT := $(wildcard $(libc_DIR)/sysdeps/linux/$(TARGET_ARCH)/libc.map)
  11. ifneq ($(VERSION_SCRIPT),)
  12. VERSION_SCRIPT := --version-script $(VERSION_SCRIPT)
  13. endif
  14. LDFLAGS-libc.so := $(LDFLAGS) $(VERSION_SCRIPT) -init __uClibc_init
  15. LIBS-libc.so := $(interp) $(top_builddir)lib/$(UCLIBC_LDSO)
  16. # we have SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION) defined in Rules.mak
  17. libc_FULL_NAME := libuClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
  18. libc_DIR := $(top_srcdir)libc
  19. libc_OUT := $(top_builddir)libc
  20. # this comes first, so duplicate removal works correctly
  21. include $(libc_DIR)/sysdeps/Makefile.in
  22. include $(libc_DIR)/misc/Makefile.in
  23. include $(libc_DIR)/pwd_grp/Makefile.in
  24. include $(libc_DIR)/stdio/Makefile.in
  25. include $(libc_DIR)/string/Makefile.in
  26. include $(libc_DIR)/termios/Makefile.in
  27. include $(libc_DIR)/inet/Makefile.in
  28. include $(libc_DIR)/signal/Makefile.in
  29. include $(libc_DIR)/stdlib/Makefile.in
  30. include $(libc_DIR)/unistd/Makefile.in
  31. libc-a-y += $(libc-static-y)
  32. libc-so-y += $(libc-shared-y)
  33. libc-nomulti-y += $(libc-shared-y)
  34. lib-a-y += $(top_builddir)lib/libc.a crt-y
  35. lib-so-y += libc-y $(top_builddir)lib/$(NONSHARED_LIBNAME) crt-y
  36. objclean-y += libc_clean
  37. $(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a pre-y
  38. $(call link.so,$(libc_FULL_NAME),$(MAJOR_VERSION))
  39. $(Q)$(RM) $@
  40. $(Q)echo "/* GNU ld script" > $@
  41. $(Q)echo " * Use the shared library, but some functions are only in" >> $@
  42. $(Q)echo " * the static library, so try that secondarily. */" >> $@
  43. ifeq ($(COMPAT_ATEXIT),y)
  44. $(Q)echo "GROUP ( $(NONSHARED_LIBNAME) $(SHARED_MAJORNAME) $(ASNEEDED) )" >> $@
  45. else
  46. $(Q)echo "GROUP ( $(SHARED_MAJORNAME) $(NONSHARED_LIBNAME) $(ASNEEDED) )" >> $@
  47. endif
  48. $(libc_OUT)/libc_so.a: $(libc-so-y)
  49. $(Q)$(RM) $@
  50. $(do_strip)
  51. $(do_ar)
  52. ifeq ($(DOPIC),y)
  53. $(top_builddir)lib/libc.a: $(libc-a-y:.o=.os)
  54. else
  55. $(top_builddir)lib/libc.a: $(libc-a-y)
  56. endif
  57. $(Q)$(INSTALL) -d $(dir $@)
  58. $(Q)$(RM) $@
  59. $(do_strip)
  60. $(do_ar)
  61. libc_clean:
  62. $(RM) $(libc_OUT)/*.{o,os,a}