Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # This program is free software; you can redistribute it and/or modify it under
  2. # the terms of the GNU Library General Public License as published by the Free
  3. # Software Foundation; either version 2 of the License, or (at your option) any
  4. # later version.
  5. #
  6. # This program is distributed in the hope that it will be useful, but WITHOUT
  7. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  9. # details.
  10. #
  11. # You should have received a copy of the GNU Library General Public License
  12. # along with this program; if not, write to the Free Software Foundation, Inc.,
  13. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  14. TOPDIR=../../../../
  15. include $(TOPDIR)Rules.mak
  16. ASFLAGS=$(CFLAGS)
  17. CRT0=crt0.c
  18. CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0))
  19. SSRC= setjmp.S __longjmp.S clone.S sysdep.S syscall.S
  20. ifeq ($(UNIFIED_SYSCALL),y)
  21. SSRC += __uClibc_syscall.S
  22. endif
  23. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  24. CSRC= __init_brk.c brk.c sbrk.c vfork.c
  25. COBJS=$(patsubst %.c,%.o, $(CSRC))
  26. OBJS=$(SOBJS) $(COBJS)
  27. all: $(OBJS) $(LIBC)
  28. $(LIBC): ar-target
  29. ar-target: $(OBJS) $(CRT0_OBJ)
  30. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  31. cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ)
  32. $(CRT0_OBJ): %.o : %.c
  33. $(CC) $(CFLAGS) -c $< -o $@
  34. $(STRIPTOOL) -x -R .note -R .comment $*.o
  35. $(SOBJS): %.o : %.S
  36. $(CC) $(CFLAGS) -c $< -o $@
  37. $(STRIPTOOL) -x -R .note -R .comment $*.o
  38. $(COBJS): %.o : %.c
  39. $(CC) $(CFLAGS) -c $< -o $@
  40. $(STRIPTOOL) -x -R .note -R .comment $*.o
  41. headers:
  42. @(TOPDIR=$(TOPDIR) CC=$(CC) /bin/sh $(TOPDIR)/extra/scripts/gen_bits_syscall_h.sh > bits/syscall.h )
  43. clean:
  44. rm -f *.[oa] *~ core