about summary refs log tree commit diff stats
path: root/scripts/generate_entry_header.sh
blob: b9e152dda1067066c11c6a385150c732fe745393 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

if [[ ! -d "src/libwifi" ]]; then
    echo "[!] You must run this script from the project directory root"
    exit 1
fi

rm src/libwifi.h
touch src/libwifi.h

# Generate Header
cat <<EOF > src/libwifi.h
#ifndef LIBWIFI_H
#define LIBWIFI_H

#ifdef __cplusplus
extern "C" {
#endif

$(find src -type f -name '*.h' -printf '%P\n' | sed '/libwifi.h/d' | sort | awk '{print "#include \"" $0 "\""}')

#ifdef __cplusplus
}
#endif

#endif /* LIBWIFI_H */
EOF

echo "[!] Generated libwifi entry header!"

exit 0