#!/bin/sh -e

root=${0%/*}
redo-ifchange $root/../compile_flags.txt
cflags=$(cat $root/../compile_flags.txt)
[ $# -eq 0 ] && srcs=*.c || srcs="$@"
for c in $srcs ; do
    include-what-you-use $cflags -Xiwyu \
        --mapping_file=$(realpath $root/iwyu-maps.imp) $c 2>&1
done
