Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2001 SuperH (UK) Ltd.
  4. # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  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. CFLAGS += -I..
  22. ASFLAGS += -I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
  23. TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
  24. CRT_SRC := crt0.S
  25. CRT_OBJ := crt0.o crt1.o
  26. CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  27. SSRC := setjmp.S longjmp.S
  28. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  29. CSRC := __init_brk.c brk.c sbrk.c syscall.c
  30. COBJ := $(patsubst %.c,%.o, $(CSRC))
  31. OBJS := $(SOBJ) $(COBJ)
  32. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  33. all: $(OBJ_LIST) $(CTOR_TARGETS)
  34. $(OBJ_LIST): $(OBJS) $(CRT_OBJ)
  35. $(STRIPTOOL) -x -R .note -R .comment $^
  36. $(INSTALL) -d $(TOPDIR)lib/
  37. cp $(CRT_OBJ) $(TOPDIR)lib/
  38. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  39. $(CRT_OBJ): $(CRT_SRC)
  40. $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
  41. $(SOBJ): %.o : %.S
  42. $(CC) $(ASFLAGS) -c $< -o $@
  43. $(COBJ): %.o : %.c
  44. $(CC) $(CFLAGS) -c $< -o $@
  45. ifeq ($(UCLIBC_CTOR_DTOR),y)
  46. $(TOPDIR)lib/crti.o: crti.S
  47. $(INSTALL) -d $(TOPDIR)lib/
  48. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  49. $(TOPDIR)lib/crtn.o: crtn.S
  50. $(INSTALL) -d $(TOPDIR)lib/
  51. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  52. else
  53. $(CTOR_TARGETS):
  54. $(INSTALL) -d $(TOPDIR)lib/
  55. $(AR) $(ARFLAGS) $@
  56. endif
  57. headers:
  58. clean:
  59. $(RM) *.o *~ core