Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2001 NEC Corporation
  4. # Copyright (C) 2001 Miles Bader <miles@gnu.org>
  5. # Copyright (C) 2000 Lineo, inc.
  6. #
  7. # This program is free software; you can redistribute it and/or modify it under
  8. # the terms of the GNU Library General Public License as published by the Free
  9. # Software Foundation; either version 2 of the License, or (at your option) any
  10. # later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but WITHOUT
  13. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  15. # details.
  16. #
  17. # You should have received a copy of the GNU Library General Public License
  18. # along with this program; if not, write to the Free Software Foundation, Inc.,
  19. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. #
  21. # Derived in part from the Linux-8086 C library, the GNU C Library, and several
  22. # other sundry sources. Files within this library are copyright by their
  23. # respective copyright holders.
  24. TOPDIR=../../../../
  25. include $(TOPDIR)Rules.mak
  26. ASFLAGS=$(CFLAGS)
  27. CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
  28. TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
  29. CRT0=crt0.S
  30. CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
  31. SSRC=setjmp.S longjmp.S vfork.S
  32. SOBJS=$(patsubst %.S,%.o, $(SSRC))
  33. CSRC=_mmap.c
  34. COBJS=$(patsubst %.c,%.o, $(CSRC))
  35. OBJS=$(SOBJS) $(MOBJ) $(COBJS)
  36. all: $(OBJS) $(LIBC)
  37. $(LIBC): ar-target
  38. ar-target: $(OBJS) $(CRT0_OBJ)
  39. $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
  40. cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ)
  41. $(CRT0_OBJ): %.o : %.S
  42. $(CC) $(CFLAGS) -c $< -o $@
  43. $(STRIPTOOL) -x -R .note -R .comment $*.o
  44. $(SOBJS): %.o : %.S
  45. $(CC) $(CFLAGS) -c $< -o $@
  46. $(STRIPTOOL) -x -R .note -R .comment $*.o
  47. $(COBJS): %.o : %.c
  48. $(CC) $(CFLAGS) -c $< -o $@
  49. $(STRIPTOOL) -x -R .note -R .comment $*.o
  50. headers:
  51. @(TOPDIR=$(TOPDIR) CC=$(CC) /bin/sh $(TOPDIR)/extra/scripts/gen_bits_syscall_h.sh > bits/syscall.h )
  52. clean:
  53. rm -f *.[oa] *~ core