diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-16 12:40:10 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-16 12:40:10 +0100 |
commit | 683f205402a99cfc8cea46c83ce9b46a42616d42 (patch) | |
tree | f6ee1619454a6ec8b9e31770bbbc2abf36aae2fd /linux/syscall-table.mk | |
parent | Improve portability (diff) | |
download | libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.gz libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.bz2 libsyscalls-683f205402a99cfc8cea46c83ce9b46a42616d42.tar.xz |
All kinds of stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | linux/syscall-table.mk | 14 |
1 files changed, 10 insertions, 4 deletions
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' >> $@ |