Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. # ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. TOPDIR=../../../../
  8. include $(TOPDIR)Rules.mak
  9. CRT_SRC := crt0.S
  10. CRT_OBJ := crt0.o crt1.o
  11. SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ))
  12. CTOR_TARGETS := crti.o crtn.o
  13. SSRC := __longjmp.S setjmp.S clone.S vfork.S
  14. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  15. CSRC = sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  16. CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
  17. COBJ := $(patsubst %.c,%.o, $(CSRC))
  18. OBJS := $(SOBJ) $(COBJ)
  19. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  20. all: $(OBJ_LIST)
  21. $(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS)
  22. $(STRIPTOOL) -x -R .note -R .comment $^
  23. $(INSTALL) -d $(TOPDIR)lib/
  24. cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  25. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  26. $(CRT_OBJ): $(CRT_SRC) crtreloc.o
  27. $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o
  28. crtreloc.o: crtreloc.c
  29. $(CC) $(CFLAGS) -c $< -o $@
  30. $(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o
  31. $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o
  32. Scrtreloc.o: crtreloc.c
  33. $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
  34. $(CTOR_TARGETS): %.o : %.S
  35. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  36. $(SOBJ): %.o : %.S
  37. $(CC) $(ASFLAGS) -c $< -o $@
  38. $(COBJ): %.o : %.c
  39. $(CC) $(CFLAGS) -c $< -o $@
  40. clean:
  41. $(RM) *.o *~ core