Makefile.in 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. COMMON_DIR := $(top_srcdir)libc/sysdeps/linux/common
  8. COMMON_OUT := $(top_builddir)libc/sysdeps/linux/common
  9. CSRC-y := $(notdir $(wildcard $(COMMON_DIR)/*.c))
  10. CSRC- := ssp-local.c
  11. CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c))
  12. CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y))
  13. CSRC-y += llseek.c $(CSRC_LFS)
  14. CSRC-$(findstring y,$(UCLIBC_HAS_SSP)) += ssp.c
  15. # we need these internally: fstatfs.c statfs.c
  16. CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
  17. bdflush.c \
  18. capget.c \
  19. capset.c \
  20. dup3.c \
  21. euidaccess.c \
  22. eventfd.c \
  23. eventfd_read.c \
  24. eventfd_write.c \
  25. fanotify.c \
  26. getrandom.c \
  27. inotify.c \
  28. ioperm.c \
  29. iopl.c \
  30. modify_ldt.c \
  31. module.c \
  32. name_to_handle_at.c \
  33. open_by_handle_at.c \
  34. personality.c \
  35. pipe2.c \
  36. ppoll.c \
  37. prctl.c \
  38. prlimit.c \
  39. readahead.c \
  40. reboot.c \
  41. remap_file_pages.c \
  42. sched_cpucount.c \
  43. sched_getaffinity.c \
  44. sched_getcpu.c \
  45. sched_setaffinity.c \
  46. sendfile.c \
  47. setfsgid.c \
  48. setfsuid.c \
  49. setns.c \
  50. setresgid.c \
  51. setresuid.c \
  52. signalfd.c \
  53. splice.c \
  54. swapoff.c \
  55. swapon.c \
  56. sync_file_range.c \
  57. syncfs.c \
  58. sysctl.c \
  59. sysinfo.c \
  60. tee.c \
  61. timerfd.c \
  62. umount2.c \
  63. umount.c \
  64. unshare.c \
  65. uselib.c \
  66. vhangup.c \
  67. vmsplice.c
  68. CSRC-$(UCLIBC_LINUX_SPECIFIC) += sendfile64.c
  69. # posix_fallocate() needs __libc_fallocate() from fallocate.c
  70. # posix_fallocate64() needs __libc_fallocate64() from fallocate64.c
  71. CSRC-$(if $(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_ADVANCED_REALTIME),y,) += \
  72. fallocate.c $(filter fallocate64.c,$(CSRC-y))
  73. # NPTL needs these internally: madvise.c
  74. CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
  75. ifeq ($(UCLIBC_HAS_THREADS),y)
  76. CSRC- += raise.c
  77. endif
  78. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  79. CSRC- += fork.c getpid.c
  80. CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c)
  81. CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c)
  82. CSRC- += $(if $(findstring =metag=,=$(TARGET_ARCH)=),vfork.c)
  83. endif
  84. ifneq ($(ARCH_HAS_DEPRECATED_SYSCALLS),y)
  85. # No conversion is needed for new architectures
  86. CSRC- += xstatconv.c
  87. endif
  88. # stubbed out in mman.h
  89. CSRC-$(ARCH_USE_MMU) += msync.c
  90. # we need these internally: getdomainname.c
  91. CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c
  92. CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c
  93. # aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime
  94. CSRC-$(UCLIBC_HAS_REALTIME) += clock_adjtime.c clock_getres.c clock_gettime.c clock_settime.c \
  95. fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \
  96. nanosleep.c __rt_sigtimedwait.c __rt_sigwaitinfo.c sched_getparam.c \
  97. sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \
  98. sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c
  99. # use clock_gettime.c from librt
  100. ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
  101. CSRC- += clock_gettime.c
  102. endif
  103. # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_get_info|pthread_mutex_timedlock|sem_timedwait
  104. CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
  105. posix_fallocate.c posix_fallocate64.c
  106. CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
  107. CSRC- += epoll.c # multi-source
  108. CSRC-$(UCLIBC_HAS_EPOLL) += epoll_create.c epoll_ctl.c epoll_wait.c epoll_pwait.c
  109. CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
  110. CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
  111. CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
  112. CSRC- += $(if $(findstring =c6x=,=$(TARGET_ARCH)=),vfork.c)
  113. CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),vfork.c)
  114. CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c)
  115. CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c)
  116. CSRC-y := $(filter-out $(CSRC-),$(CSRC-y))
  117. # provided via pthreads builddir
  118. CSRC-y := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC-y))
  119. SSRC-y := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC-y))
  120. # fails for some reason
  121. ifneq ($(strip $(ARCH_OBJS-y)),)
  122. CSRC-y := $(filter-out $(notdir $(ARCH_OBJS-y:.o=.c)) $(ARCH_OBJ_FILTEROUT-y),$(CSRC-y))
  123. endif
  124. CFLAGS-OMIT-ssp.c := $(CFLAG_-fstack-protector) $(CFLAG_-fstack-protector-all) $(CFLAG_-fstack-protector-strong)
  125. CFLAGS-OMIT-ssp-local.c := $(CFLAG_-fstack-protector) $(CFLAG_-fstack-protector-all) $(CFLAG_-fstack-protector-strong)
  126. CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS)
  127. CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS)
  128. COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC-y))
  129. COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC-y))
  130. libc-y += $(COMMON_OBJ)
  131. libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o
  132. libc-nonshared-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.os
  133. libc-nomulti-y += $(COMMON_OUT)/__syscall_rt_sigaction.o \
  134. $(COMMON_OUT)/__syscall_sigaction.o \
  135. $(COMMON_OUT)/mremap.o \
  136. $(COMMON_OUT)/stat.o
  137. libc-nomulti-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp.o
  138. objclean-y += CLEAN_libc/sysdeps/linux/common
  139. CLEAN_libc/sysdeps/linux/common:
  140. $(do_rm) $(addprefix $(COMMON_OUT)/*., o os oS)