#!/bin/sh -eu
# A target must be rebuilt when a dependency of a dependency changes.
>all.do printf 'redo-ifchange a\n'
>a.do printf 'redo-ifchange b\ndate +%s\n'
>b.do printf 'redo-ifchange c\ndate +%s\n'
>c printf '1'

redo
<a read -r timestamp_a1
<b read -r timestamp_b1

sleep 1
>c printf '2'

redo
<a read -r timestamp_a2
<b read -r timestamp_b2

test ${timestamp_a2} -gt ${timestamp_a1}
test ${timestamp_b2} -gt ${timestamp_b1}
