3 # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 UNISTD_DIR := $(top_srcdir)libc/unistd
11 UNISTD_OUT := $(top_builddir)libc/unistd
13 CSRC := $(notdir $(wildcard $(UNISTD_DIR)/*.c))
15 CSRC := $(filter-out exec.c,$(CSRC))
17 ifeq ($(ARCH_USE_MMU),y)
18 CSRC := $(filter-out __exec_alloc.c,$(CSRC))
21 ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
22 CSRC := $(filter-out getopt-susv3.c getopt_long-simple.c,$(CSRC))
24 CSRC := $(filter-out getopt.c,$(CSRC))
25 ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
26 CSRC := $(filter-out getopt_long-simple.c,$(CSRC))
30 ifeq ($(UCLIBC_HAS_GNU_GETSUBOPT),y)
31 CSRC := $(filter-out getsubopt-susv3.c,$(CSRC))
33 CSRC := $(filter-out getsubopt.c,$(CSRC))
36 ifneq ($(UCLIBC_SUSV3_LEGACY),y)
37 CSRC := $(filter-out ualarm.c usleep.c,$(CSRC))
40 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
41 CSRC := $(filter-out sleep.c,$(CSRC))
44 UNISTD_SRC := $(patsubst %.c,$(UNISTD_DIR)/%.c,$(CSRC))
45 UNISTD_OBJ := $(patsubst %.c,$(UNISTD_OUT)/%.o,$(CSRC))
47 libc-y += $(UNISTD_OBJ)
49 objclean-y += CLEAN_libc/unistd
52 $(do_rm) $(addprefix $(UNISTD_OUT)/*., o os)