Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # If you're looking for vfork(), it is defined in include/unistd.h
  11. CRT_SRC := crt0.S
  12. CRT_OBJ := crt0.o
  13. CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
  14. # why is crt1.c listed in CSRC ?
  15. CSRC := crt1.c syscalls.c longjmp.c setjmp.c vfork.c
  16. OBJS := $(patsubst %.c,%.o, $(CSRC))
  17. OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
  18. all: $(OBJ_LIST) $(CTOR_TARGETS)
  19. $(OBJ_LIST): $(OBJS) $(CRT_OBJ)
  20. $(STRIPTOOL) -x -R .note -R .comment $^
  21. $(INSTALL) -d $(TOPDIR)lib/
  22. cp $(CRT_OBJ) $(TOPDIR)lib/
  23. echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
  24. $(CRT_OBJ): %.o : %.S
  25. $(CC) $(ASFLAGS) -c $< -o $@
  26. $(OBJS): %.o : %.c
  27. $(CC) $(CFLAGS) -c $< -o $@
  28. ifeq ($(UCLIBC_CTOR_DTOR),y)
  29. $(TOPDIR)lib/crti.o: crti.S
  30. $(INSTALL) -d $(TOPDIR)lib/
  31. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  32. $(TOPDIR)lib/crtn.o: crtn.S
  33. $(INSTALL) -d $(TOPDIR)lib/
  34. $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
  35. else
  36. $(CTOR_TARGETS):
  37. $(INSTALL) -d $(TOPDIR)lib/
  38. $(AR) $(ARFLAGS) $@
  39. endif
  40. headers:
  41. clean:
  42. $(RM) *.o *~ core