Makefile.in 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. CFLAGS-signals.c = -fexceptions -fasynchronous-unwind-tables
  15. libpthread_SRC := \
  16. attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  17. mutex.c pt-machine.c ptfork.c pthread.c ptlongjmp.c \
  18. rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
  19. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  20. libpthread_SRC += locale.c
  21. endif
  22. # remove generic sources, if arch specific version is present
  23. ifneq ($(strip $(libpthread_ARCH_SRC)),)
  24. libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
  25. endif
  26. libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
  27. libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
  28. #
  29. # Stuff that goes into libc.so, not libpthread.so
  30. #
  31. CFLAGS-OMIT-libc_pthread_init.c := $(CFLAGS-dir_linuxthreads)
  32. libpthread_libc_CSRC := libc_pthread_init.c
  33. libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
  34. libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
  35. libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
  36. ifeq ($(DOPIC),y)
  37. libpthread-a-y += $(libpthread_OBJ:.o=.os)
  38. else
  39. libpthread-a-y += $(libpthread_OBJ)
  40. endif
  41. libpthread-so-y += $(libpthread_OBJ:.o=.oS)
  42. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  43. $(libpthread_OUT)/libpthread.oS: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
  44. endif
  45. $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC)
  46. $(Q)$(RM) $@
  47. $(compile-m)
  48. $(top_builddir)include/pthread.h:
  49. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
  50. $(top_builddir)include/semaphore.h:
  51. $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
  52. $(top_builddir)include/bits/pthreadtypes.h: | $(top_builddir)include/bits
  53. $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
  54. linuxthreads_headers := $(top_builddir)include/pthread.h \
  55. $(top_builddir)include/semaphore.h \
  56. $(top_builddir)include/bits/pthreadtypes.h
  57. $(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
  58. headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers)
  59. objclean-y += CLEAN_libpthread/linuxthreads
  60. headers_clean-y += HEADERCLEAN_libpthread/linuxthreads
  61. HEADERCLEAN_libpthread/linuxthreads:
  62. $(do_rm) $(linuxthreads_headers)
  63. CLEAN_libpthread/linuxthreads:
  64. $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)