aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index dbacf8b669..9e7679bcf4 100644
--- a/Makefile
+++ b/Makefile
@@ -117,6 +117,9 @@ include Makerules
# Install from subdirectories too.
install: subdir_install
+# Make sure that the dynamic linker is installed before libc.
+$(inst_slibdir)/libc-$(version).so: elf/subdir_install
+
# Create links for shared libraries using the `ldconfig' program is possible.
# Ignore the error if we cannot update /etc/ld.so.cache.
ifeq (no,$(cross-compiling))
@@ -185,20 +188,19 @@ $(version.c-objects): $(objpfx)version-info.h
subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
+$(common-objpfx)stub-%: subdir_install
+
# Since stubs.h is never needed when building the library, we simplify the
# hairy installation process by producing it in place only as the last part
-# of the top-level `make install'. It depends on subdir_install, which
-# iterates over all the subdirs; subdir_install in each subdir depends on
-# the subdir's stubs file. Having more direct dependencies would result in
-# extra iterations over the list for subdirs and many recursive makes.
-$(inst_includedir)/gnu/stubs.h: subdir_install
+# of the top-level `make install'.
+$(inst_includedir)/gnu/stubs.h: $(subdir-stubs)
$(make-target-directory)
@rm -f $(objpfx)stubs.h
(echo '/* This file is automatically generated.';\
echo ' It defines a symbol `__stub_FUNCTION'\'' for each function';\
echo ' in the C library which is a stub, meaning it will fail';\
echo ' every time called, usually setting errno to ENOSYS. */';\
- sort $(subdir-stubs)) > $(objpfx)stubs.h
+ sort $^) > $(objpfx)stubs.h
if test -r $@ && cmp -s $(objpfx)stubs.h $@; \
then echo 'stubs.h unchanged'; \
else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi