summaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
committerMattias Andrée <maandree@kth.se>2023-12-16 12:40:10 +0100
commit683f205402a99cfc8cea46c83ce9b46a42616d42 (patch)
treef6ee1619454a6ec8b9e31770bbbc2abf36aae2fd /mk
parentImprove portability (diff)
downloadlibsyscalls-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 'mk')
-rw-r--r--mk/generate.mk20
1 files changed, 18 insertions, 2 deletions
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) > $@
@@ -94,14 +101,23 @@ libsyscalls/short-enums.h: libsyscalls.h mk/generate.mk
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'; \