From 49d8a0e9c6e32701c7eca91a1204237d3a334e38 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Mon, 17 Aug 2009 19:17:00 +0200
Subject: support building out-of-tree

  Handle O=

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/inet/Makefile.in                   | 2 ++
 libc/inet/rpc/Makefile.in               | 2 ++
 libc/misc/assert/Makefile.in            | 2 ++
 libc/misc/ctype/Makefile.in             | 2 ++
 libc/misc/dirent/Makefile.in            | 2 ++
 libc/misc/elf/Makefile.in               | 2 ++
 libc/misc/error/Makefile.in             | 2 ++
 libc/misc/file/Makefile.in              | 2 ++
 libc/misc/fnmatch/Makefile.in           | 2 ++
 libc/misc/ftw/Makefile.in               | 2 ++
 libc/misc/glob/Makefile.in              | 2 ++
 libc/misc/gnu/Makefile.in               | 2 ++
 libc/misc/internals/Makefile.in         | 2 ++
 libc/misc/locale/Makefile.in            | 2 ++
 libc/misc/mntent/Makefile.in            | 2 ++
 libc/misc/pthread/Makefile.in           | 2 ++
 libc/misc/regex/Makefile.in             | 2 ++
 libc/misc/search/Makefile.in            | 2 ++
 libc/misc/statfs/Makefile.in            | 2 ++
 libc/misc/syslog/Makefile.in            | 2 ++
 libc/misc/sysvipc/Makefile.in           | 2 ++
 libc/misc/time/Makefile.in              | 2 ++
 libc/misc/ttyent/Makefile.in            | 2 ++
 libc/misc/utmp/Makefile.in              | 2 ++
 libc/misc/wchar/Makefile.in             | 2 ++
 libc/misc/wctype/Makefile.in            | 2 ++
 libc/misc/wordexp/Makefile.in           | 2 ++
 libc/pwd_grp/Makefile.in                | 2 ++
 libc/signal/Makefile.in                 | 2 ++
 libc/stdio/Makefile.in                  | 2 ++
 libc/stdlib/Makefile.in                 | 2 ++
 libc/stdlib/malloc-simple/Makefile.in   | 2 ++
 libc/stdlib/malloc-standard/Makefile.in | 2 ++
 libc/stdlib/malloc/Makefile.in          | 2 ++
 libc/string/Makefile.in                 | 2 ++
 libc/sysdeps/linux/Makefile.commonarch  | 3 +--
 libc/sysdeps/linux/Makefile.in          | 2 ++
 libc/termios/Makefile.in                | 2 ++
 libc/unistd/Makefile.in                 | 2 ++
 39 files changed, 77 insertions(+), 2 deletions(-)

(limited to 'libc')

diff --git a/libc/inet/Makefile.in b/libc/inet/Makefile.in
index 87d3203b8..cf689d806 100644
--- a/libc/inet/Makefile.in
+++ b/libc/inet/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/inet
+
 include $(top_srcdir)libc/inet/rpc/Makefile.in
 
 INET_DIR := $(top_srcdir)libc/inet
diff --git a/libc/inet/rpc/Makefile.in b/libc/inet/rpc/Makefile.in
index 1d1081b5b..b498f92d7 100644
--- a/libc/inet/rpc/Makefile.in
+++ b/libc/inet/rpc/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/inet/rpc
+
 CFLAGS-rpc := -fno-strict-aliasing
 
 ifneq ($(UCLIBC_HAS_FULL_RPC),y)
diff --git a/libc/misc/assert/Makefile.in b/libc/misc/assert/Makefile.in
index 22dfeeb12..1e08c1610 100644
--- a/libc/misc/assert/Makefile.in
+++ b/libc/misc/assert/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/assert
+
 CSRC := __assert.c
 
 MISC_ASSERT_DIR := $(top_srcdir)libc/misc/assert
diff --git a/libc/misc/ctype/Makefile.in b/libc/misc/ctype/Makefile.in
index 3f307f093..f4705e1d5 100644
--- a/libc/misc/ctype/Makefile.in
+++ b/libc/misc/ctype/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/ctype
+
 # multi source ctype.c
 COM_SRC := \
 	isalnum.c isalpha.c iscntrl.c isdigit.c \
diff --git a/libc/misc/dirent/Makefile.in b/libc/misc/dirent/Makefile.in
index b3a017896..daeefb7e1 100644
--- a/libc/misc/dirent/Makefile.in
+++ b/libc/misc/dirent/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/dirent
+
 CSRC :=	alphasort.c closedir.c dirfd.c opendir.c readdir.c rewinddir.c \
 	scandir.c seekdir.c telldir.c readdir_r.c versionsort.c
 
