#!/bin/bash
set -e
tool=build/clang-x86_64-pc-windows-msvc/Release/r3_gh_tool
cmake --build build/clang-x86_64-pc-windows-msvc/Release --target r3_gh_tool

scan_dir=tmps/gh_auto
file_list=files.txt
rm -f $file_list
for file in tmps/gh_auto/*.cxx; do
    echo $file >>$file_list
done
for file in tmps/gh_stub/*.cxx; do
    echo $file >>$file_list
done
for file in tmps/gh_fix/*.cxx; do
    echo $file >>$file_list
done

$tool @$file_list -v --log-file=log-functions.txt
$tool tmps/gh_global.h -mglobals -v --log-file=log-globals.txt
$tool -mduplicates -v --log-file=log-duplicates.txt
