Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2001 SuperH (UK) Ltd.
  4. # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
  5. #
  6. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. TOPDIR=../../../../
  8. include $(TOPDIR)Rules.mak
  9. CFLAGS += -I..
  10. ASFLAGS += -I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
  11. TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
  12. CRT_SRC := crt0.S
  13. CRT_OBJ := crt0.o crt1.o
  14. CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  15. SSRC := setjmp.S longjmp.S
  16. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  17. CSRC := __init_brk.c brk.c sbrk.c syscall.c
  18. COBJ := $(patsubst %.c,%.o, $(CSRC))
  19. OBJS := $(SOBJ) $(COBJ)
  20. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  21. all: $(OBJ_LIST) $(CTOR_TARGETS)
  22. $(OBJ_LIST): $(OBJS) $(CRT_OBJ)
  23. $(STRIPTOOL) -x -R .note -R .comment $^
  24. $(INSTALL) -d $(TOPDIR)lib/
  25. cp $(CRT_OBJ) $(TOPDIR)lib/
  26. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  27. $(CRT_OBJ): $(CRT_SRC)
  28. $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
  29. $(SOBJ): %.o : %.S
  30. $(CC) $(ASFLAGS) -c $< -o $@
  31. $(COBJ): %.o : %.c
  32. $(CC) $(CFLAGS) -c $< -o $@
  33. ifeq ($(UCLIBC_CTOR_DTOR),y)
  34. $(TOPDIR)lib/crti.o: crti.S
  35. $(INSTALL) -d $(TOPDIR)lib/
  36. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  37. $(TOPDIR)lib/crtn.o: crtn.S
  38. $(INSTALL) -d $(TOPDIR)lib/
  39. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  40. else
  41. $(CTOR_TARGETS):
  42. $(INSTALL) -d $(TOPDIR)lib/
  43. $(AR) $(ARFLAGS) $@
  44. endif
  45. headers:
  46. clean:
  47. $(RM) *.o *~ core