Inotifywait

Run a command every time a file is modified

while inotifywait -e close_write filename

do

make

done