Makefile.in 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  4. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. #
  8. subdirs += libpthread/linuxthreads
  9. CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
  10. CFLAGS-libpthread/linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
  11. libpthread_DIR := $(top_srcdir)libpthread/linuxthreads
  12. libpthread_OUT := $(top_builddir)libpthread/linuxthreads
  13. -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
  14. libpthread_SRC := \
  15. attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  16. mutex.c pt-machine.c ptfork.c pthread.c ptlongjmp.c \
  17. rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
  18. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  19. libpthread_SRC += locale.c
  20. endif
  21. # remove generic sources, if arch specific version is present
  22. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  23. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  24. endif
  25. libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
  26. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  27. #
  28. # Stuff that goes into libc.so, not libpthread.so
  29. #
  30. CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads)
  31. libpthread_libc_CSRC := libc_pthread_init.c
  32. libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
  33. libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
  34. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  35. ifeq ($(DOPIC),y)
  36. libpthread-a-y += $(libpthread_OBJ:.o=.os)
  37. else
  38. libpthread-a-y += $(libpthread_OBJ)
  39. endif
  40. libpthread-so-y += $(libpthread_OBJ:.o=.oS)
  41. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  42. $(libpthread_OUT)/libpthread.oS: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
  43. endif
  44. $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC)
  45. $(Q)$(RM) $@
  46. $(compile-m)
  47. $(top_builddir)include/pthread.h:
  48. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
  49. $(top_builddir)include/semaphore.h:
  50. $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
  51. $(top_builddir)include/bits/pthreadtypes.h: | $(top_builddir)include/bits
  52. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
  53. linuxthreads_headers := $(top_builddir)include/pthread.h \
  54. $(top_builddir)include/semaphore.h \
  55. $(top_builddir)include/bits/pthreadtypes.h
  56. $(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
  57. headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers)
  58. objclean-y += CLEAN_libpthread/linuxthreads
  59. headers_clean-y += HEADERCLEAN_libpthread/linuxthreads
  60. HEADERCLEAN_libpthread/linuxthreads:
  61. $(do_rm) $(linuxthreads_headers)
  62. CLEAN_libpthread/linuxthreads:
  63. $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)