diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
commit | 9f449569df9c94670f51fd8cd5558b66884cd877 (patch) | |
tree | 21d3c31e22b2cd0544351584c8614e70b66826e4 /mk/generate.mk | |
parent | Fourth commit (diff) | |
download | libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.gz libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.bz2 libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.xz |
Improve portability
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'mk/generate.mk')
-rw-r--r-- | mk/generate.mk | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mk/generate.mk b/mk/generate.mk index 9575c34..f5361c4 100644 --- a/mk/generate.mk +++ b/mk/generate.mk @@ -72,7 +72,7 @@ generated/oses.h: Makefile mk/generate.mk generated/lowercase.h: libsyscalls.h mk/generate.mk mkdir -p -- generated - sed -n 's/^\s*LIBSYSCALLS_CAT_\([A-Z0-9_]\+\).*$$/\1/p' < libsyscalls.h \ + sed -n 's/^$(s)*LIBSYSCALLS_CAT_\([A-Z0-9_]\{1,\}\).*$$/\1/p' < libsyscalls.h \ | grep -v '^\(SUPPORT_PENDING\|NOT_IMPLEMENTED\)$$' \ | while read uppercase; do \ printf '\43define LOWERCASE_%s %s\n' \ @@ -86,7 +86,7 @@ libsyscalls/short-enums.h: libsyscalls.h mk/generate.mk 'ifndef LIBSYSCALLS_H' \ ' error Do not include this header file directly' \ 'endif' - sed -n 's/^.*\b\(enum_libsyscalls_[A-Za-z0-9_]\+\)\([^A-Za-z0-9_].*\|\)$$/\1/p' < libsyscalls.h \ + sed -n 's/^\(.*[^A-Za-z0-9_]\)\{0,1\}\(enum_libsyscalls_[A-Za-z0-9_]\{1,\}\)\([^A-Za-z0-9_].*\|\)$$/\2/p' < libsyscalls.h \ | sort -u \ | xargs printf 'typedef unsigned short int %s;\n' \ >> $@ @@ -95,7 +95,7 @@ libsyscalls/short-enums.h: libsyscalls.h mk/generate.mk generated/macros.h: common.h mk/generate.mk set -e;\ for find in COUNT_ARG_PAIRS PARAMS_BUILD_TYPES; do \ - text="$$(sed -n 's/^\s*\x23\s*define\s\+'"$$find"'_1(/&/p' < common.h)"; \ + text="$$(sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$find"'_1(/&/p' < common.h)"; \ i=1; while (( i <= $(NPARAMS) )); do \ j=$$(( i + 1 )); \ printf '%s\n' "$$text" | sed -e "s/_2/_$$j/g" -e "s/_1/_$$i/g"; \ @@ -124,7 +124,7 @@ generated/macros.h: common.h mk/generate.mk fi; \ printf '\43define %s%s(X)%s\n' "$$a" "$$b" "$$c"; \ done; done; done; \ - done) | sed 's/_IN_OUT/_BI/' | sed 's/\(\s[A-Z]\+\)(/\1__(/' >> $@ + done) | sed 's/_IN_OUT/_BI/' | sed 's/\($(s)[A-Z]\{1,\}\)(/\1__(/' >> $@ SELF_CHECK_COMMAND = test "$(NPARAMS)" -le 16 |