Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #FIXME -- this arch should include its own crti.S and crtn.S
  9. UCLIBC_CTOR_DTOR=n
  10. CRT_SRC := crt0.S
  11. CRT_OBJ := crt0.o crt1.o
  12. CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  13. SSRC := clone.S _mmap.S setjmp.S vfork.S
  14. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  15. OBJS := $(SOBJ)
  16. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  17. all: $(OBJ_LIST) $(CTOR_TARGETS)
  18. $(OBJ_LIST): $(OBJS) $(CRT_OBJ)
  19. $(STRIPTOOL) -x -R .note -R .comment $^
  20. $(INSTALL) -d $(TOPDIR)lib/
  21. cp $(CRT_OBJ) $(TOPDIR)lib/
  22. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  23. $(CRT_OBJ): $(CRT_SRC)
  24. $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
  25. $(SOBJ): %.o : %.S
  26. $(CC) $(ASFLAGS) -c $< -o $@
  27. ifeq ($(UCLIBC_CTOR_DTOR),y)
  28. $(TOPDIR)lib/crti.o: crti.S
  29. $(INSTALL) -d $(TOPDIR)lib/
  30. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  31. $(TOPDIR)lib/crtn.o: crtn.S
  32. $(INSTALL) -d $(TOPDIR)lib/
  33. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  34. else
  35. $(CTOR_TARGETS):
  36. $(INSTALL) -d $(TOPDIR)lib/
  37. $(AR) $(ARFLAGS) $@
  38. endif
  39. headers:
  40. clean:
  41. $(RM) *.o *~ core