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 --- mk/generate.mk | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'mk') diff --git a/mk/generate.mk b/mk/generate.mk index f5361c4..7e81fb4 100644 --- a/mk/generate.mk +++ b/mk/generate.mk @@ -25,6 +25,9 @@ libsyscalls_get_datatype_description.lo: generated/types.c libsyscalls_get_integer_alignment.o: generated/integers.c libsyscalls_get_integer_alignment.lo: generated/integers.c +libsyscalls_get_struct_description.o: generated/structs.c +libsyscalls_get_struct_description.lo: generated/structs.c + $(GET_SYSCALL_RANGE_GEN): get_syscall_range.template.c mk/generate.mk mkdir -p -- generated @@ -56,6 +59,10 @@ generated/integers.c: Makefile mk/generate.mk mkdir -p -- generated printf '\43include "../%s/integers.c"\n' $(OPERATING_SYSTEMS) > $@ +generated/structs.c: Makefile mk/generate.mk + mkdir -p -- generated + printf '\43include "../%s/structs.c"\n' $(OPERATING_SYSTEMS) > $@ + generated/arches.h: Makefile mk/generate.mk mkdir -p -- generated printf '\43include "%s-arches.h"\n' $(OPERATING_SYSTEMS) > $@ @@ -93,15 +100,24 @@ libsyscalls/short-enums.h: libsyscalls.h mk/generate.mk chmod -- a-w $@ generated/macros.h: common.h mk/generate.mk + set -e;\ + for find in COUNT_ARGS; do \ + text="$$(sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$find"'_1(/&/p' < common.h)"; \ + i=1; while (( i <= $(NFIELDS) )); do \ + j=$$(( i + 1 )); \ + printf '%s\n' "$$text" | sed -e "s/_1/_ZZZ/g" -e "s/_2/_$$j/g" -e "s/_ZZZ/_$$i/g"; \ + i=$$j; \ + done; \ + done > $@; set -e;\ for find in COUNT_ARG_PAIRS PARAMS_BUILD_TYPES; do \ 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"; \ + printf '%s\n' "$$text" | sed -e "s/_1/_ZZZ/g" -e "s/_2/_$$j/g" -e "s/_ZZZ/_$$i/g"; \ i=$$j; \ done; \ - done > $@; + done >> $@; (set -e; \ nparamspairs="$$(i=1; while (( i <= $(NPARAMS) )); do printf '%s\n' $$i $$i; : $$(( i++ )); done)"; \ printf '\43define PARAMS_BUILD_MASK(MASK, ...)\\\n'; \ -- cgit v1.2.3-70-g09d2