REDO-IFCREATE(1) General Commands Manual REDO-IFCREATE(1)

redo-ifcreaterebuild target when its dependecies are created

redo-ifcreate [file ...]

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

redo(1) redo-always(1), redo-ifchange(1)

June 3, 2022 EltaninOS