Makefile 2.3 KB

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