]> granicus.if.org Git - strace/blob - generate_mpers_am.sh
Move string_to_uint* functions to a separate file
[strace] / generate_mpers_am.sh
1 #!/bin/sh -e
2
3 list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
4         xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |
5         tr '\n' ' ')"
6
7 cat > mpers.am <<EOF
8 # Generated by $0; do not edit.
9 mpers_source_files = $list
10 EOF
11
12 sed -r -n 's/^#[[:space:]]*include[[:space:]]*"xlat\/([a-z][a-z_0-9]*)\.h".*/extern const struct xlat \1[];/p' \
13         $list > mpers_xlat.h