summaryrefslogtreecommitdiff
path: root/tools/list-includes
blob: 5e04c1ae25da06d453fddc1dc1d3b6fad7a971f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

if uname -a | grep Darwin > /dev/null; then
    is_macos=1
else
    is_macos=0
fi
if [[ $is_macos == 1 ]]; then
    this_sed() {
        gsed "$@"
    }
else
    this_sed() {
        sed "$@"
    }
fi

cd ../include
tree -a -f --noreport -i | grep '\.h' | this_sed -r 's!^\./(.+?)$!#include "\1"!'