diff --git a/libc/misc/elf/Makefile.in b/libc/misc/elf/Makefile.in
index 4c5d9c8b7..1b594dee6 100644
--- a/libc/misc/elf/Makefile.in
+++ b/libc/misc/elf/Makefile.in
@@ -4,6 +4,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/elf
+
 libc_a_CSRC = dl-support.c dl-core.c dl-iterate-phdr.c
 CFLAGS-dl-iterate-phdr.c=-D_GNU_SOURCE -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include
 CFLAGS-dl-core.c=-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include
diff --git a/libc/misc/error/Makefile.in b/libc/misc/error/Makefile.in
index d0e60a28c..fe0d0c1b9 100644
--- a/libc/misc/error/Makefile.in
+++ b/libc/misc/error/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/error
+
 CSRC :=
 ifeq ($(UCLIBC_HAS_BSD_ERR),y)
 CSRC += err.c
diff --git a/libc/misc/file/Makefile.in b/libc/misc/file/Makefile.in
index 43b639cc5..cb6c85549 100644
--- a/libc/misc/file/Makefile.in
+++ b/libc/misc/file/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/file
+
 MISC_FILE_DIR := $(top_srcdir)libc/misc/file
 MISC_FILE_OUT := $(top_builddir)libc/misc/file
 
diff --git a/libc/misc/fnmatch/Makefile.in b/libc/misc/fnmatch/Makefile.in
index ac9076dd2..75746ef2b 100644
--- a/libc/misc/fnmatch/Makefile.in
+++ b/libc/misc/fnmatch/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/fnmatch
+
 ifeq ($(UCLIBC_HAS_FNMATCH_OLD),y)
 CSRC := fnmatch_old.c
 else
diff --git a/libc/misc/ftw/Makefile.in b/libc/misc/ftw/Makefile.in
index bceab2124..389ad792d 100644
--- a/libc/misc/ftw/Makefile.in
+++ b/libc/misc/ftw/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/ftw
+
 CSRC := ftw.c
 ifeq ($(UCLIBC_HAS_LFS),y)
 CSRC += ftw64.c
diff --git a/libc/misc/glob/Makefile.in b/libc/misc/glob/Makefile.in
index b7a2afcac..346dff316 100644
--- a/libc/misc/glob/Makefile.in
+++ b/libc/misc/glob/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/glob
+
 ifeq ($(UCLIBC_HAS_GNU_GLOB),y)
 CSRC := glob.c
 ifeq ($(UCLIBC_HAS_LFS),y)
diff --git a/libc/misc/gnu/Makefile.in b/libc/misc/gnu/Makefile.in
index c3a98e8cc..d4a59004d 100644
--- a/libc/misc/gnu/Makefile.in
+++ b/libc/misc/gnu/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/gnu
+
 CSRC := obstack.c
 
 MISC_GNU_DIR := $(top_srcdir)libc/misc/gnu
diff --git a/libc/misc/internals/Makefile.in b/libc/misc/internals/Makefile.in
index 230e6e7a9..39bc8d51a 100644
--- a/libc/misc/internals/Makefile.in
+++ b/libc/misc/internals/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/internals
+
 CFLAGS-__uClibc_main.c := $(SSP_DISABLE_FLAGS)
 
 CSRC := tempname.c errno.c __errno_location.c __h_errno_location.c
diff --git a/libc/misc/locale/Makefile.in b/libc/misc/locale/Makefile.in
index 689bd0bc3..566939804 100644
--- a/libc/misc/locale/Makefile.in
+++ b/libc/misc/locale/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/locale
+
 # multi source locale.c
 CSRC := setlocale.c localeconv.c _locale_init.c nl_langinfo.c
 ifeq ($(UCLIBC_HAS_LOCALE),y)
diff --git a/libc/misc/mntent/Makefile.in b/libc/misc/mntent/Makefile.in
index 36cbe6702..62bbdc95b 100644
--- a/libc/misc/mntent/Makefile.in
+++ b/libc/misc/mntent/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/mntent
+
 CSRC := mntent.c
 
 MISC_MNTENT_DIR := $(top_srcdir)libc/misc/mntent
diff --git a/libc/misc/pthread/Makefile.in b/libc/misc/pthread/Makefile.in
index 68e17e9ce..ceea1c21b 100644
--- a/libc/misc/pthread/Makefile.in
+++ b/libc/misc/pthread/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/pthread
+
 MISC_PTHREAD_DIR := $(top_srcdir)libc/misc/pthread
 MISC_PTHREAD_OUT := $(top_builddir)libc/misc/pthread
 
diff --git a/libc/misc/regex/Makefile.in b/libc/misc/regex/Makefile.in
index 4a2e53fa2..f9af23007 100644
--- a/libc/misc/regex/Makefile.in
+++ b/libc/misc/regex/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/regex
+
 ifeq ($(UCLIBC_HAS_REGEX_OLD),y)
 CSRC := regex_old.c
 else
