about summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate_entry_header.sh31
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
3if [[ ! -d "src/libwifi" ]]; then
4 echo "[!] You must run this script from the project directory root"
5 exit 1
6fi
7
8rm src/libwifi.h
9touch src/libwifi.h
10
11# Generate Header
12cat <<EOF > src/libwifi.h
13#ifndef LIBWIFI_H
14#define LIBWIFI_H
15
16#ifdef __cplusplus
17extern "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 */
27EOF
28
29echo "[!] Generated libwifi entry header!"
30
31exit 0