Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. ifeq ($(strip $(UCLIBC_PIE_SUPPORT)),y)
  24. SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
  25. endif
  26. CRT0_DEPS=gmon-start.S
  27. CTOR_TARGETS = crti.o crtn.o
  28. SSRC=__longjmp.S setjmp.S clone.S vfork.S
  29. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  30. CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  31. CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
  32. COBJS=$(patsubst %.c,%.o, $(CSRC))
  33. OBJS=$(SOBJS) $(COBJS)
  34. all: $(OBJS) $(LIBC)
  35. $(LIBC): ar-target
  36. ar-target: $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
  37. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  38. $(INSTALL) -d $(TOPDIR)lib
  39. cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  40. $(CRT0_OBJ): $(CRT0_SRC) crtreloc.o
  41. $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o
  42. $(STRIPTOOL) -x -R .note -R .comment $*.o
  43. crtreloc.o: crtreloc.c
  44. $(CC) $(CFLAGS) -c $< -o $@
  45. $(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o
  46. $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o
  47. $(STRIPTOOL) -x -R .note -R .comment $*.o
  48. Scrtreloc.o: crtreloc.c
  49. $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
  50. $(CTOR_TARGETS): %.o : %.S
  51. $(CC) $(ASFLAGS) -c $< -o $@
  52. $(STRIPTOOL) -x -R .note -R .comment $*.o
  53. $(SOBJS): %.o : %.S
  54. $(CC) $(ASFLAGS) -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. $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
  61. clean:
  62. rm -f *.[oa] *~ core
  63. rm -f bits/sysnum.h
  64. $(RM) $(TOPDIR)/include/link.h