Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
  4. # ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
  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. TOPDIR=../../../../
  20. include $(TOPDIR)Rules.mak
  21. ASFLAGS=$(CFLAGS)
  22. CRT0_SRC = crt0.S
  23. CRT0_OBJ = crt0.o crt1.o
  24. SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
  25. CRT0_DEPS=gmon-start.S
  26. CTOR_TARGETS = crti.o crtn.o
  27. SSRC=__longjmp.S setjmp.S clone.S vfork.S
  28. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  29. CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  30. CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.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. $(INSTALL) -d $(TOPDIR)lib
  38. cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  39. $(CRT0_OBJ): $(CRT0_SRC) crtreloc.o
  40. $(CC) $(CFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o
  41. $(STRIPTOOL) -x -R .note -R .comment $*.o
  42. crtreloc.o: crtreloc.c
  43. $(CC) $(CFLAGS) -c $< -o $@
  44. $(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o
  45. $(CC) $(CFLAGS) -fPIE -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o
  46. $(STRIPTOOL) -x -R .note -R .comment $*.o
  47. Scrtreloc.o: crtreloc.c
  48. $(CC) $(CFLAGS) -fPIE -c $< -o $@
  49. $(CTOR_TARGETS): %.o : %.S
  50. $(CC) $(CFLAGS) -c $< -o $@
  51. $(STRIPTOOL) -x -R .note -R .comment $*.o
  52. $(SOBJS): %.o : %.S
  53. $(CC) $(CFLAGS) -c $< -o $@
  54. $(STRIPTOOL) -x -R .note -R .comment $*.o
  55. $(COBJS): %.o : %.c
  56. $(CC) $(CFLAGS) -c $< -o $@
  57. $(STRIPTOOL) -x -R .note -R .comment $*.o
  58. headers:
  59. $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
  60. clean:
  61. rm -f *.[oa] *~ core
  62. rm -f bits/sysnum.h
  63. $(RM) $(TOPDIR)/include/link.h