From 683f205402a99cfc8cea46c83ce9b46a42616d42 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 16 Dec 2023 12:40:10 +0100 Subject: All kinds of stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- linux/syscall-table.mk | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'linux/syscall-table.mk') diff --git a/linux/syscall-table.mk b/linux/syscall-table.mk index 7e6fb1a..a90be35 100644 --- a/linux/syscall-table.mk +++ b/linux/syscall-table.mk @@ -10,7 +10,7 @@ libsyscalls_get_syscall_range.o: $(LINUX_SYSCALLS_HDR) libsyscalls_get_syscall_range.lo: $(LINUX_SYSCALLS_HDR) -generated/linux-syscall-table.h: linux/syscall-table.c common.h linux/linux-support.mk +generated/linux-syscall-table.h: linux/syscall-table.c common.h linux/linux-support.mk linux/syscall-table.mk set -e; \ macros="$$(sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}MAKE_\([^(]*\)(.*$$/\1/p' < linux/syscall-table.c)"; \ for arch in $(SUPPORTED_LINUX_ARCHES); do \ @@ -18,17 +18,19 @@ generated/linux-syscall-table.h: linux/syscall-table.c common.h linux/linux-supp printf '\43define MAKE_%s_%s(...) MAKE_%s(%s, __VA_ARGS__)\n' \ "$$arch" "$$macro" "$$macro" "$$arch"; \ done; \ - done > $@ + done \ + | sed 's/_[BL]E\([_,]\)/\1/g' \ + | sort -u > $@ -generated/linux-syscalls.h: linux/syscalls.mk +generated/linux-syscalls.h: linux/syscalls.mk linux/syscall-table.mk mkdir -p -- generated printf '\43include "%s"\n' $(LINUX_SYSCALLS_HDR) \ | grep -v '"$@"' \ | sed 's:generated/::' > $@ -generated/linux-syscall-ranges.h: $(LINUX_SYSCALLS_ARCH_HDR) +generated/linux-syscall-ranges.h: $(LINUX_SYSCALLS_ARCH_HDR) linux/syscall-table.mk printf '%s\n' 'This may take some time ...'; \ set -e; arch=; \ cat -- $(LINUX_SYSCALLS_ARCH_HDR) \ @@ -60,3 +62,7 @@ generated/linux-syscall-ranges.h: $(LINUX_SYSCALLS_ARCH_HDR) MIN "$$arch" "$$min" \ MAX "$$arch" "$$max"; \ ) > $@ + printf '\43define MIN_LINUX_SYSCALL_FOR_%s\n' $(SUPPORTED_LINUX_ARCHES) \ + | sed -n 's/\(MIN_LINUX_SYSCALL_FOR_.*\)_[LB]E$$/& \1/p' >> $@ + printf '\43define MAX_LINUX_SYSCALL_FOR_%s\n' $(SUPPORTED_LINUX_ARCHES) \ + | sed -n 's/\(MAX_LINUX_SYSCALL_FOR_.*\)_[LB]E$$/& \1/p' >> $@ -- cgit v1.2.3-70-g09d2