diff --git a/libc/misc/search/Makefile.in b/libc/misc/search/Makefile.in
index 495c3cf9e..f8f846749 100644
--- a/libc/misc/search/Makefile.in
+++ b/libc/misc/search/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/search
+
 CSRC := hsearch.c
 
 # multi source _tsearch.c
diff --git a/libc/misc/statfs/Makefile.in b/libc/misc/statfs/Makefile.in
index 1c4fa839b..a7929a5c7 100644
--- a/libc/misc/statfs/Makefile.in
+++ b/libc/misc/statfs/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/statfs
+
 CSRC := statvfs.c fstatvfs.c
 ifeq ($(UCLIBC_HAS_LFS),y)
 ifeq ($(UCLIBC_LINUX_SPECIFIC),y)
diff --git a/libc/misc/syslog/Makefile.in b/libc/misc/syslog/Makefile.in
index 90c18e6c1..b666f8c72 100644
--- a/libc/misc/syslog/Makefile.in
+++ b/libc/misc/syslog/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/syslog
+
 CSRC := syslog.c
 
 MISC_SYSLOG_DIR := $(top_srcdir)libc/misc/syslog
diff --git a/libc/misc/sysvipc/Makefile.in b/libc/misc/sysvipc/Makefile.in
index c3807c07c..e7f3a08a8 100644
--- a/libc/misc/sysvipc/Makefile.in
+++ b/libc/misc/sysvipc/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/sysvipc
+
 CSRC := ftok.c __syscall_ipc.c
 
 # multi source sem.c
diff --git a/libc/misc/time/Makefile.in b/libc/misc/time/Makefile.in
index 41934873a..238170eb9 100644
--- a/libc/misc/time/Makefile.in
+++ b/libc/misc/time/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/time
+
 CSRC := adjtime.c
 ifeq ($(UCLIBC_SUSV3_LEGACY),y)
 CSRC += ftime.c
diff --git a/libc/misc/ttyent/Makefile.in b/libc/misc/ttyent/Makefile.in
index d20f7adbc..659fa7c1f 100644
--- a/libc/misc/ttyent/Makefile.in
+++ b/libc/misc/ttyent/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/ttyent
+
 CSRC := getttyent.c
 
 MISC_TTYENT_DIR := $(top_srcdir)libc/misc/ttyent
diff --git a/libc/misc/utmp/Makefile.in b/libc/misc/utmp/Makefile.in
index fcc830692..5837171cb 100644
--- a/libc/misc/utmp/Makefile.in
+++ b/libc/misc/utmp/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/utmp
+
 CSRC := utent.c wtent.c
 
 MISC_UTMP_DIR := $(top_srcdir)libc/misc/utmp
diff --git a/libc/misc/wchar/Makefile.in b/libc/misc/wchar/Makefile.in
index e72e31ecc..0258f9f53 100644
--- a/libc/misc/wchar/Makefile.in
+++ b/libc/misc/wchar/Makefile.in
@@ -16,6 +16,8 @@
 # wcsftime
 #
 
+subdirs += libc/misc/wchar
+
 # multi source wchar.c
 CSRC :=	btowc.c wctob.c mbsinit.c mbrlen.c mbrtowc.c wcrtomb.c mbsrtowcs.c \
 	wcsrtombs.c _wchar_utf8sntowcs.c _wchar_wcsntoutf8s.c \
diff --git a/libc/misc/wctype/Makefile.in b/libc/misc/wctype/Makefile.in
index e62c731bd..f7c4ddd87 100644
--- a/libc/misc/wctype/Makefile.in
+++ b/libc/misc/wctype/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/wctype
+
 # multi source _wctype.c
 COM_SRC := \
 	iswalnum.c iswalpha.c iswcntrl.c iswdigit.c iswgraph.c \
diff --git a/libc/misc/wordexp/Makefile.in b/libc/misc/wordexp/Makefile.in
index 262f039ed..8d2f50ba0 100644
--- a/libc/misc/wordexp/Makefile.in
+++ b/libc/misc/wordexp/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/misc/wordexp
+
 CSRC := wordexp.c
 
 MISC_WORDEXP_DIR := $(top_srcdir)libc/misc/wordexp
diff --git a/libc/pwd_grp/Makefile.in b/libc/pwd_grp/Makefile.in
index 6805ffebd..6e183cc1c 100644
--- a/libc/pwd_grp/Makefile.in
+++ b/libc/pwd_grp/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/pwd_grp
+
 PWDGRP_DIR := $(top_srcdir)libc/pwd_grp
 PWDGRP_OUT := $(top_builddir)libc/pwd_grp
 
diff --git a/libc/signal/Makefile.in b/libc/signal/Makefile.in
index 8e904535a..f768b7019 100644
--- a/libc/signal/Makefile.in
+++ b/libc/signal/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/signal
+
 CSRC :=	allocrtsig.c killpg.c raise.c sigaction.c sigaddset.c sigandset.c \
 	sigblock.c sigdelset.c sigempty.c sigfillset.c siggetmask.c \
 	sigisempty.c sigismem.c sigjmp.c signal.c \
