Makefile.in 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 := $(wildcard $(libpthread_DIR)/*.c)
  27. ifneq ($(UCLIBC_HAS_XLOCALE),y)
  28. libpthread_SRC := $(filter-out $(libpthread_DIR)/locale.c,$(libpthread_SRC))
  29. endif
  30. ifneq ($(DOMULTI),n)
  31. libpthread_NO_MULTI := manager.c pt-machine.c
  32. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_NO_MULTI)),$(libpthread_SRC))
  33. endif
  34. # remove generic sources, if arch specific version is present
  35. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  36. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  37. endif
  38. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  39. ifeq ($(DOPIC),y)
  40. libpthread-a-y += $(libpthread_OBJ:.o=.os)
  41. else
  42. libpthread-a-y += $(libpthread_OBJ)
  43. endif
  44. libpthread-so-y += $(libpthread_OBJ:.o=.os)
  45. libpthread-multi-y += $(libpthread_SRC)
  46. libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
  47. lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
  48. lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
  49. objclean-y += libpthread_clean
  50. headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
  51. headers_clean-y += linuxthreads_headers_clean
  52. ifeq ($(DOPIC),y)
  53. $(top_builddir)lib/libpthread.so: $(top_builddir)lib/libpthread.a $(libc)
  54. else
  55. $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
  56. endif
  57. $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
  58. $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
  59. $(Q)$(RM) $@
  60. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  61. $(do_strip:-x=-X --strip-debug)
  62. else
  63. $(do_strip)
  64. endif
  65. $(do_ar)
  66. $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
  67. $(Q)$(INSTALL) -d $(dir $@)
  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. linuxthreads_headers:
  76. $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
  77. $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
  78. $(INSTALL) -d $(top_builddir)include/bits
  79. $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
  80. linuxthreads_headers_clean:
  81. $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
  82. $(top_builddir)include/bits/pthreadtypes.h
  83. libpthread_clean:
  84. $(RM) $(libpthread_OUT)/*.{o,os,a}