Makefile.in 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  4. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. #
  8. subdirs += libpthread/linuxthreads.old
  9. CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread
  10. CFLAGS-linuxthreads.old := $(CFLAGS-dir_linuxthreads.old) $(SSP_ALL_CFLAGS)
  11. CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
  12. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  13. LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
  14. else
  15. LDFLAGS-libpthread.so := $(LDFLAGS)
  16. endif
  17. LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libpthread.so := -Wl,--dsbt-index=10
  18. LIBS-libpthread.so := $(LIBS) $(ldso)
  19. START_FILE-libpthread.so := $(SHARED_START_FILES)
  20. END_FILE-libpthread.so := $(SHARED_END_FILES)
  21. libpthread_FULL_NAME := libpthread-$(VERSION).so
  22. libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
  23. libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
  24. -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
  25. libpthread_SRC := \
  26. attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  27. mutex.c oldsemaphore.c pt-machine.c ptfork.c ptlongjmp.c \
  28. rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
  29. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  30. libpthread_SRC += locale.c
  31. endif
  32. libpthread_SPEC_SRC := pthread.c
  33. libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
  34. # remove generic sources, if arch specific version is present
  35. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  36. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  37. endif
  38. libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
  39. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  40. #
  41. # Stuff that goes into libc.so, not libpthread.so
  42. #
  43. CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads.old)
  44. CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads.old)
  45. libpthread_libc_CSRC := forward.c libc_pthread_init.c
  46. libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
  47. libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
  48. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  49. libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
  50. libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
  51. ifeq ($(DOPIC),y)
  52. libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
  53. else
  54. libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
  55. endif
  56. libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
  57. lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
  58. lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
  59. #ifeq ($(DOMULTI),n)
  60. $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend)
  61. $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
  62. #else
  63. #$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend)
  64. # $(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
  65. #endif
  66. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  67. $(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
  68. endif
  69. $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
  70. $(Q)$(RM) $@
  71. $(do_ar)
  72. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  73. $(libpthread_OUT)/libpthread.oS: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
  74. endif
  75. $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
  76. $(Q)$(RM) $@
  77. $(compile-m)
  78. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  79. $(top_builddir)lib/libpthread.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
  80. endif
  81. $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
  82. $(Q)$(INSTALL) -d $(dir $@)
  83. $(Q)$(RM) $@
  84. $(do_ar)
  85. $(top_builddir)include/pthread.h:
  86. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
  87. $(top_builddir)include/semaphore.h:
  88. $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
  89. $(top_builddir)include/bits/pthreadtypes.h: | $(top_builddir)include/bits
  90. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
  91. linuxthreads_headers := $(top_builddir)include/pthread.h \
  92. $(top_builddir)include/semaphore.h \
  93. $(top_builddir)include/bits/pthreadtypes.h
  94. $(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
  95. headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers)
  96. objclean-y += CLEAN_libpthread/linuxthreads.old
  97. headers_clean-y += HEADERCLEAN_libpthread/linuxthreads.old
  98. HEADERCLEAN_libpthread/linuxthreads.old:
  99. $(do_rm) $(linuxthreads_headers)
  100. CLEAN_libpthread/linuxthreads.old:
  101. $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)