redo-ifcreate
—
rebuild target when its dependecies are created
The
redo-ifcreate
utility declares the non-existent
file as a dependency to the current target, and rebuild
if any dependency is created.
The redo-ifcreate
utility exits 0
on success, and >0 if an error occurs.
# default.o.do
# makes possible to use generic or specific cflags
if [ -e $2.cflags ]; then
redo-ifchange $2.cflags
CFLAGS=$(cat $2.cflags)
else
redo-ifcreate $2.cflags
redo-ifchange default.cflags
CFLAGS=$(cat default.cflags)
fi
redo-ifchange $2.c
cc $CFLAGS -o $3 $2.c