Makefile.in 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. # This stuff will not compile without at least -O1
  12. # psm: can't handle this here, could maybe search for -O0 in CFLAGS
  13. # and append -O1 if found
  14. #CFLAGS:=$(CFLAGS:-O0=-O1)
  15. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  16. LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
  17. else
  18. LDFLAGS-libpthread.so := $(LDFLAGS)
  19. endif
  20. LIBS-libpthread.so := $(LIBS) $(ldso)
  21. START_FILE-libpthread.so := $(SHARED_START_FILES)
  22. END_FILE-libpthread.so := $(SHARED_END_FILES)
  23. libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
  24. libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
  25. libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
  26. -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
  27. libpthread_SRC := \
  28. attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  29. mutex.c oldsemaphore.c pt-machine.c ptfork.c ptlongjmp.c \
  30. rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
  31. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  32. libpthread_SRC += locale.c
  33. endif
  34. libpthread_SPEC_SRC := pthread.c
  35. libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
  36. # remove generic sources, if arch specific version is present
  37. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  38. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  39. endif
  40. libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
  41. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  42. #
  43. # Stuff that goes into libc.so, not libpthread.so
  44. #
  45. CFLAGS-OMIT-forward.c := $(CFLAGS-dir_linuxthreads.old)
  46. CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads.old)
  47. libpthread_libc_CSRC := forward.c libc_pthread_init.c
  48. libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
  49. libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
  50. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  51. libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
  52. libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
  53. ifeq ($(DOPIC),y)
  54. libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
  55. else
  56. libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
  57. endif
  58. libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
  59. lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
  60. lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
  61. objclean-y += libpthread_clean
  62. headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
  63. headers_clean-y += linuxthreads_headers_clean
  64. #ifeq ($(DOMULTI),n)
  65. $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
  66. $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  67. #else
  68. #$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc)
  69. # $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  70. #endif
  71. $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
  72. $(Q)$(RM) $@
  73. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  74. $(do_strip:-x=-X --strip-debug)
  75. else
  76. $(do_strip)
  77. endif
  78. $(do_ar)
  79. $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
  80. $(Q)$(RM) $@
  81. $(compile-m)
  82. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  83. $(do_t_strip:-x=-X --strip-debug)
  84. else
  85. $(do_t_strip)
  86. endif
  87. $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
  88. $(Q)$(INSTALL) -d $(dir $@)
  89. $(Q)$(RM) $@
  90. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  91. $(do_strip:-x=-X --strip-debug)
  92. else
  93. $(do_strip)
  94. endif
  95. $(do_ar)
  96. linuxthreads_headers:
  97. $(Q)$(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
  98. $(Q)$(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
  99. $(Q)$(INSTALL) -d $(top_builddir)include/bits
  100. $(Q)$(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
  101. linuxthreads_headers_clean:
  102. $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
  103. $(top_builddir)include/bits/pthreadtypes.h
  104. libpthread_clean:
  105. $(RM) $(libpthread_OUT)/*.{o,os,oS,a}