Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. ALL_SUBDIRS = $(PTNAME) $(PTNAME)_db
  21. DIRS = $(PTNAME)
  22. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  23. DIRS += $(PTNAME)_db
  24. endif
  25. all: subdirs
  26. # NPTL does not have a generic pthreadtypes.h
  27. # and each arch has to have both semaphore.h/pthreadtypes.h ?
  28. headers:
  29. $(LN) -sf $(PTDIR)/sysdeps/pthread/pthread.h $(TOPDIR)include/
  30. $(LN) -sf $(PTDIR)/semaphore.h $(TOPDIR)include/
  31. ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
  32. $(LN) -sf $(PTDIR)_db/thread_db.h $(TOPDIR)include/
  33. endif
  34. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  35. $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(TOPDIR)include/bits/
  36. $(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(TOPDIR)include/bits/
  37. $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/libc-lock.h $(TOPDIR)include/bits/
  38. $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/stdio-lock.h $(TOPDIR)include/bits/
  39. else
  40. $(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(TOPDIR)include/bits/
  41. endif
  42. tags:
  43. ctags -R
  44. subdirs: $(patsubst %, _dir_%, $(DIRS))
  45. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  46. $(patsubst %, _dir_%, $(DIRS)) : dummy
  47. $(MAKE) -C $(patsubst _dir_%, %, $@)
  48. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  49. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  50. headers_clean:
  51. $(RM) $(TOPDIR)include/pthread.h $(TOPDIR)include/semaphore.h \
  52. $(TOPDIR)include/thread_db.h \
  53. $(TOPDIR)include/bits/pthreadtypes.h $(TOPDIR)include/bits/semaphore.h \
  54. $(TOPDIR)include/bits/libc-lock.h $(TOPDIR)include/bits/stdio-lock
  55. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  56. $(RM) $(PTNAME)/version.h $(PTDIR)/banner.h \
  57. $(PTDIR)/sysdeps/unix/sysv/linux/rtld-libc-lowlevellock.c
  58. endif
  59. clean: subdirs_clean headers_clean
  60. .PHONY: dummy