about summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorMarc <foxtrot@malloc.me>2021-11-30 22:39:26 +0000
committerMarc <foxtrot@malloc.me>2021-12-01 16:54:44 +0000
commitae6c98a48da409d040604aeffb84a38155fb5bac (patch)
treec27a8e28972209581ce3fba2130bf0c2b4f9c9c0 /scripts
downloadlibwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.gz
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.bz2
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.zip
Initial Commit
Signed-off-by: Marc <foxtrot@malloc.me>
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