Makefile 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Makefile for uClibc's pthread library
  2. #
  3. # Copyright (C) 2002 Erik Andersen <andersen@uclibc.org>
  4. # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  5. #
  6. # This program is free software; you can redistribute it and/or modify it under
  7. # the terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 2 of the License, or (at your option) any
  9. # later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but WITHOUT
  12. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  14. # details.
  15. #
  16. # You should have received a copy of the GNU Library General Public License
  17. # along with this program; if not, write to the Free Software Foundation, Inc.,
  18. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. # Makefile for uClibc
  20. TOPDIR=../../
  21. include $(TOPDIR)Rules.mak
  22. # As long as there is only one subdir, we don't
  23. # have to worry about race conditions with multiple
  24. # $(AR)'s running on linuxthreads.a
  25. DIRS = sysdeps
  26. #Adjust the soname version to avoid namespace collisions with glibc's libpthread
  27. LIBPTHREAD:=../libpthread.a
  28. ifeq ($(strip $(TARGET_ARCH)),sparc)
  29. SYSDEPS_DIR:=$(TARGET_ARCH)/sparc32
  30. else
  31. SYSDEPS_DIR:=$(TARGET_ARCH)
  32. endif
  33. #This stuff will not compile without at least -O1
  34. CFLAGS :=$(CFLAGS:-O0=-O1)
  35. # set up system dependencies include dirs (NOTE: order matters!)
  36. PTDIR = $(TOPDIR)libpthread/linuxthreads/
  37. SYSDEPINC = -I$(PTDIR)sysdeps/unix/sysv/linux \
  38. -I$(PTDIR)sysdeps/pthread \
  39. -I$(PTDIR)sysdeps/unix/sysv \
  40. -I$(PTDIR)sysdeps/unix/unix \
  41. -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
  42. -I$(PTDIR)sysdeps \
  43. -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
  44. CFLAGS += $(SYSDEPINC)
  45. CSRC=attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  46. mutex.c oldsemaphore.c pt-machine.c ptfork.c pthread.c \
  47. ptlongjmp.c rwlock.c semaphore.c signals.c specific.c spinlock.c \
  48. wrapsyscall.c
  49. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  50. CSRC += locale.c
  51. endif
  52. COBJS=$(patsubst %.c,%.o, $(CSRC))
  53. OBJS=$(COBJS)
  54. all: $(LIBPTHREAD)
  55. $(LIBPTHREAD) ar-target: $(OBJS) subdirs
  56. $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
  57. $(COBJS): %.o : %.c
  58. $(CC) $(CFLAGS) -c $< -o $@
  59. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  60. $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o
  61. else
  62. $(STRIPTOOL) -x -R .note -R .comment $*.o
  63. endif
  64. clean: subdirs_clean
  65. $(RM) *.[oa] *~ core
  66. subdirs: $(patsubst %, _dir_%, $(DIRS))
  67. subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
  68. $(patsubst %, _dir_%, $(DIRS)) : dummy
  69. $(MAKE) -C $(patsubst _dir_%, %, $@)
  70. $(patsubst %, _dirclean_%, $(DIRS)) : dummy
  71. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  72. .PHONY: dummy