Makefile.in 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 := $(notdir $(wildcard $(COMMON_DIR)/*.c))
  10. ifneq ($(UCLIBC_HAS_LFS),y)
  11. CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c))
  12. CSRC := $(filter-out llseek.c $(CSRC_LFS),$(CSRC))
  13. endif
  14. CSRC := $(filter-out ssp-local.c,$(CSRC))
  15. ifneq ($(UCLIBC_HAS_SSP),y)
  16. CSRC := $(filter-out ssp.c,$(CSRC))
  17. endif
  18. ifneq ($(UCLIBC_LINUX_MODULE_24),y)
  19. CSRC := $(filter-out create_module.c query_module.c get_kernel_syms.c,$(CSRC))
  20. endif
  21. ifneq ($(UCLIBC_LINUX_SPECIFIC),y)
  22. # we need these internally: fstatfs.c statfs.c
  23. CSRC := $(filter-out capget.c capset.c inotify.c ioperm.c iopl.c \
  24. modify_ldt.c personality.c ppoll.c prctl.c readahead.c reboot.c \
  25. remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \
  26. sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \
  27. splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \
  28. sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c,$(CSRC))
  29. ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  30. # we need madvise.c in NPTL
  31. CSRC := $(filter-pout madvise.c,$(CSRC))
  32. endif
  33. endif
  34. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  35. CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CSRC))
  36. ifeq ($(TARGET_ARCH),arm)
  37. CSRC := $(filter-out vfork.c, $(CSRC))
  38. else ifeq ($(TARGET_ARCH),x86_64)
  39. CSRC := $(filter-out vfork.c, $(CSRC))
  40. else ifeq ($(TARGET_ARCH),mips)
  41. ifeq ($(CONFIG_MIPS_O32_ABI),y)
  42. CSRC := $(filter-out waitpid.c, $(CSRC))
  43. endif
  44. else
  45. CSRC := $(filter-out waitpid.c, $(CSRC))
  46. endif
  47. endif
  48. ifneq ($(ARCH_USE_MMU),y)
  49. # stubbed out in mman.h
  50. CSRC := $(filter-out msync.c, $(CSRC))
  51. endif
  52. ifneq ($(UCLIBC_BSD_SPECIFIC),y)
  53. # we need these internally: getdomainname.c
  54. CSRC := $(filter-out mincore.c setdomainname.c,$(CSRC))
  55. endif
  56. ifneq ($(UCLIBC_NTP_LEGACY),y)
  57. CSRC := $(filter-out ntp_gettime.c,$(CSRC))
  58. endif
  59. ifneq ($(UCLIBC_HAS_REALTIME),y)
  60. # 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|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime
  61. CSRC := $(filter-out clock_getres.c clock_gettime.c clock_settime.c fdatasync.c Makefile.in mlockall.c mlock.c munlockall.c munlock.c nanosleep.c __rt_sigtimedwait.c sched_getparam.c sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c,$(CSRC))
  62. endif
  63. ifneq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
  64. # 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
  65. CSRC := $(filter-out posix_fadvise64.c posix_fadvise.c,$(CSRC))
  66. endif
  67. ifneq ($(UCLIBC_SUSV4_LEGACY),y)
  68. CSRC := $(filter-out utime.c,$(CSRC))
  69. endif
  70. ifneq ($(UCLIBC_HAS_EPOLL),y)
  71. CSRC := $(filter-out epoll.c,$(CSRC))
  72. endif
  73. ifneq ($(UCLIBC_HAS_XATTR),y)
  74. CSRC := $(filter-out xattr.c,$(CSRC))
  75. endif
  76. ifneq ($(UCLIBC_HAS_PROFILING),y)
  77. CSRC := $(filter-out noophooks.c pcprofile.c,$(CSRC))
  78. endif
  79. ifneq ($(UCLIBC_SV4_DEPRECATED),y)
  80. CSRC := $(filter-out ustat.c,$(CSRC))
  81. endif
  82. ifeq ($(TARGET_ARCH),sh)
  83. CSRC := $(filter-out longjmp.c vfork.c,$(CSRC))
  84. endif
  85. ifeq ($(TARGET_ARCH),sparc)
  86. CSRC := $(filter-out vfork.c,$(CSRC))
  87. endif
  88. ifeq ($(TARGET_ARCH),i386)
  89. CSRC := $(filter-out vfork.c,$(CSRC))
  90. endif
  91. # provided via pthreads builddir
  92. CSRC := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC))
  93. SSRC := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC))
  94. # fails for some reason
  95. ifneq ($(strip $(ARCH_OBJS)),)
  96. CSRC := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC))
  97. endif
  98. CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS)
  99. CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS)
  100. COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC))
  101. COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC))
  102. libc-y += $(COMMON_OBJ)
  103. libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o
  104. libc-nonshared-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.os
  105. libc-nomulti-y += $(COMMON_OUT)/__syscall_rt_sigaction.o \
  106. $(COMMON_OUT)/__syscall_sigaction.o \
  107. $(COMMON_OUT)/mremap.o \
  108. $(COMMON_OUT)/stat.o
  109. libc-nomulti-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp.o
  110. objclean-y += CLEAN_libc/sysdeps/linux/common
  111. CLEAN_libc/sysdeps/linux/common:
  112. $(do_rm) $(addprefix $(COMMON_OUT)/*., o os oS)