Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Makefile for uClibc's pthread library
  2. #
  3. # Copyright (C) 2002 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # This program is free software; you can redistribute it and/or modify it under
  6. # the terms of the GNU Library General Public License as published by the Free
  7. # Software Foundation; either version 2 of the License, or (at your option) any
  8. # later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but WITHOUT
  11. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Library General Public License
  16. # along with this program; if not, write to the Free Software Foundation, Inc.,
  17. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. TOPDIR=../
  19. include $(TOPDIR)Rules.mak
  20. ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
  21. ALL_SUBDIRS = nptl nptl_db
  22. DIRS = nptl
  23. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  24. DIRS += nptl_db
  25. endif
  26. else
  27. ALL_SUBDIRS = linuxthreads linuxthreads_db
  28. DIRS = linuxthreads
  29. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  30. DIRS += linuxthreads_db
  31. endif
  32. endif
  33. all: subdirs
  34. headers:
  35. ifeq ($(strip $(UCLIBC_HAS_THREADS_NATIVE)),y)
  36. $(LN) -sf $(TOPDIR)libpthread/nptl/sysdeps/pthread/pthread.h $(TOPDIR)include/
  37. $(LN) -sf $(TOPDIR)libpthread/nptl/semaphore.h $(TOPDIR)include/
  38. $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/
  39. $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/
  40. $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/
  41. $(LN) -sf ../$(TOPDIR)libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/
  42. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  43. $(LN) -sf $(TOPDIR)libpthread/nptl_db/thread_db.h $(TOPDIR)include/
  44. endif
  45. else
  46. $(LN) -sf $(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/pthread.h $(TOPDIR)include/
  47. $(LN) -sf $(TOPDIR)libpthread/linuxthreads/semaphore.h $(TOPDIR)include/
  48. $(LN) -sf ../$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/
  49. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  50. $(LN) -sf $(TOPDIR)libpthread/linuxthreads_db/thread_db.h $(TOPDIR)include/
  51. endif
  52. endif
  53. tags:
  54. ctags -R
  55. subdirs: $(patsubst %, _dir_%, $(DIRS))
  56. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  57. $(patsubst %, _dir_%, $(DIRS)) : dummy
  58. $(MAKE) -C $(patsubst _dir_%, %, $@)
  59. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  60. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  61. headers_clean:
  62. $(RM) $(TOPDIR)include/pthread.h $(TOPDIR)include/semaphore.h \
  63. $(TOPDIR)include/thread_db.h \
  64. $(TOPDIR)include/bits/pthreadtypes.h $(TOPDIR)include/bits/semaphore.h \
  65. $(TOPDIR)include/bits/libc-lock.h $(TOPDIR)include/bits/stdio-lock
  66. clean: subdirs_clean headers_clean
  67. .PHONY: dummy