diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/generate_entry_header.sh | 31 |
1 files changed, 31 insertions, 0 deletions
| diff --git a/scripts/generate_entry_header.sh b/scripts/generate_entry_header.sh new file mode 100755 index 0000000..b9e152d --- /dev/null +++ b/scripts/generate_entry_header.sh | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | if [[ ! -d "src/libwifi" ]]; then | ||
| 4 | echo "[!] You must run this script from the project directory root" | ||
| 5 | exit 1 | ||
| 6 | fi | ||
| 7 | |||
| 8 | rm src/libwifi.h | ||
| 9 | touch src/libwifi.h | ||
| 10 | |||
| 11 | # Generate Header | ||
| 12 | cat <<EOF > src/libwifi.h | ||
| 13 | #ifndef LIBWIFI_H | ||
| 14 | #define LIBWIFI_H | ||
| 15 | |||
| 16 | #ifdef __cplusplus | ||
| 17 | extern "C" { | ||
| 18 | #endif | ||
| 19 | |||
| 20 | $(find src -type f -name '*.h' -printf '%P\n' | sed '/libwifi.h/d' | sort | awk '{print "#include \"" $0 "\""}') | ||
| 21 | |||
| 22 | #ifdef __cplusplus | ||
| 23 | } | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #endif /* LIBWIFI_H */ | ||
| 27 | EOF | ||
| 28 | |||
| 29 | echo "[!] Generated libwifi entry header!" | ||
| 30 | |||
| 31 | exit 0 | ||
