Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/nolibc: make the "headers" target install all supported archs

The efforts we go through by installing a single arch are counter
productive when the base directory already supports them all, and
the arch-specific files are really small. Let's make the "headers"
target simply install headers for all supported archs and stop
trying to build a hybrid "arch.h" file on the fly, to instead keep
the generic one. Now the same nolibc headers installation will be
usable with any arch-specific uapi installation.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

authored by

Willy Tarreau and committed by
Thomas Weißschuh
1868c027 44bf8bbe

+6 -13
+6 -13
tools/include/nolibc/Makefile
··· 23 23 Q=@ 24 24 endif 25 25 26 - arch_file := arch-$(ARCH).h 26 + arch_files := arch.h $(wildcard arch-*.h) 27 27 all_files := \ 28 28 compiler.h \ 29 29 crt.h \ ··· 82 82 @echo "Supported targets under nolibc:" 83 83 @echo " all call \"headers\"" 84 84 @echo " clean clean the sysroot" 85 - @echo " headers prepare a sysroot in \$${OUTPUT}sysroot" 85 + @echo " headers prepare a multi-arch sysroot in \$${OUTPUT}sysroot" 86 86 @echo " headers_standalone like \"headers\", and also install kernel headers" 87 87 @echo " help this help" 88 88 @echo "" ··· 93 93 @echo " OUTPUT = $(OUTPUT)" 94 94 @echo "" 95 95 96 + # installs headers for all archs at once. 96 97 headers: 97 - $(Q)mkdir -p $(OUTPUT)sysroot 98 - $(Q)mkdir -p $(OUTPUT)sysroot/include 99 - $(Q)cp --parents $(all_files) $(OUTPUT)sysroot/include/ 100 - $(Q)if [ "$(ARCH)" = "i386" -o "$(ARCH)" = "x86_64" ]; then \ 101 - cat arch-x86.h; \ 102 - elif [ -e "$(arch_file)" ]; then \ 103 - cat $(arch_file); \ 104 - else \ 105 - echo "Fatal: architecture $(ARCH) not yet supported by nolibc." >&2; \ 106 - exit 1; \ 107 - fi > $(OUTPUT)sysroot/include/arch.h 98 + $(Q)mkdir -p "$(OUTPUT)sysroot" 99 + $(Q)mkdir -p "$(OUTPUT)sysroot/include" 100 + $(Q)cp --parents $(arch_files) $(all_files) "$(OUTPUT)sysroot/include/" 108 101 109 102 headers_standalone: headers 110 103 $(Q)$(MAKE) -C $(srctree) headers