diff options
author | Marc <foxtrot@malloc.me> | 2021-11-30 22:39:26 +0000 |
---|---|---|
committer | Marc <foxtrot@malloc.me> | 2021-12-01 16:54:44 +0000 |
commit | ae6c98a48da409d040604aeffb84a38155fb5bac (patch) | |
tree | c27a8e28972209581ce3fba2130bf0c2b4f9c9c0 /scripts/generate_entry_header.sh | |
download | libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.gz libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.bz2 libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.zip |
Initial Commit
Signed-off-by: Marc <foxtrot@malloc.me>
Diffstat (limited to 'scripts/generate_entry_header.sh')
-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 | ||