about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 19 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c0a0cfb828..89588c1e8a 100644
--- a/Makefile
+++ b/Makefile
@@ -170,14 +170,29 @@ others: $(common-objpfx)testrun.sh
 
 subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
 
-ifeq ($(biarch),no)
+ifndef abi-variants
 installed-stubs = $(inst_includedir)/gnu/stubs.h
 else
-installed-stubs = $(inst_includedir)/gnu/stubs-$(biarch).h
+installed-stubs = $(inst_includedir)/gnu/stubs-$(default-abi).h
 
-$(inst_includedir)/gnu/stubs.h: include/stubs-biarch.h $(+force)
+$(inst_includedir)/gnu/stubs.h: $(common-objpfx)soversions.mk $(+force)
 	$(make-target-directory)
-	$(INSTALL_DATA) $< $@
+	{ \
+	 echo '/* This file is automatically generated.';\
+	 echo "   This file selects the right generated file of \`__stub_FUNCTION' macros";\
+	 echo '   based on the architecture being compiled for.  */'; \
+	 echo ''; \
+	 $(foreach h,$(abi-includes), echo '#include <$(h)>';) \
+	 echo ''; \
+	 $(foreach v,$(abi-variants),\
+	 $(if $(abi-$(v)-condition),\
+	 echo '#if $(abi-$(v)-condition)'; \
+	 echo '# include <gnu/stubs-$(v).h>'); \
+	 $(if $(abi-$(v)-condition),echo '#endif';) \
+	 rm -f $(@:.d=.h).new$(v); \
+	 ) \
+	} > $(@:.d=.h).new
+	mv -f $(@:.d=.h).new $(@:.d=.h)
 
 install-others-nosubdir: $(installed-stubs)
 endif