Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000 by Lineo, inc.
  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. #
  19. # Derived in part from the Linux-8086 C library, the GNU C Library, and several
  20. # other sundry sources. Files within this library are copyright by their
  21. # respective copyright holders.
  22. USE_CRT0_C=true
  23. TOPDIR=../../../../
  24. include $(TOPDIR)Rules.mak
  25. ASFLAGS=$(CFLAGS)
  26. ifeq ($(USE_CRT0_C),true)
  27. CRT0=crt0.c
  28. CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0))
  29. else
  30. CRT0=crt0.S
  31. CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
  32. endif
  33. SSRC=__longjmp.S setjmp.S vfork.S #_start.S #clone.S
  34. ifeq ($(UNIFIED_SYSCALL),true)
  35. SSRC += __uClibc_syscall.S
  36. endif
  37. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  38. CSRC=__init_brk.c brk.c sbrk.c longjmp.c #jmp-unwind.c
  39. COBJS=$(patsubst %.c,%.o, $(CSRC))
  40. OBJS=$(SOBJS) $(COBJS)
  41. all: $(OBJS) $(LIBC)
  42. $(LIBC): ar-target
  43. ar-target: $(OBJS) $(CRT0_OBJ)
  44. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  45. cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ)
  46. ifeq ($(USE_CRT0_C),true)
  47. $(CRT0_OBJ): %.o : %.c
  48. else
  49. $(CRT0_OBJ): %.o : %.S
  50. endif
  51. $(CC) $(CFLAGS) -c $< -o $@
  52. $(STRIPTOOL) -x -R .note -R .comment $*.o
  53. $(SOBJS): %.o : %.S
  54. $(CC) $(CFLAGS) -c $< -o $@
  55. $(STRIPTOOL) -x -R .note -R .comment $*.o
  56. $(COBJS): %.o : %.c
  57. $(CC) $(CFLAGS) -c $< -o $@
  58. $(STRIPTOOL) -x -R .note -R .comment $*.o
  59. headers:
  60. # No arch specific headers
  61. clean:
  62. rm -f *.[oa] *~ core