[git commit master 1/1] buildsys: use kbuild style
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Mon Feb 14 19:54:57 UTC 2011
commit: http://git.uclibc.org/uClibc/commit/?id=18e7136e79a89ba5e978f0dc445a8fcf8d619a40
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
libc/sysdeps/linux/common/Makefile.in | 135 ++++++++++-----------------------
1 files changed, 39 insertions(+), 96 deletions(-)
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index fdb06c5..229c391 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -8,127 +8,70 @@
COMMON_DIR := $(top_srcdir)libc/sysdeps/linux/common
COMMON_OUT := $(top_builddir)libc/sysdeps/linux/common
-CSRC := $(notdir $(wildcard $(COMMON_DIR)/*.c))
+CSRC-y := $(notdir $(wildcard $(COMMON_DIR)/*.c))
+CSRC- := ssp-local.c
-ifneq ($(UCLIBC_HAS_LFS),y)
CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c))
-CSRC := $(filter-out llseek.c $(CSRC_LFS),$(CSRC))
-endif
-
-CSRC := $(filter-out ssp-local.c,$(CSRC))
-ifneq ($(UCLIBC_HAS_SSP),y)
-CSRC := $(filter-out ssp.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_LINUX_MODULE_24),y)
-CSRC := $(filter-out create_module.c query_module.c get_kernel_syms.c,$(CSRC))
-endif
+CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y))
+CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS)
-ifneq ($(UCLIBC_LINUX_SPECIFIC),y)
+CSRC-$(UCLIBC_HAS_SSP) += ssp.c
+CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \
+ get_kernel_syms.c
# we need these internally: fstatfs.c statfs.c
-CSRC := $(filter-out capget.c capset.c inotify.c ioperm.c iopl.c \
+CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \
modify_ldt.c personality.c ppoll.c prctl.c readahead.c reboot.c \
remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \
sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \
splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \
- sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c,$(CSRC))
-ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-# we need madvise.c in NPTL
-CSRC := $(filter-out madvise.c,$(CSRC))
-endif
-endif
-
+ sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c
+CSRC-$(if $(and $(UCLIBC_LINUX_SPECIFIC),$(UCLIBC_HAS_THREADS_NATIVE)),y) += madvise.c
+CSRC-$(UCLIBC_HAS_THREADS_NATIVE) += fork.c getpid.c raise.c open.c close.c \
+ read.c write.c
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-CSRC := $(filter-out fork.c getpid.c raise.c open.c close.c read.c write.c, $(CSRC))
-ifeq ($(TARGET_ARCH),arm)
-CSRC := $(filter-out vfork.c, $(CSRC))
-else
-ifeq ($(TARGET_ARCH),x86_64)
-CSRC := $(filter-out vfork.c, $(CSRC))
-else
-ifeq ($(TARGET_ARCH),mips)
-ifeq ($(CONFIG_MIPS_O32_ABI),y)
-CSRC := $(filter-out waitpid.c, $(CSRC))
-endif
-else
-CSRC := $(filter-out waitpid.c, $(CSRC))
-endif
+CSRC- += waitpid.c
+CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)),waitpid.c)
endif
-endif
-endif
-
-ifneq ($(ARCH_USE_MMU),y)
# stubbed out in mman.h
-CSRC := $(filter-out msync.c, $(CSRC))
-endif
-
-ifneq ($(UCLIBC_BSD_SPECIFIC),y)
+CSRC-$(ARCH_USE_MMU) += msync.c
# we need these internally: getdomainname.c
-CSRC := $(filter-out mincore.c setdomainname.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_NTP_LEGACY),y)
-CSRC := $(filter-out ntp_gettime.c,$(CSRC))
-endif
-
-
-ifneq ($(UCLIBC_HAS_REALTIME),y)
+CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c
+CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c
# 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
-CSRC := $(filter-out clock_getres.c clock_gettime.c clock_settime.c fdatasync.c 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))
-endif
-
-
-ifneq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \
+ fdatasync.c 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
# 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_typ
ed_mem_get_info|pthread_mutex_timedlock|sem_timedwait
-CSRC := $(filter-out posix_fadvise64.c posix_fadvise.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_SUSV4_LEGACY),y)
-CSRC := $(filter-out utime.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_HAS_EPOLL),y)
-CSRC := $(filter-out epoll.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_HAS_XATTR),y)
-CSRC := $(filter-out xattr.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_HAS_PROFILING),y)
-CSRC := $(filter-out noophooks.c pcprofile.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_SV4_DEPRECATED),y)
-CSRC := $(filter-out ustat.c,$(CSRC))
-endif
-
-ifeq ($(TARGET_ARCH),sh)
-CSRC := $(filter-out longjmp.c vfork.c,$(CSRC))
-endif
-
-ifeq ($(TARGET_ARCH),sparc)
-CSRC := $(filter-out vfork.c,$(CSRC))
-endif
-
-ifeq ($(TARGET_ARCH),i386)
-CSRC := $(filter-out vfork.c,$(CSRC))
-endif
+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c
+CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
+CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
+CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),longjmp.c vfork.c)
+CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c)
+
+CSRC-y := $(filter-out $(CSRC-),$(CSRC-y))
# provided via pthreads builddir
-CSRC := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC))
+CSRC-y := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC-y))
SSRC := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC))
# fails for some reason
ifneq ($(strip $(ARCH_OBJS)),)
-CSRC := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC))
+CSRC-y := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC-y))
endif
CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS)
CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS)
-COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC))
-COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC))
+COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC-y))
+COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC-y))
libc-y += $(COMMON_OBJ)
libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o
--
1.7.3.4
More information about the uClibc-cvs
mailing list