Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. TOPDIR=../../../../
  7. include $(TOPDIR)Rules.mak
  8. ifeq ($(DOPIC),y)
  9. # is this not provided by gcc ?
  10. ASFLAGS+=-D__PIC__
  11. endif
  12. #FIXME -- this arch should include its own crti.S and crtn.S
  13. UCLIBC_CTOR_DTOR=n
  14. CRT_SRC := crt0.S
  15. CRT_OBJ := crt0.o crt1.o
  16. CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  17. SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S
  18. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  19. CSRC := ptrace.c brk.c
  20. COBJ := $(patsubst %.c,%.o, $(CSRC))
  21. OBJS := $(SOBJ) $(COBJ)
  22. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  23. all: $(OBJ_LIST) $(CTOR_TARGETS)
  24. $(OBJ_LIST): $(OBJS) $(CRT_OBJ)
  25. $(STRIPTOOL) -x -R .note -R .comment $^
  26. $(INSTALL) -d $(TOPDIR)lib/
  27. cp $(CRT_OBJ) $(TOPDIR)lib/
  28. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  29. $(CRT_OBJ): $(CRT_SRC)
  30. $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
  31. $(SOBJ): %.o : %.S
  32. $(CC) $(ASFLAGS) -c $< -o $@
  33. $(COBJ): %.o : %.c
  34. $(CC) $(CFLAGS) -c $< -o $@
  35. ifeq ($(UCLIBC_CTOR_DTOR),y)
  36. $(TOPDIR)lib/crti.o: crti.S
  37. $(INSTALL) -d $(TOPDIR)lib/
  38. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  39. $(TOPDIR)lib/crtn.o: crtn.S
  40. $(INSTALL) -d $(TOPDIR)lib/
  41. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  42. else
  43. $(CTOR_TARGETS):
  44. $(INSTALL) -d $(TOPDIR)lib/
  45. $(AR) $(ARFLAGS) $@
  46. endif
  47. headers:
  48. clean:
  49. $(RM) *.o *~ core