Makefile.in 3.9 KB

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