Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2001,2002 NEC Corporation
  4. # Copyright (C) 2001,2002 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. CFLAGS += -I..
  27. SFLAGS = $(CFLAGS) -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 syscall.c
  34. COBJS = $(patsubst %.c,%.o, $(CSRC))
  35. OBJS = $(SOBJS) $(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)lib/$(CRT0_OBJ)
  41. $(CRT0_OBJ): %.o : %.S
  42. $(CC) $(SFLAGS) -c $< -o $@
  43. $(STRIPTOOL) -x -R .note -R .comment $*.o
  44. $(SOBJS): %.o : %.S
  45. $(CC) $(SFLAGS) -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. clean:
  52. rm -f *.[oa] *~ core
  53. rm -f bits/sysnum.h