summaryrefslogtreecommitdiff
path: root/libc/unistd
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-05 18:54:24 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-05 18:55:08 +0100
commit1b3025b7352f5e432ffa1c7adc57085ac9092b77 (patch)
treebb94261d0cf3f76b7bc206a8aa2e69b2419b3944 /libc/unistd
parentaeac3e1220a8afc856bd25e4d87441a26588aac0 (diff)
buildsys: switch libc to kbuild-style
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/unistd')
-rw-r--r--libc/unistd/Makefile.in50
1 files changed, 17 insertions, 33 deletions
diff --git a/libc/unistd/Makefile.in b/libc/unistd/Makefile.in
index 98edc6a25..5eedf1732 100644
--- a/libc/unistd/Makefile.in
+++ b/libc/unistd/Makefile.in
@@ -10,39 +10,23 @@ subdirs += libc/unistd
UNISTD_DIR := $(top_srcdir)libc/unistd
UNISTD_OUT := $(top_builddir)libc/unistd
-CSRC := $(notdir $(wildcard $(UNISTD_DIR)/*.c))
-# multi source
-CSRC := $(filter-out exec.c,$(CSRC))
-
-ifeq ($(ARCH_USE_MMU),y)
-CSRC := $(filter-out __exec_alloc.c,$(CSRC))
-endif
-
-ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
-CSRC := $(filter-out getopt-susv3.c getopt_long-simple.c,$(CSRC))
-else
-CSRC := $(filter-out getopt.c,$(CSRC))
-ifneq ($(UCLIBC_HAS_GETOPT_LONG),y)
-CSRC := $(filter-out getopt_long-simple.c,$(CSRC))
-endif
-endif
-
-ifeq ($(UCLIBC_HAS_GNU_GETSUBOPT),y)
-CSRC := $(filter-out getsubopt-susv3.c,$(CSRC))
-else
-CSRC := $(filter-out getsubopt.c,$(CSRC))
-endif
-
-ifneq ($(UCLIBC_SUSV3_LEGACY),y)
-CSRC := $(filter-out ualarm.c usleep.c,$(CSRC))
-endif
-
-#ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-#CSRC := $(filter-out sleep.c,$(CSRC))
-#endif
-
-UNISTD_SRC := $(patsubst %.c,$(UNISTD_DIR)/%.c,$(CSRC))
-UNISTD_OBJ := $(patsubst %.c,$(UNISTD_OUT)/%.o,$(CSRC))
+CSRC-y := $(notdir $(wildcard $(UNISTD_DIR)/*.c))
+OMIT-y := exec.c # multi source
+OMIT-$(ARCH_USE_MMU) += __exec_alloc.c
+OMIT-$(if $(UCLIBC_SUSV3_LEGACY),,y) += ualarm.c usleep.c
+#OMIT-$(UCLIBC_HAS_THREADS_NATIVE) += sleep.c
+
+# the VARIANT we OMIT
+# GNU_GETOPT comes with getopt_long unconditionally (?), OMIT the other
+VARIANT := $(if $(UCLIBC_HAS_GNU_GETOPT),-susv3)
+GO_LONG := $(if $(UCLIBC_HAS_GNU_GETOPT),getopt_long-simple.c)
+OMIT-$(UCLIBC_HAS_GNU_GETOPT) += getopt$(VARIANT).c $(GO_LONG)
+OMIT-$(UCLIBC_HAS_GNU_GETSUBOPT) += getsubopt$(VARIANT).c
+
+CSRC-y := $(filter-out $(OMIT-y),$(CSRC-y))
+
+UNISTD_SRC := $(patsubst %.c,$(UNISTD_DIR)/%.c,$(CSRC-y))
+UNISTD_OBJ := $(patsubst %.c,$(UNISTD_OUT)/%.o,$(CSRC-y))
libc-y += $(UNISTD_OBJ)