Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. CRT0_SRC = crt0.S
  22. CRT0_OBJ = crt0.o crt1.o
  23. SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
  24. CRT0_DEPS=gmon-start.S
  25. CTOR_TARGETS = crti.o crtn.o
  26. SSRC=__longjmp.S setjmp.S clone.S vfork.S
  27. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  28. CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  29. CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
  30. COBJS=$(patsubst %.c,%.o, $(CSRC))
  31. OBJS=$(SOBJS) $(COBJS)
  32. OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
  33. all: $(OBJ_LIST)
  34. $(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
  35. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
  36. $(INSTALL) -d $(TOPDIR)lib/
  37. cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  38. $(CRT0_OBJ): $(CRT0_SRC) crtreloc.o
  39. $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o
  40. $(STRIPTOOL) -x -R .note -R .comment $*.o
  41. crtreloc.o: crtreloc.c
  42. $(CC) $(CFLAGS) -c $< -o $@
  43. $(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o
  44. $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o
  45. $(STRIPTOOL) -x -R .note -R .comment $*.o
  46. Scrtreloc.o: crtreloc.c
  47. $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
  48. $(CTOR_TARGETS): %.o : %.S
  49. $(CC) $(ASFLAGS) -c $< -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. headers:
  58. $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
  59. clean:
  60. $(RM) *.[oa] *~ core
  61. $(RM) $(TOPDIR)/include/link.h