Makefile.in 4.2 KB

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