Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2003 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. CRT0_SRC = crt0.S
  21. CRT0_OBJ = crt0.o crt1.o
  22. ifeq ($(strip $(UCLIBC_PIE_SUPPORT)),y)
  23. SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
  24. endif
  25. CRT0_DEPS=gmon-start.S
  26. CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  27. SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
  28. clone.S __uClibc_syscall.S syscall.S
  29. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  30. CSRC=mmap.c vfork.c __syscall_error.c pread_write.c ioctl.c
  31. COBJS=$(patsubst %.c,%.o, $(CSRC))
  32. OBJS=$(SOBJS) $(COBJS)
  33. all: $(OBJS) $(LIBC)
  34. $(LIBC): ar-target
  35. ar-target: $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
  36. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  37. cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
  38. ifeq ($(strip $(UCLIBC_PIE_SUPPORT)),y)
  39. ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
  40. $(RM) $(TOPDIR)lib/Scrt0.o
  41. else
  42. mv $(TOPDIR)lib/Scrt0.o $(TOPDIR)lib/Scrt1.o
  43. endif
  44. endif
  45. $(CRT0_OBJ): $(CRT0_SRC)
  46. $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
  47. $(STRIPTOOL) -x -R .note -R .comment $*.o
  48. $(SCRT0_OBJ): $(CRT0_SRC)
  49. $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
  50. $(STRIPTOOL) -x -R .note -R .comment $*.o
  51. $(SOBJS): %.o : %.S
  52. $(CC) $(ASFLAGS) -c $< -o $@
  53. $(STRIPTOOL) -x -R .note -R .comment $*.o
  54. $(COBJS): %.o : %.c
  55. $(CC) $(CFLAGS) -c $< -o $@
  56. $(STRIPTOOL) -x -R .note -R .comment $*.o
  57. ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
  58. crti.o: crti.S
  59. $(CC) $(ASFLAGS) -c crti.S -o crti.o
  60. $(TOPDIR)lib/crti.o: crti.o
  61. $(INSTALL) -d $(TOPDIR)lib/
  62. cp crti.o $(TOPDIR)lib/
  63. crtn.o: crtn.S
  64. $(CC) $(ASFLAGS) -c crtn.S -o crtn.o
  65. $(TOPDIR)lib/crtn.o: crtn.o
  66. $(INSTALL) -d $(TOPDIR)lib/
  67. cp crtn.o $(TOPDIR)lib/
  68. else
  69. $(TOPDIR)lib/crti.o:
  70. $(INSTALL) -d $(TOPDIR)lib/
  71. $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
  72. $(TOPDIR)lib/crtn.o:
  73. $(INSTALL) -d $(TOPDIR)lib/
  74. $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
  75. endif
  76. headers:
  77. $(LN) -fs ../libc/sysdeps/linux/powerpc/fpu_control.h $(TOPDIR)/include/
  78. clean:
  79. $(RM) *.[oa] *~ core
  80. $(RM) bits/sysnum.h
  81. $(RM) gmon-start.S