Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2001,2002 NEC Corporation
  4. # Copyright (C) 2001,2002 Miles Bader <miles@gnu.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. #FIXME -- this arch should include its own crti.S and crtn.S
  10. UCLIBC_CTOR_DTOR=n
  11. CFLAGS += -I..
  12. ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl
  13. TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
  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 := setjmp.S __longjmp.S vfork.S
  18. SOBJ := $(patsubst %.S,%.o, $(SSRC))
  19. CSRC := mmap.c syscall.c clone.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