Makefile.in 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(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) $(ldso)
  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. libpthread_SPEC_SRC := pthread.c
  34. libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
  35. # remove generic sources, if arch specific version is present
  36. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  37. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  38. endif
  39. libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
  40. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  41. #
  42. # Stuff that goes into libc.so, not libpthread.so
  43. #
  44. CFLAGS-forward.c := -DIS_IN_libc
  45. CFLAGS-libc_pthread_init.c := -DIS_IN_libc
  46. libpthread_libc_CSRC := forward.c libc_pthread_init.c
  47. libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
  48. libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
  49. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  50. libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
  51. libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
  52. ifeq ($(DOPIC),y)
  53. libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
  54. else
  55. libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
  56. endif
  57. libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
  58. lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
  59. lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
  60. objclean-y += libpthread_clean
  61. headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
  62. headers_clean-y += linuxthreads_headers_clean
  63. #ifeq ($(DOMULTI),n)
  64. $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
  65. $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  66. #else
  67. #$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc)
  68. # $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  69. #endif
  70. $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
  71. $(Q)$(RM) $@
  72. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  73. $(do_strip:-x=-X --strip-debug)
  74. else
  75. $(do_strip)
  76. endif
  77. $(do_ar)
  78. $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
  79. $(Q)$(RM) $@
  80. $(compile-m)
  81. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  82. $(do_t_strip:-x=-X --strip-debug)
  83. else
  84. $(do_t_strip)
  85. endif
  86. $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
  87. $(Q)$(INSTALL) -d $(dir $@)
  88. $(Q)$(RM) $@
  89. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  90. $(do_strip:-x=-X --strip-debug)
  91. else
  92. $(do_strip)
  93. endif
  94. $(do_ar)
  95. linuxthreads_headers:
  96. $(Q)$(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
  97. $(Q)$(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
  98. $(Q)$(INSTALL) -d $(top_builddir)include/bits
  99. $(Q)$(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
  100. linuxthreads_headers_clean:
  101. $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
  102. $(top_builddir)include/bits/pthreadtypes.h
  103. libpthread_clean:
  104. $(RM) $(libpthread_OUT)/*.{o,os,oS,a}