Makefile 2.6 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. DIRS = sysdeps
  23. #Adjust the soname version to avoid namespace collisions with glibc's libpthread
  24. LIBPTHREAD:=../libpthread.a
  25. ifeq ($(strip $(TARGET_ARCH)),sparc)
  26. SYSDEPS_DIR:=$(TARGET_ARCH)/sparc32
  27. else
  28. SYSDEPS_DIR:=$(TARGET_ARCH)
  29. endif
  30. #This stuff will not compile without at least -O1
  31. CFLAGS :=$(CFLAGS:-O0=-O1)
  32. # set up system dependencies include dirs (NOTE: order matters!)
  33. PTDIR = $(TOPDIR)libpthread/linuxthreads/
  34. SYSDEPINC = -I$(PTDIR)sysdeps/unix/sysv/linux \
  35. -I$(PTDIR)sysdeps/pthread \
  36. -I$(PTDIR)sysdeps/unix/sysv \
  37. -I$(PTDIR)sysdeps/unix/unix \
  38. -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
  39. -I$(PTDIR)sysdeps \
  40. -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
  41. CFLAGS += $(SYSDEPINC)
  42. CSRC=attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
  43. mutex.c oldsemaphore.c pt-machine.c ptfork.c pthread.c \
  44. ptlongjmp.c rwlock.c semaphore.c signals.c specific.c spinlock.c \
  45. wrapsyscall.c
  46. ifeq ($(UCLIBC_HAS_XLOCALE),y)
  47. CSRC += locale.c
  48. endif
  49. COBJS=$(patsubst %.c,%.o, $(CSRC))
  50. OBJS=$(COBJS)
  51. all: $(OBJS) $(LIBPTHREAD)
  52. $(LIBPTHREAD): ar-target subdirs
  53. ar-target: $(OBJS)
  54. $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
  55. $(COBJS): %.o : %.c
  56. $(CC) $(CFLAGS) -c $< -o $@
  57. ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y)
  58. $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o
  59. else
  60. $(STRIPTOOL) -x -R .note -R .comment $*.o
  61. endif
  62. clean: subdirs_clean
  63. $(RM) *.[oa] *~ core
  64. subdirs: $(patsubst %, _dir_%, $(DIRS))
  65. subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
  66. $(patsubst %, _dir_%, $(DIRS)) : dummy
  67. $(MAKE) -C $(patsubst _dir_%, %, $@)
  68. $(patsubst %, _dirclean_%, $(DIRS)) : dummy
  69. $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  70. .PHONY: dummy subdirs