Makefile.in 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 -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. 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-static-y += $(libpthread_OUT)/libc_pthread_init.o
  52. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  53. libpthread-static-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
  54. libpthread-shared-y += $(patsubst %.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
  55. ifeq ($(DOPIC),y)
  56. libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
  57. else
  58. libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
  59. endif
  60. libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
  61. libpthread-multi-y += $(libpthread_SRC)
  62. libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
  63. lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
  64. lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
  65. objclean-y += libpthread_clean
  66. headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
  67. headers_clean-y += linuxthreads_headers_clean
  68. $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
  69. $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  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. $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
  79. $(Q)$(INSTALL) -d $(dir $@)
  80. $(Q)$(RM) $@
  81. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  82. $(do_strip:-x=-X --strip-debug)
  83. else
  84. $(do_strip)
  85. endif
  86. $(do_ar)
  87. linuxthreads_headers:
  88. $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
  89. $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
  90. $(INSTALL) -d $(top_builddir)include/bits
  91. $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
  92. linuxthreads_headers_clean:
  93. $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
  94. $(top_builddir)include/bits/pthreadtypes.h
  95. libpthread_clean:
  96. $(RM) $(libpthread_OUT)/*.{o,os,oS,a}