diff --git a/libc/stdio/Makefile.in b/libc/stdio/Makefile.in
index b9aecac5f..634b9a47d 100644
--- a/libc/stdio/Makefile.in
+++ b/libc/stdio/Makefile.in
@@ -8,6 +8,8 @@
 # Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
 #
 
+subdirs += libc/stdio
+
 # SUSv3 functions
 CSRC := \
 	fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index d12156876..eea0bb166 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/stdlib
+
 include $(top_srcdir)libc/stdlib/malloc/Makefile.in
 include $(top_srcdir)libc/stdlib/malloc-simple/Makefile.in
 include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
diff --git a/libc/stdlib/malloc-simple/Makefile.in b/libc/stdlib/malloc-simple/Makefile.in
index 4762d5744..0c050a235 100644
--- a/libc/stdlib/malloc-simple/Makefile.in
+++ b/libc/stdlib/malloc-simple/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/stdlib/malloc-simple
+
 STDLIB_MALLOC_SIMPLE_DIR := $(top_srcdir)libc/stdlib/malloc-simple
 STDLIB_MALLOC_SIMPLE_OUT := $(top_builddir)libc/stdlib/malloc-simple
 
diff --git a/libc/stdlib/malloc-standard/Makefile.in b/libc/stdlib/malloc-standard/Makefile.in
index 32884d10e..eb08f2699 100644
--- a/libc/stdlib/malloc-standard/Makefile.in
+++ b/libc/stdlib/malloc-standard/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/stdlib/malloc-standard
+
 # calloc.c can be found at uClibc/libc/stdlib/calloc.c
 # valloc.c can be found at uClibc/libc/stdlib/valloc.c
 CSRC := malloc.c calloc.c realloc.c free.c memalign.c mallopt.c mallinfo.c
diff --git a/libc/stdlib/malloc/Makefile.in b/libc/stdlib/malloc/Makefile.in
index 11b250dee..aff48a9ec 100644
--- a/libc/stdlib/malloc/Makefile.in
+++ b/libc/stdlib/malloc/Makefile.in
@@ -7,6 +7,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/stdlib/malloc
+
 CSRC :=	malloc.c calloc.c free.c realloc.c memalign.c \
 	heap_alloc.c heap_alloc_at.c heap_free.c
 
diff --git a/libc/string/Makefile.in b/libc/string/Makefile.in
index f0fa5b075..08a1856b7 100644
--- a/libc/string/Makefile.in
+++ b/libc/string/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/string/$(TARGET_ARCH) libc/string/generic
+
 #
 # Arch specific fun
 #
diff --git a/libc/sysdeps/linux/Makefile.commonarch b/libc/sysdeps/linux/Makefile.commonarch
index 2dad073ad..10cfc12c3 100644
--- a/libc/sysdeps/linux/Makefile.commonarch
+++ b/libc/sysdeps/linux/Makefile.commonarch
@@ -28,11 +28,10 @@ arch_clean:
 
 ifneq ($(ARCH_HEADERS),)
 
-ARCH_HEADERS_IN  := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS))
 ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS))
 
 $(ARCH_HEADERS_OUT):
-	$(do_ln) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@
+	$(do_ln) -fs $(call rel_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(@F) $@
 
 headers-y += $(ARCH_HEADERS_OUT)
 headers_clean-y += arch_headers_clean
diff --git a/libc/sysdeps/linux/Makefile.in b/libc/sysdeps/linux/Makefile.in
index c2d35a0cf..dd91f215f 100644
--- a/libc/sysdeps/linux/Makefile.in
+++ b/libc/sysdeps/linux/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/sysdeps/linux/$(TARGET_ARCH) libc/sysdeps/linux/common
+
 # order is relevant
 -include $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/Makefile.arch
 include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch
diff --git a/libc/termios/Makefile.in b/libc/termios/Makefile.in
index c77ee60e4..5e9d4fd48 100644
--- a/libc/termios/Makefile.in
+++ b/libc/termios/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/termios
+
 TERMIOS_DIR := $(top_srcdir)libc/termios
 TERMIOS_OUT := $(top_builddir)libc/termios
 
diff --git a/libc/unistd/Makefile.in b/libc/unistd/Makefile.in
index b4c5130a9..d830d8115 100644
--- a/libc/unistd/Makefile.in
+++ b/libc/unistd/Makefile.in
@@ -5,6 +5,8 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
+subdirs += libc/unistd
+
 UNISTD_DIR := $(top_srcdir)libc/unistd
 UNISTD_OUT := $(top_builddir)libc/unistd
 
-- 
cgit v1.2.3