Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. CRT_SRC := crt0.S
  22. CRT_OBJ := crt0.o crt1.o
  23. SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ))
  24. CTOR_TARGETS := crti.o crtn.o
  25. SSRC := __longjmp.S setjmp.S clone.S vfork.S
  26. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  27. CSRC = mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  28. CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
  29. COBJ := $(patsubst %.c,%.o, $(CSRC))
  30. OBJS := $(SOBJ) $(COBJ)
  31. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  32. all: $(OBJ_LIST)
  33. $(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS)
  34. $(STRIPTOOL) -x -R .note -R .comment $^
  35. $(INSTALL) -d $(TOPDIR)lib/
  36. cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  37. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  38. $(CRT_OBJ): $(CRT_SRC) crtreloc.o
  39. $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o
  40. crtreloc.o: crtreloc.c
  41. $(CC) $(CFLAGS) -c $< -o $@
  42. $(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o
  43. $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o
  44. Scrtreloc.o: crtreloc.c
  45. $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
  46. $(CTOR_TARGETS): %.o : %.S
  47. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  48. $(SOBJ): %.o : %.S
  49. $(CC) $(ASFLAGS) -c $< -o $@
  50. $(COBJ): %.o : %.c
  51. $(CC) $(CFLAGS) -c $< -o $@
  52. clean:
  53. $(RM) *.o *~ core