Makefile.in 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. libc_DIR := $(top_srcdir)libc
  8. libc_OUT := $(top_builddir)libc
  9. # Check if the target architecture has a version script for
  10. # libc, and if so, include it when linking.
  11. VERSION_SCRIPT := $(wildcard $(libc_DIR)/sysdeps/linux/$(TARGET_ARCH)/libc.map)
  12. ifneq ($(VERSION_SCRIPT),)
  13. VERSION_SCRIPT := --version-script $(VERSION_SCRIPT)
  14. endif
  15. LDFLAGS-libc.so := $(LDFLAGS) $(VERSION_SCRIPT) -init __uClibc_init
  16. LIBS-libc.so := $(interp) $(ldso) $(top_builddir)lib/$(NONSHARED_LIBNAME)
  17. # we have SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION) defined in Rules.mak
  18. libc_FULL_NAME := libuClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
  19. # this comes first, so duplicate removal works correctly
  20. include $(libc_DIR)/sysdeps/Makefile.in
  21. include $(libc_DIR)/misc/Makefile.in
  22. include $(libc_DIR)/pwd_grp/Makefile.in
  23. include $(libc_DIR)/stdio/Makefile.in
  24. include $(libc_DIR)/string/Makefile.in
  25. include $(libc_DIR)/termios/Makefile.in
  26. include $(libc_DIR)/inet/Makefile.in
  27. include $(libc_DIR)/signal/Makefile.in
  28. include $(libc_DIR)/stdlib/Makefile.in
  29. include $(libc_DIR)/unistd/Makefile.in
  30. ifeq ($(DOPIC),y)
  31. libc-a-y = $(libc-y:.o=.os) $(libc-static-y:.o=.os)
  32. else
  33. libc-a-y = $(libc-y) $(libc-static-y)
  34. endif
  35. ifeq ($(DOMULTI),n)
  36. libc-so-y = $(libc-y:.o=.os) $(libc-shared-y)
  37. else
  38. all_sources = $(libc-y:.o=.c)
  39. all_sources += $(libc-shared-y:.oS=.c)
  40. libc-multi-y = $(filter-out $(libc-nomulti-y:.o=.c),$(all_sources))
  41. endif
  42. lib-a-y += $(top_builddir)lib/libc.a
  43. lib-gdb-y += $(top_builddir)lib/libc.gdb
  44. lib-so-y += $(libc)
  45. objclean-y += libc_clean
  46. ifeq ($(DOMULTI),n)
  47. $(libc:.$(MAJOR_VERSION)=): $(libc_OUT)/libc_so.a $(LIBS-libc.so)
  48. $(call link.so,$(libc_FULL_NAME),$(MAJOR_VERSION))
  49. else
  50. $(libc:.$(MAJOR_VERSION)=): $(libc_OUT)/libc.oS $(libc-nomulti-y:.o=.oS) | $(LIBS-libc.so)
  51. $(do_strip)
  52. $(call linkm.so,$(libc_FULL_NAME),$(MAJOR_VERSION))
  53. endif
  54. $(Q)$(RM) $@
  55. $(Q)cp $(top_srcdir)extra/scripts/format.lds $@
  56. ifeq ($(COMPAT_ATEXIT),y)
  57. $(Q)echo "GROUP ( $(NONSHARED_LIBNAME) $(SHARED_MAJORNAME) $(ASNEEDED) )" >> $@
  58. else
  59. $(Q)echo "GROUP ( $(SHARED_MAJORNAME) $(NONSHARED_LIBNAME) $(ASNEEDED) )" >> $@
  60. endif
  61. $(libc_OUT)/libc_so.a: $(libc-so-y) | $(top_builddir)lib/libc.a $(top_builddir)lib/$(NONSHARED_LIBNAME)
  62. $(Q)$(RM) $@
  63. ifeq ($(DOPIC),y)
  64. $(Q)$(STRIPTOOL) $(STRIP_FLAGS) $(libc-shared-y)
  65. else
  66. $(do_strip)
  67. endif
  68. $(do_ar)
  69. $(libc_OUT)/libc.oS: $(libc-multi-y) | $(top_builddir)lib/libc.a $(top_builddir)lib/$(NONSHARED_LIBNAME)
  70. $(Q)$(RM) $@
  71. $(compile-m)
  72. #(do_t_strip)
  73. $(top_builddir)lib/libc.a: $(libc-a-y) | $(crt-y)
  74. $(Q)$(INSTALL) -d $(dir $@)
  75. $(Q)$(RM) $@
  76. $(do_strip)
  77. $(do_ar)
  78. $(top_builddir)lib/libc.gdb: $(top_builddir)lib/libc.a $(LINK_FLAT_CRTS)
  79. $(call link-flat.so,$(@:.gdb=),$(SHARED_FLAT_ID))
  80. libc_clean:
  81. $(RM) $(libc_OUT)/*.{o,os,oS,a}