Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #
  2. # Makefile for OS/161 C standard library
  3. #
  4. TOP=../../..
  5. .include "$(TOP)/mk/os161.config.mk"
  6. COMMON=$(TOP)/common/libc
  7. # printf
  8. SRCS+=\
  9. $(COMMON)/printf/__printf.c \
  10. $(COMMON)/printf/snprintf.c
  11. # stdio
  12. SRCS+=\
  13. stdio/__puts.c \
  14. stdio/getchar.c \
  15. stdio/printf.c \
  16. stdio/putchar.c \
  17. stdio/puts.c
  18. # stdlib
  19. SRCS+=\
  20. stdlib/abort.c \
  21. $(COMMON)/stdlib/atoi.c \
  22. stdlib/exit.c \
  23. stdlib/malloc.c \
  24. stdlib/random.c \
  25. stdlib/system.c
  26. # string
  27. SRCS+=\
  28. $(COMMON)/string/bzero.c \
  29. string/memcmp.c \
  30. $(COMMON)/string/memcpy.c \
  31. $(COMMON)/string/memmove.c \
  32. string/memset.c \
  33. $(COMMON)/string/strcat.c \
  34. $(COMMON)/string/strchr.c \
  35. $(COMMON)/string/strcmp.c \
  36. $(COMMON)/string/strcpy.c \
  37. string/strerror.c \
  38. $(COMMON)/string/strlen.c \
  39. $(COMMON)/string/strrchr.c \
  40. string/strtok.c \
  41. $(COMMON)/string/strtok_r.c
  42. # time
  43. SRCS+=\
  44. time/time.c
  45. # system call stubs
  46. SRCS+=\
  47. $(MYBUILDDIR)/syscalls.S
  48. # gcc support
  49. COMMONGCC=$(TOP)/common/gcc-millicode
  50. SRCS+=\
  51. $(COMMONGCC)/adddi3.c \
  52. $(COMMONGCC)/anddi3.c \
  53. $(COMMONGCC)/ashldi3.c \
  54. $(COMMONGCC)/ashrdi3.c \
  55. $(COMMONGCC)/cmpdi2.c \
  56. $(COMMONGCC)/divdi3.c \
  57. $(COMMONGCC)/iordi3.c \
  58. $(COMMONGCC)/lshldi3.c \
  59. $(COMMONGCC)/lshrdi3.c \
  60. $(COMMONGCC)/moddi3.c \
  61. $(COMMONGCC)/muldi3.c \
  62. $(COMMONGCC)/negdi2.c \
  63. $(COMMONGCC)/notdi2.c \
  64. $(COMMONGCC)/qdivrem.c \
  65. $(COMMONGCC)/subdi3.c \
  66. $(COMMONGCC)/ucmpdi2.c \
  67. $(COMMONGCC)/udivdi3.c \
  68. $(COMMONGCC)/umoddi3.c \
  69. $(COMMONGCC)/xordi3.c
  70. # other stuff
  71. SRCS+=\
  72. unix/__assert.c \
  73. unix/err.c \
  74. unix/errno.c \
  75. unix/getcwd.c \
  76. $(COMMON)/arch/mips/setjmp.S
  77. # Name of the library.
  78. LIB=c
  79. # Let the templates do most of the work.
  80. .include "$(TOP)/mk/os161.lib.mk"
  81. #
  82. # Generate syscall entry points from system call list.
  83. #
  84. # Note that this will bomb if the kernel headers haven't been
  85. # installed into the staging area.
  86. #
  87. SYSCALL_H=$(INSTALLTOP)/include/kern/syscall.h
  88. $(MYBUILDDIR)/syscalls.S: $(TOP)/defs.mk $(SYSCALL_H)
  89. $(MYBUILDDIR)/syscalls.S: syscalls/gensyscalls.sh
  90. $(MYBUILDDIR)/syscalls.S: arch/$(MACHINE)/syscalls-$(MACHINE).S
  91. -rm -f $@ $@.tmp
  92. echo '/* Automatically generated; do not edit */' > $@.tmp
  93. cat arch/$(MACHINE)/syscalls-$(MACHINE).S >> $@.tmp
  94. syscalls/gensyscalls.sh < $(SYSCALL_H) >> $@.tmp
  95. mv -f $@.tmp $@
  96. clean: cleanhere
  97. cleanhere:
  98. rm -f $(MYBUILDDIR)/syscalls.S
  99. depend: predepend
  100. predepend: $(MYBUILDDIR)
  101. $(MAKE) $(MYBUILDDIR)/syscalls.S
  102. .PHONY: clean cleanhere depend predepend
  103. # Have the machine-dependent stuff depend on defs.mk in case MACHINE
  104. # or PLATFORM changes.
  105. setjmp.o: $(TOP)/defs.mk