Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 # gcrt1.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. ifeq ($(strip $(UCLIBC_PROFILING)),y)
  29. SSRC+=mcount.S
  30. endif
  31. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  32. CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
  33. COBJS=$(patsubst %.c,%.o, $(CSRC))
  34. OBJS=$(SOBJS) $(COBJS)
  35. all: $(OBJS) $(LIBC)
  36. $(LIBC): ar-target
  37. ar-target: $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
  38. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  39. $(INSTALL) -d $(TOPDIR)lib
  40. cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
  41. $(CRT0_OBJ): $(CRT0_SRC) crtreloc.o
  42. $(CC) $(CFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o
  43. $(STRIPTOOL) -x -R .note -R .comment $*.o
  44. crtreloc.o: crtreloc.c
  45. $(CC) $(CFLAGS) -c $< -o $@
  46. $(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o
  47. $(CC) $(CFLAGS) -fPIE -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o
  48. $(STRIPTOOL) -x -R .note -R .comment $*.o
  49. Scrtreloc.o: crtreloc.c
  50. $(CC) $(CFLAGS) -fPIE -c $< -o $@
  51. $(CTOR_TARGETS): %.o : %.S
  52. $(CC) $(CFLAGS) -c $< -o $@
  53. $(STRIPTOOL) -x -R .note -R .comment $*.o
  54. $(SOBJS): %.o : %.S
  55. $(CC) $(CFLAGS) -c $< -o $@
  56. $(STRIPTOOL) -x -R .note -R .comment $*.o
  57. $(COBJS): %.o : %.c
  58. $(CC) $(CFLAGS) -c $< -o $@
  59. $(STRIPTOOL) -x -R .note -R .comment $*.o
  60. ifeq ($(strip $(UCLIBC_PROFILING)),y)
  61. SAFECFLAGS := $(filter-out -g,$(CFLAGS))
  62. gmon-start.S: ../common/gmon-start.c
  63. $(CC) $(SAFECFLAGS) -c $< -S -o $*.S
  64. gcrt1.o: $(CRT0_DEPS)
  65. endif
  66. headers:
  67. $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
  68. clean:
  69. rm -f *.[oa] *~ core
  70. rm -f bits/sysnum.h
  71. $(RM) $(TOPDIR)/include/link.h